mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +00:00
lint: use @nuxtjs/eslint-config (#4108)
This commit is contained in:
parent
657d0a8499
commit
e115890a94
78
.eslintrc.js
78
.eslintrc.js
@ -4,81 +4,7 @@ module.exports = {
|
|||||||
parser: 'babel-eslint',
|
parser: 'babel-eslint',
|
||||||
sourceType: 'module'
|
sourceType: 'module'
|
||||||
},
|
},
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
node: true,
|
|
||||||
'jest/globals': true
|
|
||||||
},
|
|
||||||
extends: [
|
extends: [
|
||||||
'standard',
|
'@nuxtjs'
|
||||||
'plugin:import/errors',
|
]
|
||||||
'plugin:import/warnings',
|
|
||||||
'plugin:vue/recommended'
|
|
||||||
],
|
|
||||||
plugins: [
|
|
||||||
'vue',
|
|
||||||
'jest'
|
|
||||||
],
|
|
||||||
settings: {
|
|
||||||
'import/resolver': {
|
|
||||||
node: { extensions: ['.js', '.mjs'] }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// 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 only when there's no braces
|
|
||||||
'arrow-parens': [2, 'as-needed', { requireForBlockBody: true }],
|
|
||||||
|
|
||||||
// Allow async-await
|
|
||||||
'generator-star-spacing': 0,
|
|
||||||
|
|
||||||
// Allow debugger during development
|
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
|
||||||
|
|
||||||
// Prefer const over let
|
|
||||||
'prefer-const': [2, {
|
|
||||||
'destructuring': 'any',
|
|
||||||
'ignoreReadBeforeAssign': false
|
|
||||||
}],
|
|
||||||
|
|
||||||
// No single if in an "else" block
|
|
||||||
'no-lonely-if': 2,
|
|
||||||
|
|
||||||
// Force curly braces for control flow
|
|
||||||
curly: 2,
|
|
||||||
|
|
||||||
// No async function without await
|
|
||||||
'require-await': 2,
|
|
||||||
|
|
||||||
// Force dot notation when possible
|
|
||||||
'dot-notation': 2,
|
|
||||||
|
|
||||||
'no-var': 2,
|
|
||||||
|
|
||||||
// Do not allow console.logs etc...
|
|
||||||
'no-console': 2,
|
|
||||||
'space-before-function-paren': [2, {
|
|
||||||
anonymous: 'always',
|
|
||||||
named: 'never'
|
|
||||||
}],
|
|
||||||
'vue/no-parsing-error': [2, {
|
|
||||||
'x-invalid-end-tag': false
|
|
||||||
}],
|
|
||||||
'vue/max-attributes-per-line': [2, {
|
|
||||||
'singleline': 5,
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
|
|
||||||
globals: {}
|
|
||||||
}
|
}
|
||||||
|
@ -139,6 +139,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-env": "^7.1.0",
|
"@babel/preset-env": "^7.1.0",
|
||||||
|
"@nuxtjs/eslint-config": "^0.0.1",
|
||||||
"babel-core": "^7.0.0-bridge",
|
"babel-core": "^7.0.0-bridge",
|
||||||
"babel-eslint": "^10.0.1",
|
"babel-eslint": "^10.0.1",
|
||||||
"babel-jest": "^23.6.0",
|
"babel-jest": "^23.6.0",
|
||||||
|
@ -685,6 +685,10 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
consola "^1.4.3"
|
consola "^1.4.3"
|
||||||
|
|
||||||
|
"@nuxtjs/eslint-config@^0.0.1":
|
||||||
|
version "0.0.1"
|
||||||
|
resolved "https://registry.npmjs.org/@nuxtjs/eslint-config/-/eslint-config-0.0.1.tgz#3aeed1cc6a2e01331c7e6b56bfa7152ce8bb2d90"
|
||||||
|
|
||||||
"@nuxtjs/friendly-errors-webpack-plugin@^2.0.2":
|
"@nuxtjs/friendly-errors-webpack-plugin@^2.0.2":
|
||||||
version "2.0.2"
|
version "2.0.2"
|
||||||
resolved "http://registry.npmjs.org/@nuxtjs/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-2.0.2.tgz#80fd4c4276e87c09a9157a6f433724235eaaaf6e"
|
resolved "http://registry.npmjs.org/@nuxtjs/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-2.0.2.tgz#80fd4c4276e87c09a9157a6f433724235eaaaf6e"
|
||||||
|
Loading…
Reference in New Issue
Block a user