Please sign in to comment.
[[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...
Showing with 49 additions and 40 deletions.