1f61f21250
- add prettier to do formatting - add eslint-config-prettier to disable rules conflicting with prettier - remove eslint from grunt workflow - use lint-stage to lint and format on precommit - use eslint and prettier in travis directly - remove rules that are already part of the "recommended" ruleset That rational is that eslint and prettier should be run in Travis-CI, on commit and as IDE integration (highlighting errors directlry). They don't need to be run along with test-cases. Getting linting errors when running the tests because of missing semicolons is just annoying, but doesn't help the overall code-quality.
68 lines
1.6 KiB
JavaScript
68 lines
1.6 KiB
JavaScript
module.exports = {
|
|
extends: ['eslint:recommended', 'plugin:compat/recommended', 'prettier'],
|
|
globals: {
|
|
self: false
|
|
},
|
|
env: {
|
|
node: true,
|
|
es6: true
|
|
},
|
|
rules: {
|
|
'no-console': 'warn',
|
|
|
|
// temporarily disabled until the violating places are fixed.
|
|
'no-func-assign': 'off',
|
|
'no-sparse-arrays': 'off',
|
|
|
|
// Best Practices //
|
|
//----------------//
|
|
'default-case': 'warn',
|
|
'dot-notation': ['error', { allowKeywords: false }],
|
|
'guard-for-in': 'warn',
|
|
'no-alert': 'error',
|
|
'no-caller': 'error',
|
|
'no-div-regex': 'warn',
|
|
'no-eval': 'error',
|
|
'no-extend-native': 'error',
|
|
'no-extra-bind': 'error',
|
|
'no-floating-decimal': 'error',
|
|
'no-implied-eval': 'error',
|
|
'no-iterator': 'error',
|
|
'no-labels': 'error',
|
|
'no-lone-blocks': 'error',
|
|
'no-loop-func': 'error',
|
|
'no-multi-str': 'warn',
|
|
'no-global-assign': 'error',
|
|
'no-new': 'error',
|
|
'no-new-func': 'error',
|
|
'no-new-wrappers': 'error',
|
|
'no-octal-escape': 'error',
|
|
'no-process-env': 'error',
|
|
'no-proto': 'error',
|
|
'no-return-assign': 'error',
|
|
'no-script-url': 'error',
|
|
'no-self-compare': 'error',
|
|
'no-sequences': 'error',
|
|
'no-throw-literal': 'error',
|
|
'no-unused-expressions': 'error',
|
|
'no-warning-comments': 'warn',
|
|
'no-with': 'error',
|
|
radix: 'error',
|
|
|
|
// Variables //
|
|
//-----------//
|
|
'no-label-var': 'error',
|
|
'no-undef-init': 'error',
|
|
'no-use-before-define': ['error', 'nofunc'],
|
|
|
|
// ECMAScript 6 //
|
|
//--------------//
|
|
'no-var': 'error'
|
|
},
|
|
parserOptions: {
|
|
sourceType: 'module',
|
|
ecmaVersion: 6,
|
|
ecmaFeatures: {}
|
|
}
|
|
};
|