Schema validation modifies exported config object in .eslintrc.js
See original GitHub issueTell us about your environment
- ESLint Version: 6.7.0
- Node Version: 12.13.1
- npm Version: 6.12.1
What parser (default, Babel-ESLint, etc.) are you using? babel-eslint
Please show your full configuration:
Configuration
// .eslintrc.basic.js
module.exports = {
plugins: [],
extends: [
'eslint:all'
],
parser: 'espree',
parserOptions: {
ecmaVersion: 7,
sourceType: 'module'
},
settings: {},
env: {
es6: true
},
rules: {
'camelcase': ['warn', {properties: 'never'}]
}
}
// .eslintrc.babel.js
let _basic = require('./.eslintrc.basic');
module.exports = {
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
plugins: [
'babel'
],
rules: {
camelcase: 'off',
'babel/camelcase': _basic.rules.camelcase
}
};
// .eslintrc.js
module.exports: {
extends: [
'./.eslintrc.basic.js',
'./.eslintrc.babel.js'
]
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
N/A
N/A
What did you expect to happen?
I expected no errors.
What actually happened? Please include the actual, raw output from ESLint.
Configuration for rule "babel/camelcase" is invalid:
Value {"properties":"never","ignoreDestructuring":false,"ignoreImports":false} should NOT have additional properties.
This happens because of https://github.com/eslint/eslint/pull/12528 adding ignoreImports
with default value failse
, and because the defaults of camelcase
are merged into the same object in .eslintrc.basic.js:rules.camelcase
, which is also the same reference in .eslintrc.babel.js:rules.@babel/camelcase
.
Are you willing to submit a pull request to fix this bug?
Sure.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:26 (17 by maintainers)
Top GitHub Comments
I’ll tackle this as part of the new config system.
Reopening this so we can find another solution.