ESLint configuration is invalid: Unexpected top-level property "ecmaFeatures".
I'm submitting a bug report
- Library Version: 1.0.0
Please tell us about your environment:
-
Operating System: Linux (Xubuntu 16.04)
-
Node Version: 8.1.0
- NPM Version: 5.0.3
-
Browser: all?
-
Language: ESNext
Current behavior: the .eslintrc.json file is only valid for eslint <2.0.0, and as such the linter fails to do it's job.
acoording to the eslint docs
Prior to 2.0.0, the way to enable language options was by using ecmaFeatures in your configuration. In 2.0.0:
- The ecmaFeatures property is now under a top-level parserOptions property. if you run the linter you get an error:

and the .eslintrc.json just references aurelia-tools
{
"extends": "./node_modules/aurelia-tools/.eslintrc.json"
}
Expected/desired behavior:
-
What is the expected behavior? that the .eslintrc.json be updated to work with the latest version of eslint. Our project is based on one of the ESNext skeletons, and their .eslintrc.json reference aurelia-tools' .eslintrc.json
-
What is the motivation / use case for changing the behavior? We need good tooling as part of "aurelia-tools"
I may be wrong but something worth considering would be to replace in the .eslintrc.json file
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": false,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": false,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
"jsx": false
}
with
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": false,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": false,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
"jsx": false
}
}
I can probably submit a pr. what version of ESLint does aurelia use on it's other libraries? is v4 fine?@EisenbergEffect
@obedm503 Please note that the modification I propose is already usable (but only recommended) for the currently used version of ESLint in Aurelia projects, that is 3.1.1 (as seen in aurelia-framework). It just becomes mandatory when someone uses ESLint v4.0.0 and above.
As lont as it works with aurelia-framework and you provide us with some instructions to make any necessary updates, I think that is fine. We may want to bump our aurelia-tools by a major version if you think it will break someone.
it's worth noting that with no changes even aurelia-tools src had some linting errors before the update
FIX. add to eslintrc rule: "jsx-a11y/href-no-hash": "off"