mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
improve eslint
This commit is contained in:
parent
efd7c1b4d1
commit
46216e6548
37
.eslintrc.js
37
.eslintrc.js
@ -8,20 +8,44 @@ module.exports = {
|
||||
browser: true,
|
||||
node: true
|
||||
},
|
||||
extends: ['standard', 'standard-jsx'],
|
||||
extends: [
|
||||
'standard',
|
||||
'standard-jsx',
|
||||
'plugin:import/errors',
|
||||
'plugin:import/warnings'
|
||||
],
|
||||
// required to lint *.vue files
|
||||
plugins: [
|
||||
'html'
|
||||
],
|
||||
// add your custom rules here
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
node: { extensions: ['.js', '.mjs'] }
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
// allow paren-less arrow functions
|
||||
// Enforce import order
|
||||
'import/order': 2,
|
||||
|
||||
// Imports should come first
|
||||
'import/first': 2,
|
||||
|
||||
// Other import rules
|
||||
"import/no-mutable-exports": 2,
|
||||
|
||||
// Allow unresolved imports
|
||||
'import/no-unresolved': 0,
|
||||
|
||||
// Allow paren-less arrow functions
|
||||
'arrow-parens': 0,
|
||||
// allow async-await
|
||||
|
||||
// Allow async-await
|
||||
'generator-star-spacing': 0,
|
||||
// allow debugger during development
|
||||
|
||||
// Allow debugger during development
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
||||
// do not allow console.logs etc...
|
||||
|
||||
// Do not allow console.logs etc...
|
||||
'no-console': 2,
|
||||
'space-before-function-paren': [
|
||||
2,
|
||||
@ -31,5 +55,6 @@ module.exports = {
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
globals: {}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@
|
||||
"test": "npm run lint && nyc ava --verbose test/ -- && nyc report --reporter=html",
|
||||
"test-appveyor": "npm run lint && nyc ava --serial test/ -- && nyc report --reporter=html",
|
||||
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
||||
"lint": "eslint --ext .js,.vue bin/* build/ lib/ test/ examples/",
|
||||
"lint": "eslint --ext .js,.mjs,.vue bin/* build/ lib/ test/ examples/",
|
||||
"precommit": "npm run lint",
|
||||
"postinstall": "opencollective postinstall || exit 0"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user