|
1 | 1 | /* eslint-disable simple-import-sort/imports */ |
2 | 2 | import url from "node:url"; |
3 | 3 |
|
4 | | -import { Record } from "effect"; |
5 | 4 | import eslintJs from "@eslint/js"; |
6 | 5 | import eslintMarkdown from "@eslint/markdown"; |
7 | 6 | import eslintPluginImport from "eslint-plugin-import-x"; |
@@ -70,27 +69,16 @@ const p11tGroups = { |
70 | 69 | groups: ["id", "type", "meta", "alias", "rules", "unknown"], |
71 | 70 | }; |
72 | 71 |
|
73 | | -const disableTypeCheckedRules = { |
74 | | - ...tseslint.configs.disableTypeChecked.rules, |
75 | | - "@susisu/safe-typescript/no-object-assign": "off", |
76 | | - "@susisu/safe-typescript/no-type-assertion": "off", |
77 | | - "@susisu/safe-typescript/no-unsafe-object-enum-method": "off", |
| 72 | +const enableTypeCheckedRules = { |
| 73 | + ...tseslint.configs.strictTypeCheckedOnly.map(x => x.rules).reduce((a, b) => ({ ...a, ...b }), {}), |
| 74 | + ...eslintPluginSafeTypeScript.configs.recommended.rules, |
78 | 75 | "@susisu/safe-typescript/no-unsafe-object-property-check": "off", |
79 | 76 | "@susisu/safe-typescript/no-unsafe-object-property-overwrite": "off", |
80 | | -} as const; |
81 | | - |
82 | | -const typeCheckedRules = { |
83 | | - ...Record.map(disableTypeCheckedRules, () => "warn"), |
84 | | - "@susisu/safe-typescript/no-unsafe-object-property-check": "off", |
85 | | - "@susisu/safe-typescript/no-unsafe-object-property-overwrite": "off", |
86 | | - "@typescript-eslint/naming-convention": "off", |
87 | | - "@typescript-eslint/no-confusing-void-expression": "off", |
88 | | - "@typescript-eslint/prefer-destructuring": "off", |
89 | | - "@typescript-eslint/prefer-readonly-parameter-types": "off", |
90 | 77 | "@typescript-eslint/strict-boolean-expressions": ["warn", { allowNullableBoolean: true, allowNullableString: true }], |
91 | | - "@typescript-eslint/switch-exhaustiveness-check": "off", |
92 | 78 | } as const; |
93 | 79 |
|
| 80 | +const disableTypeCheckedRules = Object.fromEntries(Object.keys(enableTypeCheckedRules).map(x => [x, "off"])); |
| 81 | + |
94 | 82 | export default tseslint.config( |
95 | 83 | eslintConfigFlatGitignore(), |
96 | 84 | { |
@@ -193,9 +181,7 @@ export default tseslint.config( |
193 | 181 | varsIgnorePattern: "^_", |
194 | 182 | }, |
195 | 183 | ], |
196 | | - ...typeCheckedRules, |
197 | | - // Part: functional rules |
198 | | - "functional/no-return-void": "off", |
| 184 | + ...enableTypeCheckedRules, |
199 | 185 | // Part: jsdoc rules |
200 | 186 | "jsdoc/check-param-names": "warn", |
201 | 187 | "jsdoc/check-tag-names": "warn", |
|
0 commit comments