.eslintrc.js (2354B)
1 module.exports = { 2 env: { 3 browser: true, 4 es2021: true, 5 jest: true, 6 node: true, 7 }, 8 extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:react-hooks/recommended'], 9 parserOptions: { 10 ecmaFeatures: { jsx: true }, 11 sourceType: 'module', 12 }, 13 plugins: ['react'], 14 rules: { 15 indent: ['error', 4, { SwitchCase: 1 }], 16 'require-await': 'error', 17 quotes: ['error', 'single'], 18 'comma-dangle': ['error', 'always-multiline'], 19 'multiline-ternary': ['error', 'always-multiline'], 20 'array-element-newline': ['error', 'consistent'], 21 'no-constant-condition': ['error', { checkLoops: false }], 22 'no-multi-spaces': ['error'], 23 semi: ['error', 'never'], 24 'space-in-parens': ['error', 'never'], 25 'space-unary-ops': [ 26 2, { 27 words: true, 28 nonwords: false, 29 overrides: {}, 30 }], 31 'space-before-function-paren': [ 32 'error', 33 { 34 anonymous: 'always', 35 named: 'never', 36 asyncArrow: 'always', 37 }, 38 ], 39 'react/react-in-jsx-scope': 'off', 40 'function-paren-newline': [ 41 'error', 42 { minItems: 3 }, 43 ], 44 'quote-props': ['error', 'as-needed'], 45 'object-curly-spacing': ['error', 'always', { objectsInObjects: false }], 46 'no-multiple-empty-lines': [ 47 'error', 48 { max: 1 }, 49 ], 50 'react/prop-types': 0, // TODO: Do we want this required? 51 'lines-around-comment': [ 52 'error', 53 { 54 beforeBlockComment: true, 55 allowBlockStart: true, 56 }, 57 ], 58 'object-curly-newline': [ 59 'error', 60 { 61 ObjectExpression: { 62 consistent: true, multiline: true, minProperties: 3, 63 }, 64 ObjectPattern: { consistent: true, multiline: true }, 65 ImportDeclaration: { multiline: true, minProperties: 3 }, 66 ExportDeclaration: { 67 multiline: true, 68 minProperties: 3, 69 }, 70 }, 71 ], 72 }, 73 settings: { react: { version: 'detect' }}, 74 }