| Summary: | [eslint] Make eslint aware of envs if the corresponding index is loaded in Tern | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Sebastian Pahnke <pahnke.sebastian> |
| Component: | JS Tools | Assignee: | Curtis Windatt <curtis.windatt.public> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public, Michael_Rennie, Olivier_Thomann |
| Version: | 13.0 | ||
| Target Milestone: | 13.0 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 496701, 497870 | ||
|
Description
Sebastian Pahnke
I think the fix is simpler than adding all defs to the environment. If we can find type definition for the var/function then we don't mark a problem. There is no need to check the eslint-env at all. The question then is what we want the quick fixes to do. Quickfixes on console will add browser to eslint-env, foo() will add foo to globals, require will add amd to eslint-env. The fixes will still remove the problem marker but they will not fix the project setup (like adding browser to to the .tern-project defs). Are we ok with this? http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=aa586d472bcf8c145b39fccf8e0f4302351df948 All tests pass with this change so I've pushed it to master. Give it a try and see whether this behaviour is satisfactory. If we can, I'd like to replace the add to eslint-env quickfix with the 'fix your project setup' quick fix we already use. Currently we don't support it at all for missing definitions and it ends up being a two step process (add to eslint-env, get warning there, quickfix to fix project setup) for missing plugins such as using require() without node started. *** Bug 496701 has been marked as a duplicate of this bug. *** I opened Bug 497870 to follow up on the quick fix update. I'm marking this as fixed as the problems do not get reported anymore. |