Created
October 27, 2019 10:18
-
-
Save ulcuber/8d8fb10c5e651b5e17d7a7321326cd83 to your computer and use it in GitHub Desktop.
eslint config for laravel-mix without vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const OFF = 'off'; | |
const WARN = 'warn'; | |
const ERROR = 'error'; | |
module.exports = { | |
root: true, | |
env: { | |
node: true, | |
browser: true, | |
}, | |
extends: [ | |
'airbnb-base', | |
], | |
rules: { | |
'no-console': process.env.NODE_ENV === 'production' ? ERROR : OFF, | |
'no-debugger': process.env.NODE_ENV === 'production' ? ERROR : OFF, | |
// import | |
'import/no-commonjs': ERROR, | |
'import/no-extraneous-dependencies': OFF, | |
'import/extensions': [ | |
ERROR, | |
'always', | |
{ | |
js: 'never', | |
}, | |
], | |
// airbnb-base | |
complexity: [WARN, 11], | |
'no-eq-null': ERROR, | |
'no-magic-numbers': [ERROR, { | |
ignore: [0, -1, 1, 100], | |
ignoreArrayIndexes: true, | |
enforceConst: true, | |
detectObjects: false, | |
}], | |
'no-param-reassign': [ERROR, { | |
props: true, | |
ignorePropertyModificationsFor: [ | |
'e', // for e.return value | |
], | |
}], | |
}, | |
parserOptions: { | |
parser: 'babel-eslint', | |
parserOptions: { | |
ecmaVersion: 2017, | |
sourceType: 'module', | |
}, | |
}, | |
overrides: [ | |
{ | |
files: ['*.config.*', 'webpack.*'], | |
rules: { | |
'import/no-commonjs': OFF, | |
'global-require': OFF, | |
}, | |
}, | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment