|
| 1 | +// https://eslint.org/docs/user-guide/configuring |
| 2 | + |
| 3 | +module.exports = { |
| 4 | + root: true, |
| 5 | + parserOptions: { |
| 6 | + parser: 'babel-eslint' |
| 7 | + }, |
| 8 | + env: { |
| 9 | + browser: true, |
| 10 | + }, |
| 11 | + // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention |
| 12 | + // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. |
| 13 | + extends: ['plugin:vue/essential', 'airbnb-base'], |
| 14 | + // required to lint *.vue files |
| 15 | + plugins: [ |
| 16 | + 'vue' |
| 17 | + ], |
| 18 | + // check if imports actually resolve |
| 19 | + settings: { |
| 20 | + 'import/resolver': { |
| 21 | + webpack: { |
| 22 | + config: 'build/webpack.base.conf.js' |
| 23 | + } |
| 24 | + } |
| 25 | + }, |
| 26 | + // add your custom rules here |
| 27 | + rules: { |
| 28 | + // don't require .vue extension when importing |
| 29 | + 'import/extensions': ['error', 'always', { |
| 30 | + js: 'never', |
| 31 | + vue: 'never' |
| 32 | + }], |
| 33 | + // disallow reassignment of function parameters |
| 34 | + // disallow parameter object manipulation except for specific exclusions |
| 35 | + 'no-param-reassign': ['error', { |
| 36 | + props: true, |
| 37 | + ignorePropertyModificationsFor: [ |
| 38 | + 'state', // for vuex state |
| 39 | + 'acc', // for reduce accumulators |
| 40 | + 'e' // for e.returnvalue |
| 41 | + ] |
| 42 | + }], |
| 43 | + // allow optionalDependencies |
| 44 | + 'import/no-extraneous-dependencies': ['error', { |
| 45 | + optionalDependencies: ['test/unit/index.js'] |
| 46 | + }], |
| 47 | + // allow debugger during development |
| 48 | + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' |
| 49 | + } |
| 50 | +} |
0 commit comments