|
1 |
| -import configPrisma from 'eslint-config-prisma' |
| 1 | +import eslint from '@eslint/js' |
| 2 | +import stylistic from '@stylistic/eslint-plugin' |
| 3 | +import onlyWarn from 'eslint-plugin-only-warn' |
| 4 | +import tsdoc from 'eslint-plugin-tsdoc' |
2 | 5 | import tsEslint from 'typescript-eslint'
|
3 | 6 |
|
4 |
| -export default tsEslint.config({ |
5 |
| - extends: [...configPrisma], |
6 |
| - ignores: ['**/build/**/*', 'eslint.config.js'], |
7 |
| - languageOptions: { |
8 |
| - parserOptions: { |
9 |
| - project: true, |
10 |
| - tsconfigRootDir: import.meta.dirname, |
| 7 | +export default tsEslint.config( |
| 8 | + eslint.configs.recommended, |
| 9 | + stylistic.configs.recommended, |
| 10 | + tsEslint.configs.recommendedTypeChecked, |
| 11 | + tsEslint.configs.strictTypeChecked, |
| 12 | + tsEslint.configs.eslintRecommended, |
| 13 | + tsEslint.configs.stylisticTypeChecked, |
| 14 | + { |
| 15 | + ignores: ['build', 'eslint.config.js'], |
| 16 | + }, |
| 17 | + { |
| 18 | + languageOptions: { |
| 19 | + parserOptions: { |
| 20 | + projectService: true, |
| 21 | + tsconfigRootDir: import.meta.dirname, |
| 22 | + }, |
| 23 | + }, |
| 24 | + plugins: { |
| 25 | + // https://github.com/microsoft/tsdoc/tree/master/eslint-plugin |
| 26 | + tsdoc: tsdoc, |
| 27 | + // This makes it so the IDE reports lint rejections as warnings only. This is |
| 28 | + // better than errors because most lint rejections are not runtime errors. This |
| 29 | + // allows IDE errors to be exclusive for e.g. static type errors which often are |
| 30 | + // reflective of real runtime errors. |
| 31 | + // https://github.com/bfanger/eslint-plugin-only-warn |
| 32 | + onlyWarn, |
| 33 | + '@stylistic': stylistic, |
| 34 | + }, |
| 35 | + rules: { |
| 36 | + '@stylistic/quotes': ['warn', 'backtick'], |
| 37 | + '@typescript-eslint/consistent-type-imports': 'warn', |
| 38 | + 'tsdoc/syntax': 'warn', |
| 39 | + // TypeScript makes these safe & effective |
| 40 | + 'no-case-declarations': 'off', |
| 41 | + // Same approach used by TypeScript noUnusedLocals |
| 42 | + '@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }], |
| 43 | + // Needed when working with .mts/.cts where a lone e.g. <T> is not allowed |
| 44 | + '@typescript-eslint/no-unnecessary-type-constraint': 'off', |
| 45 | + // Useful for organizing Types |
| 46 | + '@typescript-eslint/no-namespace': 'off', |
| 47 | + // Turn training wheels off. When we want these we want these. |
| 48 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 49 | + '@typescript-eslint/no-unsafe-argument': 'off', |
| 50 | + '@typescript-eslint/no-unsafe-return': 'off', |
| 51 | + '@typescript-eslint/no-explicit-any': 'off', |
| 52 | + '@typescript-eslint/ban-ts-comment': ['warn', { 'ts-expect-error': false }], |
11 | 53 | },
|
12 | 54 | },
|
13 |
| -}) |
| 55 | +) |
0 commit comments