Nuxt/.eslintrc.js

85 lines
1.7 KiB
JavaScript
Raw Normal View History

2016-11-07 01:34:58 +00:00
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
2016-11-07 01:34:58 +00:00
sourceType: 'module'
},
env: {
browser: true,
2018-03-18 07:56:41 +00:00
node: true,
'jest/globals': true
2016-11-07 01:34:58 +00:00
},
2018-03-16 19:52:03 +00:00
extends: [
'standard',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:vue/recommended'
2018-03-16 19:52:03 +00:00
],
2016-11-07 01:34:58 +00:00
plugins: [
'vue',
2018-03-18 07:56:41 +00:00
'jest'
2016-11-07 01:34:58 +00:00
],
2018-03-16 19:52:03 +00:00
settings: {
'import/resolver': {
node: { extensions: ['.js', '.mjs'] }
}
},
2016-11-07 01:34:58 +00:00
rules: {
2018-03-16 19:52:03 +00:00
// Enforce import order
'import/order': 2,
// Imports should come first
'import/first': 2,
// Other import rules
'import/no-mutable-exports': 2,
2018-03-16 19:52:03 +00:00
// 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 }],
2018-03-16 19:52:03 +00:00
// Allow async-await
2016-11-07 01:34:58 +00:00
'generator-star-spacing': 0,
2018-03-16 19:52:03 +00:00
// Allow debugger during development
2016-12-08 15:41:20 +00:00
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
2018-03-16 19:52:03 +00:00
2018-08-08 10:54:05 +00:00
// Prefer const over let
'prefer-const': [2, {
'destructuring': 'any',
'ignoreReadBeforeAssign': false
2018-08-08 10:54:05 +00:00
}],
2018-08-10 19:46:53 +00:00
// 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,
2018-08-08 10:54:05 +00:00
2018-08-10 19:46:53 +00:00
// Force dot notation when possible
'dot-notation': 2,
2018-08-10 19:46:53 +00:00
'no-var': 2,
2018-03-16 19:52:03 +00:00
// 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,
}]
2016-11-07 01:34:58 +00:00
},
2018-03-16 19:52:03 +00:00
2016-11-07 01:34:58 +00:00
globals: {}
}