Skip to content

Instantly share code, notes, and snippets.

@necojackarc
Last active December 23, 2020 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save necojackarc/1b6b93d22691f13d5a35656c57b38972 to your computer and use it in GitHub Desktop.
Save necojackarc/1b6b93d22691f13d5a35656c57b38972 to your computer and use it in GitHub Desktop.
My ESLint configuration
module.exports = {
parserOptions: {
ecmaVersion: 2020,
},
env: {
es6: true,
},
root: true,
extends: 'eslint:recommended',
rules: {
'array-bracket-spacing': [ 'error', 'always' ],
'array-callback-return': 'error',
'arrow-parens': 'error',
'arrow-spacing': 'error',
'block-spacing': 'error',
'brace-style': [ 'error', '1tbs', { allowSingleLine: false } ],
'comma-dangle': [ 'error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
} ],
'comma-spacing': 'error',
'comma-style': 'error',
'curly': 'error',
'dot-notation': 'error',
'eol-last': 'error',
'eqeqeq': [ 'error', 'always' ],
'func-call-spacing': 'error',
'id-length': 'error',
'indent': [ 'error', 2, { SwitchCase: 1 } ],
'key-spacing': 'error',
'keyword-spacing': 'error',
'linebreak-style': 'error',
'no-array-constructor': 'error',
'no-else-return': 'error',
'no-eval': 'error',
'no-multi-spaces': 'error',
'no-multiple-empty-lines': [ 'error', { max: 2, maxEOF: 1, maxBOF: 1 } ],
'no-new-object': 'error',
'no-param-reassign': 'error',
'no-plusplus': 'error',
'no-restricted-globals': [ 'error', 'isNaN', 'isFinite' ],
'no-spaced-func': 'error',
'no-trailing-spaces': 'error',
'no-underscore-dangle': [ 'error', { allowAfterThis: true } ],
'no-var': 'error',
'object-curly-spacing': [ 'error', 'always' ],
'operator-linebreak': [ 'error', 'before' ],
'prefer-const': 'error',
'prefer-rest-params': 'error',
'quote-props': [ 'error', 'consistent-as-needed' ],
'quotes': [ 'error', 'single', {
avoidEscape: true,
} ],
'radix': 'error',
'rest-spread-spacing': 'error',
'semi': [ 'error', 'always' ],
'space-before-blocks': 'error',
'space-in-parens': 'error',
'space-infix-ops': 'error',
'spaced-comment': [ 'error', 'always', { block: { balanced: true } } ],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment