| Summary: | [eslint][quickfix] no-unsued-vars rule needs option to mark global var as used/exported in another file plus quickfix | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Jenny Han <jhan> |
| Component: | JS Tools | Assignee: | Curtis Windatt <curtis.windatt.public> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public |
| Version: | unspecified | ||
| Target Milestone: | 13.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Jenny Han
no-unused-vars only considers the contents of the file in which it is defined. If you are using a module system you would have mark the variable as exported if it was going to be used in another file. In this case you are adding things to the global scope which happens to be used in another file. The ESLint upstream implementation of the rule requires you to mark implicit exports like this with a /* exported */ comment. http://eslint.org/docs/rules/no-unused-vars We could do the same for our rule with a matching quick fix to mark global vars with the comment. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=631bec75104df498b9b52da861dc3577a79d97e1 Fixed in master with tests However, I did not add a new quickfix which makes this feature not very discoverable. Our quickfixes plugin is set up to provide one quickfix for a given problem id and the 'remove unused var' quickfix is far more helpful. Supporting exported keyword is worthwhile to keep us inline with the upstream eslint rule. |