|
| 1 | +/* global module */ |
| 2 | + |
| 3 | +module.exports = { |
| 4 | + root: true, |
| 5 | + parserOptions: { |
| 6 | + ecmaVersion: 7, |
| 7 | + sourceType: 'module', |
| 8 | + ecmaFeatures: { |
| 9 | + experimentalObjectRestSpread: true, |
| 10 | + }, |
| 11 | + }, |
| 12 | + extends: [ |
| 13 | + 'eslint:recommended', |
| 14 | + ], |
| 15 | + env: { |
| 16 | + browser: true, |
| 17 | + es6: true, |
| 18 | + node: true, |
| 19 | + }, |
| 20 | + rules: { |
| 21 | + 'max-len': [2, 150], |
| 22 | + 'array-bracket-spacing': [2, 'never'], // require or disallow spaces inside brackets (off by default) |
| 23 | + 'arrow-parens': [2, 'always'], |
| 24 | + 'block-scoped-var': 2, |
| 25 | + 'comma-dangle': [2, 'always-multiline'], |
| 26 | + 'comma-spacing': [2, { before: false, after: true }], // enforce spacing before and after comma |
| 27 | + 'computed-property-spacing': [2, 'never'], // require or disallow spaces inside parentheses (off by default) |
| 28 | + 'default-case': 2, // require default case in switch statements (off by default) |
| 29 | + 'dot-notation': 2, // encourages use of dot notation whenever possible |
| 30 | + 'eol-last': 2, // enforce newline at the end of file, with no multiple empty lines |
| 31 | + 'eqeqeq': 2, |
| 32 | + 'indent': [2, 2, { SwitchCase: 1 }], |
| 33 | + 'key-spacing': [1, { beforeColon: false, afterColon: true }], // enforces spacing between keys and values in object literal properties |
| 34 | + 'new-cap': [1, { newIsCap: true, capIsNew: false }], // require a capital letter for constructors |
| 35 | + 'no-alert': 2, // disallow the use of alert, confirm, and prompt |
| 36 | + 'no-array-constructor': 2, // disallow use of the Array constructor |
| 37 | + 'no-console': 1, |
| 38 | + 'no-debugger': 2, // disallow use of debugger |
| 39 | + 'no-loop-func': 2, // disallow creation of functions within loops |
| 40 | + 'no-multi-spaces': 2, |
| 41 | + 'no-multiple-empty-lines': [2, { max: 1, maxEOF: 0, maxBOF: 0 }], |
| 42 | + 'no-native-reassign': 2, // disallow reassignments of native objects |
| 43 | + 'no-new': 1, // disallow use of new operator when not part of the assignment or comparison |
| 44 | + 'no-new-func': 2, // disallow use of new operator for Function object |
| 45 | + 'no-redeclare': 2, // disallow declaring the same variable more then once |
| 46 | + 'no-shadow': 2, // disallow declaration of variables already declared in the outer scope |
| 47 | + 'no-trailing-spaces': 2, |
| 48 | + 'no-unreachable': 2, // disallow unreachable statements after a return, throw, continue, or break statement |
| 49 | + 'no-var': 2, |
| 50 | + 'object-curly-spacing': [2, 'always'], // require or disallow spaces inside brackets (off by default) |
| 51 | + 'object-shorthand': [2, 'always', { avoidExplicitReturnArrows: true }], |
| 52 | + 'object-shorthand': [2, 'always'], |
| 53 | + 'one-var': [2, 'never'], // allow just one var statement per function (off by default) |
| 54 | + 'operator-assignment': [2, 'never'], // require assignment operator shorthand where possible or prohibit it entirely (off by default) |
| 55 | + 'prefer-spread': 2, |
| 56 | + 'prefer-template': 2, |
| 57 | + 'quotes': [2, 'single'], // specify whether double or single quotes should be used |
| 58 | + 'semi': [2, 'always'], |
| 59 | + 'semi-spacing': [2, { before: false, after: true }], // enforce spacing before and after semicolons |
| 60 | + 'space-before-function-paren': [2, { anonymous: 'always', named: 'never' }], |
| 61 | + 'space-infix-ops': 2, |
| 62 | + 'spaced-comment': [2, 'always'], |
| 63 | + 'template-curly-spacing': [2, 'always'], |
| 64 | + 'use-isnan': 2, // disallow comparisons with the value NaN |
| 65 | + 'yoda': 2, // require or disallow Yoda conditions |
| 66 | + }, |
| 67 | +}; |
0 commit comments