|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + es2024: true, |
| 5 | + }, |
| 6 | + extends: [ |
| 7 | + 'standard', |
| 8 | + 'plugin:react/recommended', |
| 9 | + 'airbnb', |
| 10 | + 'plugin:prettier/recommended', |
| 11 | + 'plugin:cypress/recommended', |
| 12 | + ], |
| 13 | + parserOptions: { |
| 14 | + ecmaFeatures: { |
| 15 | + jsx: true, |
| 16 | + }, |
| 17 | + ecmaVersion: 'latest', |
| 18 | + sourceType: 'module', |
| 19 | + }, |
| 20 | + plugins: ['jsx-a11y', 'import', 'react', 'prettier'], |
| 21 | + rules: { |
| 22 | + 'function-paren-newline': ['error', 'consistent'], |
| 23 | + 'comma-dangle': [ |
| 24 | + 'error', |
| 25 | + { |
| 26 | + arrays: 'always-multiline', |
| 27 | + objects: 'always-multiline', |
| 28 | + imports: 'always-multiline', |
| 29 | + exports: 'always-multiline', |
| 30 | + functions: 'always-multiline', |
| 31 | + }, |
| 32 | + ], |
| 33 | + indent: [ |
| 34 | + 'error', |
| 35 | + 2, |
| 36 | + { |
| 37 | + SwitchCase: 1, |
| 38 | + VariableDeclarator: 1, |
| 39 | + outerIIFEBody: 1, |
| 40 | + // MemberExpression: null, |
| 41 | + FunctionDeclaration: { |
| 42 | + parameters: 1, |
| 43 | + body: 1, |
| 44 | + }, |
| 45 | + FunctionExpression: { |
| 46 | + parameters: 1, |
| 47 | + body: 1, |
| 48 | + }, |
| 49 | + CallExpression: { |
| 50 | + arguments: 1, |
| 51 | + }, |
| 52 | + ArrayExpression: 1, |
| 53 | + ObjectExpression: 1, |
| 54 | + ImportDeclaration: 1, |
| 55 | + flatTernaryExpressions: false, |
| 56 | + // list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js |
| 57 | + ignoredNodes: [ |
| 58 | + 'JSXElement', |
| 59 | + 'JSXElement > *', |
| 60 | + 'JSXAttribute', |
| 61 | + 'JSXIdentifier', |
| 62 | + 'JSXNamespacedName', |
| 63 | + 'JSXMemberExpression', |
| 64 | + 'JSXSpreadAttribute', |
| 65 | + 'JSXExpressionContainer', |
| 66 | + 'JSXOpeningElement', |
| 67 | + 'JSXClosingElement', |
| 68 | + 'JSXFragment', |
| 69 | + 'JSXOpeningFragment', |
| 70 | + 'JSXClosingFragment', |
| 71 | + 'JSXText', |
| 72 | + 'JSXEmptyExpression', |
| 73 | + 'JSXSpreadChild', |
| 74 | + ], |
| 75 | + ignoreComments: false, |
| 76 | + }, |
| 77 | + ], |
| 78 | + 'no-unused-expressions': [ |
| 79 | + 'error', |
| 80 | + { |
| 81 | + allowShortCircuit: false, |
| 82 | + allowTernary: false, |
| 83 | + allowTaggedTemplates: false, |
| 84 | + }, |
| 85 | + ], |
| 86 | + 'jsx-a11y/label-has-for': [ |
| 87 | + 2, |
| 88 | + { |
| 89 | + components: ['Label'], |
| 90 | + required: { |
| 91 | + some: ['id', 'nesting'], |
| 92 | + }, |
| 93 | + allowChildren: true, |
| 94 | + }, |
| 95 | + ], |
| 96 | + 'jsx-a11y/label-has-associated-control': [2, { assert: 'either' }], |
| 97 | + 'jsx-a11y/control-has-associated-label': 'off', |
| 98 | + 'implicit-arrow-linebreak': 0, |
| 99 | + 'import/prefer-default-export': 0, |
| 100 | + 'import/no-extraneous-dependencies': [ |
| 101 | + 'error', |
| 102 | + { |
| 103 | + devDependencies: true, |
| 104 | + optionalDependencies: false, |
| 105 | + peerDependencies: false, |
| 106 | + }, |
| 107 | + ], |
| 108 | + 'max-len': [ |
| 109 | + 'error', |
| 110 | + { |
| 111 | + ignoreTemplateLiterals: true, |
| 112 | + ignoreComments: true, |
| 113 | + }, |
| 114 | + ], |
| 115 | + 'no-console': 'error', |
| 116 | + 'no-param-reassign': [2, { props: true }], |
| 117 | + 'no-shadow': ['error', { builtinGlobals: false }], |
| 118 | + 'padding-line-between-statements': [ |
| 119 | + 'error', |
| 120 | + { blankLine: 'always', prev: '*', next: 'return' }, |
| 121 | + { blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' }, |
| 122 | + { |
| 123 | + blankLine: 'any', |
| 124 | + prev: ['const', 'let', 'var'], |
| 125 | + next: ['const', 'let', 'var'], |
| 126 | + }, |
| 127 | + { blankLine: 'always', prev: 'directive', next: '*' }, |
| 128 | + { blankLine: 'always', prev: 'block-like', next: '*' }, |
| 129 | + ], |
| 130 | + 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }], |
| 131 | + 'react/prop-types': 0, |
| 132 | + 'react/react-in-jsx-scope': 0, |
| 133 | + 'react/destructuring-assignment': 0, |
| 134 | + 'react/function-component-definition': 0, |
| 135 | + }, |
| 136 | +}; |
0 commit comments