| Summary: | Warn when browser.json or other library isn't loaded in Tern (prev: No proposals found in simple HTML file) | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> |
| Component: | JS Tools | Assignee: | Curtis Windatt <curtis.windatt.public> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | curtis.windatt.public |
| Version: | 12.0 | ||
| Target Milestone: | 13.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
This is working for me in both my host and my target up to date with master. ESLint does give me an annotation for document not being defined because no eslint-env is set. The problem is because I have a .tern-project file that does not load the 'browser.json' definition. We should have a linting rule (or update an existing rule) to check for not- started definitions - or just have one that specifically check for the browser.json / HTML case Just ran into this. We don't warn about it for the eslint env directive or for usage of types from browser. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=ac424b50831814c2d8f23c1c68609ac4222035ea Fixed in master New subtype of check-tern-plugin problem. Has it's own message and quickfix and tests. Right now there aren't many 'known' libraries (ecma*, browser, chai). This works for the default browser env set for HTML files. However, I did have to modify the annotations to include the plugin/lib name because the quickfix can't extract the name from the source when there isn't any. *** Bug 494582 has been marked as a duplicate of this bug. *** |
Consider the following snippet: <!DOCTYPE html> <head> <script language="javascript"> function f() { document. }; </script> </head> <html> </html> you get no proposals for document. At first I figured this was due to the missing eslint-env directive, but some debugging revealed its not (we are correctly auto-assuming the browser env).