|
| 1 | +module.exports = { |
| 2 | + extends: ["airbnb/base", "prettier"], |
| 3 | + parser: "babel-eslint", |
| 4 | + ignorePatterns: ["/dist/**"], |
| 5 | + rules: { |
| 6 | + "prettier/prettier": "error", |
| 7 | + "arrow-body-style": ["error", "as-needed"], |
| 8 | + complexity: ["error", 10], |
| 9 | + curly: "error", |
| 10 | + "default-case": "off", |
| 11 | + eqeqeq: ["error", "always"], |
| 12 | + "func-style": ["error", "expression"], |
| 13 | + "func-names": ["error"], |
| 14 | + "generator-star-spacing": ["error", { before: false, after: true }], |
| 15 | + "jsx-quotes": ["error", "prefer-double"], |
| 16 | + "max-depth": ["error", 10], |
| 17 | + "newline-before-return": "error", |
| 18 | + "no-alert": "error", |
| 19 | + "no-confusing-arrow": ["error", { allowParens: false }], |
| 20 | + "no-constant-condition": "error", |
| 21 | + "no-console": "off", |
| 22 | + "no-empty-function": "error", |
| 23 | + "no-eq-null": "error", |
| 24 | + "no-implicit-coercion": [ |
| 25 | + "error", |
| 26 | + { boolean: false, number: true, string: true, allow: [] }, |
| 27 | + ], |
| 28 | + "no-invalid-this": "error", |
| 29 | + "no-magic-numbers": [ |
| 30 | + "error", |
| 31 | + { |
| 32 | + ignore: [-1, 0, 1], |
| 33 | + ignoreArrayIndexes: true, |
| 34 | + ignoreDefaultValues: true, |
| 35 | + enforceConst: false, |
| 36 | + detectObjects: false, |
| 37 | + }, |
| 38 | + ], |
| 39 | + "no-process-env": "error", |
| 40 | + "no-process-exit": "error", |
| 41 | + "no-restricted-imports": ["error", "lodash"], |
| 42 | + "no-sync": "error", |
| 43 | + "no-undefined": "error", |
| 44 | + "no-underscore-dangle": ["error", { allow: ["__INIT_MATERIAL_UI__"] }], |
| 45 | + "no-unmodified-loop-condition": "error", |
| 46 | + "no-useless-call": "error", |
| 47 | + "no-warning-comments": [ |
| 48 | + "warn", |
| 49 | + { |
| 50 | + terms: ["todo", "fixme"], |
| 51 | + location: "anywhere", |
| 52 | + }, |
| 53 | + ], |
| 54 | + "require-atomic-updates": "error", |
| 55 | + "require-await": "error", |
| 56 | + "require-unicode-regexp": "error", |
| 57 | + "template-curly-spacing": ["error", "never"], |
| 58 | + "import/default": "error", |
| 59 | + "import/exports-last": "error", |
| 60 | + "import/extensions": [ |
| 61 | + "error", |
| 62 | + "always", |
| 63 | + { |
| 64 | + js: "never", |
| 65 | + jsx: "never", |
| 66 | + ts: "never", |
| 67 | + tsx: "never", |
| 68 | + json: "never", |
| 69 | + }, |
| 70 | + ], |
| 71 | + "import/max-dependencies": ["error", { max: 20 }], |
| 72 | + "import/no-unassigned-import": "error", |
| 73 | + "import/no-unused-modules": [ |
| 74 | + "error", |
| 75 | + { missingExports: true, unusedExports: true }, |
| 76 | + ], |
| 77 | + "import/order": [ |
| 78 | + "error", |
| 79 | + { |
| 80 | + groups: [ |
| 81 | + "builtin", |
| 82 | + "external", |
| 83 | + "internal", |
| 84 | + "parent", |
| 85 | + "sibling", |
| 86 | + "index", |
| 87 | + ], |
| 88 | + "newlines-between": "never", |
| 89 | + }, |
| 90 | + ], |
| 91 | + "filenames/match-exported": ["error", "kebab"], |
| 92 | + "filenames/match-regex": ["error", "(^[a-z-]*[a-z]+$)|(.config$)"], |
| 93 | + }, |
| 94 | + overrides: [ |
| 95 | + { |
| 96 | + files: [ |
| 97 | + "jest.config.js", |
| 98 | + "jest.setup.js", |
| 99 | + "rollup.config.js", |
| 100 | + ".eslintrc.js", |
| 101 | + ], |
| 102 | + rules: { |
| 103 | + "filenames/match-exported": "off", |
| 104 | + "filenames/match-regex": "off", |
| 105 | + "import/no-unused-modules": "off", |
| 106 | + "no-magic-numbers": "off", |
| 107 | + }, |
| 108 | + }, |
| 109 | + { |
| 110 | + files: ["*.test.js", "*.test.jsx"], |
| 111 | + rules: { |
| 112 | + "filenames/match-regex": "off", |
| 113 | + "import/no-unused-modules": "off", |
| 114 | + "no-process-env": "off", |
| 115 | + "no-undefined": "off", |
| 116 | + "no-magic-numbers": "off", |
| 117 | + }, |
| 118 | + }, |
| 119 | + { |
| 120 | + files: ["src/cli.js", "src/index.js"], |
| 121 | + rules: { |
| 122 | + "import/no-unused-modules": "off", |
| 123 | + }, |
| 124 | + }, |
| 125 | + { |
| 126 | + files: ["__mocks__/**/*"], |
| 127 | + rules: { |
| 128 | + "filenames/match-exported": "off", |
| 129 | + "filenames/match-regex": "off", |
| 130 | + "import/no-unused-modules": "off", |
| 131 | + }, |
| 132 | + }, |
| 133 | + ], |
| 134 | + plugins: ["prettier", "import", "filenames"], |
| 135 | + env: { |
| 136 | + node: true, |
| 137 | + jest: true, |
| 138 | + }, |
| 139 | +}; |
0 commit comments