-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[[Fix]] Disallow ambiguous configuration values
In the presence of the recently-introduced `esversion` option, JSHint should reject any occurrence of the equivalent legacy options: `es3`, `es5`, and `esnext`. Previous implementation conflated the user-specified option values and the state of the linter itself. Without a formal distinction between these two concepts, it was not possible to consistently enforce this constraint. For example, the value of `state.option.esversion` could be set to `5` directly (i.e. `esversion: 5`) or indirectly (i.e. `es5: true`), but only in the former case would a later in-line configuration of `esversion: 6` be acceptable. Achieve this by making an explicit distinction between user-specified option values (in other words, the `es3`, `es5`, `esnext`, and `esversion` properties of the `state.option` object) and the state of the linter itself (the new `state.esVersion` property).
- Loading branch information
1 parent
91fa4ea
commit eb54a4c
Showing
3 changed files
with
49 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters