@papermana/eslint-config-personal
Version:
Just my personal ESLint config
164 lines (157 loc) • 4.15 kB
JavaScript
module.exports = {
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 6,
},
env: {
browser: true,
commonjs: true,
es6: true,
},
rules: {
// Possible Errors:
'no-cond-assign': [2, 'always'],
'no-console': 1,
'no-constant-condition': 2,
'no-dupe-args': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty': 2,
'no-extra-boolean-cast': 1,
'no-extra-semi': 1,
'no-func-assign': 2,
'no-inner-declarations': 2,
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-obj-calls': 2,
'no-regex-spaces': 2,
'no-sparse-arrays': 1,
'no-template-curly-in-string': 1,
'no-unexpected-multiline': 2,
'no-unreachable': 2,
'no-unsafe-negation': 2,
'use-isnan': 2,
'valid-jsdoc': 1,
'valid-typeof': 2,
// Best Practices:
'accessor-pairs': 2,
'array-callback-return': 2,
'block-scoped-var': 1,
'consistent-return': 2,
'curly': 2,
'default-case': 2,
'dot-location': [2, 'property'],
'dot-notation': 1,
'eqeqeq': 2,
'guard-for-in': 1,
'no-alert': 1,
'no-caller': 2,
'no-case-declarations': 2,
'no-empty-pattern': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-label': 2,
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-global-assign': 2,
'no-implicit-globals': 1,
'no-implied-eval': 2,
'no-invalid-this': 2,
'no-labels': 1,
'no-lone-blocks': 1,
'no-loop-func': 2,
'no-multi-spaces': 1,
'no-new': 2,
'no-octal-escape': 2,
'no-octal': 2,
'no-redeclare': [2, {builtinGlobals: true}],
'no-return-assign': 2,
'no-script-url': 2,
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-throw-literal': 1,
'no-unmodified-loop-condition': 2,
'no-unused-expressions': 2,
'no-unused-labels': 2,
'no-useless-concat': 1,
'no-useless-escape': 1,
'radix': 2,
'wrap-iife': [2, 'inside'],
'yoda': 1,
// Strict Mode
'strict': 2,
// Variables
'no-label-var': 2,
'no-shadow-restricted-names': 2,
'no-shadow': 2,
'no-undef': 2,
'no-unused-vars': 1,
// Node.js and CommonJS
// Stylistic Issues
'array-bracket-spacing': 1,
'block-spacing': 1,
'brace-style': [1, 'stroustrup'],
'camelcase': 2,
'comma-dangle': [1, 'always-multiline'],
'comma-spacing': 1,
'comma-style': 1,
'computed-property-spacing': 1,
'consistent-this': [2, 'that'],
'eol-last': [1, 'unix'],
'func-call-spacing': 1,
'func-names': 1,
'indent': [1, 2],
'jsx-quotes': [1, 'prefer-double'],
'key-spacing': 1,
'keyword-spacing': 1,
'linebreak-style': [1, 'unix'],
'max-statements-per-line': 1,
'new-cap': 2,
'new-parens': 1,
'newline-after-var': 1,
'newline-before-return': 1,
'newline-per-chained-call': 1,
'no-bitwise': 2,
'no-inline-comments': 1,
'no-lonely-if': 1,
'no-mixed-operators': 1,
'no-tabs': 1,
'no-trailing-spaces': 1,
'no-whitespace-before-property': 1,
'object-curly-spacing': 1,
'operator-linebreak': 1,
'quotes': [1, 'single', {allowTemplateLiterals: true}],
'semi-spacing': 1,
'semi': [2, 'always'],
'space-before-blocks': 1,
'space-before-function-paren': [1, 'never'],
'space-in-parens': 1,
'space-infix-ops': 1,
'space-unary-ops': 1,
'spaced-comment': 1,
// ECMAScript 6
'arrow-spacing': 1,
'constructor-super': 2,
'generator-star-spacing': [1, 'after'],
'no-class-assign': 2,
'no-const-assign': 2,
'no-dupe-class-members': 2,
'no-duplicate-imports': 2,
'no-this-before-super': 2,
'no-useless-computed-key': 1,
'no-useless-constructor': 1,
'no-useless-rename': 1,
'no-var': 2,
'object-shorthand': 1,
'prefer-arrow-callback': 1,
'prefer-const': 1,
'prefer-rest-params': 1,
'prefer-spread': 1,
'prefer-template': 1,
'rest-spread-spacing': 1,
'template-curly-spacing': [1, 'never'],
'yield-star-spacing': [1, 'after'],
},
};