|
| 1 | +// @ts-check |
| 2 | +import rsEslint from "@rebeccastevens/eslint-config"; |
| 3 | +import pluginEslint from "eslint-plugin-eslint-plugin"; |
| 4 | + |
| 5 | +export default rsEslint( |
| 6 | + { |
| 7 | + typescript: { |
| 8 | + tsconfig: "tsconfig.eslint.json", |
| 9 | + unsafe: "off", |
| 10 | + }, |
| 11 | + stylistic: true, |
| 12 | + functional: "lite", |
| 13 | + formatters: true, |
| 14 | + jsonc: true, |
| 15 | + markdown: true, |
| 16 | + yaml: true, |
| 17 | + ignores: ["tests-compiled/"], |
| 18 | + }, |
| 19 | + { |
| 20 | + plugins: { |
| 21 | + eslint: pluginEslint, |
| 22 | + }, |
| 23 | + rules: { |
| 24 | + "functional/prefer-immutable-types": "off", |
| 25 | + |
| 26 | + // Some types say they have nonnullable properties, but they don't always. |
| 27 | + "ts/no-unnecessary-condition": "off", |
| 28 | + |
| 29 | + "eslint/fixer-return": "error", |
| 30 | + "eslint/meta-property-ordering": "error", |
| 31 | + "eslint/no-deprecated-context-methods": "error", |
| 32 | + "eslint/no-deprecated-report-api": "error", |
| 33 | + "eslint/no-missing-message-ids": "error", |
| 34 | + "eslint/no-missing-placeholders": "error", |
| 35 | + "eslint/no-property-in-node": "error", |
| 36 | + "eslint/no-unused-message-ids": "error", |
| 37 | + "eslint/no-unused-placeholders": "error", |
| 38 | + "eslint/no-useless-token-range": "error", |
| 39 | + "eslint/prefer-message-ids": "error", |
| 40 | + "eslint/prefer-object-rule": "error", |
| 41 | + "eslint/prefer-placeholders": "error", |
| 42 | + "eslint/prefer-replace-text": "error", |
| 43 | + "eslint/report-message-format": "error", |
| 44 | + "eslint/require-meta-docs-description": "error", |
| 45 | + "eslint/require-meta-docs-url": "error", |
| 46 | + "eslint/require-meta-fixable": "error", |
| 47 | + "eslint/require-meta-has-suggestions": "error", |
| 48 | + "eslint/require-meta-schema": "error", |
| 49 | + "eslint/require-meta-type": "error", |
| 50 | + "eslint/consistent-output": "error", |
| 51 | + "eslint/no-identical-tests": "error", |
| 52 | + "eslint/no-only-tests": "error", |
| 53 | + "eslint/prefer-output-null": "error", |
| 54 | + "eslint/test-case-property-ordering": "error", |
| 55 | + "eslint/test-case-shorthand-strings": "error", |
| 56 | + }, |
| 57 | + }, |
| 58 | + { |
| 59 | + files: ["src/configs/", "src/index.ts"], |
| 60 | + rules: { |
| 61 | + "ts/naming-convention": "off", |
| 62 | + }, |
| 63 | + }, |
| 64 | + { |
| 65 | + files: ["src/utils/type-guards.ts", "src/utils/node-types.ts"], |
| 66 | + rules: { |
| 67 | + "jsdoc/require-jsdoc": "off", |
| 68 | + }, |
| 69 | + }, |
| 70 | + { |
| 71 | + files: ["src/utils/conditional-imports/"], |
| 72 | + rules: { |
| 73 | + "@typescript-eslint/no-var-requires": "off", |
| 74 | + "functional/functional-parameters": "off", |
| 75 | + "functional/no-try-statements": "off", |
| 76 | + "import/no-extraneous-dependencies": [ |
| 77 | + "error", |
| 78 | + { |
| 79 | + peerDependencies: true, |
| 80 | + }, |
| 81 | + ], |
| 82 | + "unicorn/prefer-module": "off", |
| 83 | + }, |
| 84 | + }, |
| 85 | + { |
| 86 | + files: ["tests/"], |
| 87 | + rules: { |
| 88 | + "functional/no-return-void": "off", |
| 89 | + "jsdoc/require-jsdoc": "off", |
| 90 | + }, |
| 91 | + }, |
| 92 | + { |
| 93 | + files: ["cz-adapter/"], |
| 94 | + rules: { |
| 95 | + "no-console": "off", |
| 96 | + |
| 97 | + "import/no-extraneous-dependencies": [ |
| 98 | + "error", |
| 99 | + { |
| 100 | + devDependencies: true, |
| 101 | + peerDependencies: true, |
| 102 | + }, |
| 103 | + ], |
| 104 | + "import/no-useless-path-segments": "off", |
| 105 | + |
| 106 | + "jsdoc/require-jsdoc": "off", |
| 107 | + |
| 108 | + "functional/immutable-data": "off", |
| 109 | + "functional/no-conditional-statements": "off", |
| 110 | + "functional/no-expression-statements": "off", |
| 111 | + "functional/no-loop-statements": "off", |
| 112 | + "functional/no-return-void": "off", |
| 113 | + "functional/no-throw-statements": "off", |
| 114 | + }, |
| 115 | + }, |
| 116 | +); |
0 commit comments