|
1 |
| -import love from 'eslint-config-love' |
| 1 | +import neostandard, { resolveIgnoresFromGitignore } from 'neostandard' |
| 2 | +import eslint from '@eslint/js' |
| 3 | +import tseslint from 'typescript-eslint' |
2 | 4 |
|
3 | 5 | export default [
|
4 |
| - { |
| 6 | + ...neostandard({ |
5 | 7 | ignores: [
|
6 |
| - 'node_modules/', |
7 |
| - 'dist/', |
8 |
| - '.vscode/', |
9 |
| - 'src/generated/' |
10 |
| - ] |
| 8 | + ...resolveIgnoresFromGitignore(), |
| 9 | + ], |
| 10 | + ts: true, |
| 11 | + }), |
| 12 | + eslint.configs.recommended, |
| 13 | + ...tseslint.configs.strictTypeChecked, |
| 14 | + ...tseslint.configs.stylisticTypeChecked, |
| 15 | + { |
| 16 | + languageOptions: { |
| 17 | + parserOptions: { |
| 18 | + projectService: { |
| 19 | + allowDefaultProject: ['*.mjs'], |
| 20 | + }, |
| 21 | + tsconfigRootDir: process.cwd(), |
| 22 | + }, |
| 23 | + }, |
11 | 24 | },
|
12 | 25 | {
|
13 |
| - ...love, |
14 |
| - files: ["**/*.js", "**/*.ts", "**/*.mjs"] |
| 26 | + name: 'migrate/eslint-config-standard-with-typescript', |
| 27 | + rules: { |
| 28 | + '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], |
| 29 | + '@typescript-eslint/consistent-type-exports': [ |
| 30 | + 'error', |
| 31 | + { |
| 32 | + fixMixedExportsWithInlineTypeSpecifier: true, |
| 33 | + }, |
| 34 | + ], |
| 35 | + '@typescript-eslint/consistent-type-imports': 'error', |
| 36 | + '@stylistic/member-delimiter-style': [ |
| 37 | + 'error', |
| 38 | + { |
| 39 | + multiline: { delimiter: 'none' }, |
| 40 | + singleline: { delimiter: 'comma', requireLast: false }, |
| 41 | + }, |
| 42 | + ], |
| 43 | + '@typescript-eslint/method-signature-style': 'error', |
| 44 | + '@typescript-eslint/no-explicit-any': 'off', |
| 45 | + '@typescript-eslint/no-unnecessary-condition': 'off', |
| 46 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 47 | + '@typescript-eslint/no-unsafe-call': 'off', |
| 48 | + '@typescript-eslint/no-unsafe-member-access': 'off', |
| 49 | + '@typescript-eslint/no-unsafe-return': 'off', |
| 50 | + '@typescript-eslint/promise-function-async': 'error', |
| 51 | + '@typescript-eslint/require-array-sort-compare': 'error', |
| 52 | + '@typescript-eslint/require-await': 'off', |
| 53 | + '@typescript-eslint/return-await': ['error', 'always'], |
| 54 | + '@typescript-eslint/triple-slash-reference': ['error', { lib: 'never', path: 'never', types: 'never' }], |
| 55 | + '@stylistic/type-annotation-spacing': 'error', |
| 56 | + '@typescript-eslint/use-unknown-in-catch-callback-variable': 'off', |
| 57 | + }, |
15 | 58 | },
|
16 | 59 | {
|
| 60 | + name: 'RopeScore/custom', |
17 | 61 | rules: {
|
18 |
| - '@typescript-eslint/explicit-function-return-type': 'off', |
19 |
| - '@typescript-eslint/strict-boolean-expressions': 'off', |
20 |
| - '@typescript-eslint/restrict-template-expressions': 'off', |
21 |
| - '@typescript-eslint/return-await': 'off', |
22 |
| - '@typescript-eslint/no-floating-promises': 'off', |
| 62 | + '@typescript-eslint/restrict-template-expressions': ['warn', { |
| 63 | + allowNumber: true, |
| 64 | + allowBoolean: true, |
| 65 | + allowRegExp: true, |
| 66 | + allowAny: true, |
| 67 | + }], |
| 68 | + '@typescript-eslint/no-this-alias': 'off', |
| 69 | + '@typescript-eslint/only-throw-error': ['error', { |
| 70 | + allowThrowingUnknown: true, |
| 71 | + }], |
| 72 | + '@stylistic/comma-dangle': ['warn', { |
| 73 | + arrays: 'always-multiline', |
| 74 | + objects: 'always-multiline', |
| 75 | + imports: 'always-multiline', |
| 76 | + exports: 'always-multiline', |
| 77 | + enums: 'always-multiline', |
| 78 | + functions: 'never', |
| 79 | + }], |
23 | 80 | '@typescript-eslint/no-non-null-assertion': 'off',
|
24 |
| - '@typescript-eslint/promise-function-async': 'off', |
25 |
| - '@typescript-eslint/only-throw-error': 'off', |
26 |
| - '@typescript-eslint/non-nullable-type-assertion-style': 'off' |
27 |
| - } |
28 |
| - } |
| 81 | + 'no-void': 'off', |
| 82 | + 'no-console': 'warn', |
| 83 | + }, |
| 84 | + }, |
| 85 | + { |
| 86 | + name: 'RopeScore/tests', |
| 87 | + files: ['**/*.test.ts', '**/*.test.js'], |
| 88 | + rules: { |
| 89 | + '@typescript-eslint/ban-ts-comment': ['error', { |
| 90 | + 'ts-expect-error': false, |
| 91 | + 'ts-ignore': true, |
| 92 | + 'ts-nocheck': true, |
| 93 | + 'ts-check': false, |
| 94 | + minimumDescriptionLength: 3, |
| 95 | + }], |
| 96 | + }, |
| 97 | + }, |
| 98 | + { |
| 99 | + name: 'RopeScore/allow-console', |
| 100 | + files: ['migrations/*.ts', 'migrations/*.js'], |
| 101 | + rules: { |
| 102 | + 'no-console': 'off', |
| 103 | + }, |
| 104 | + }, |
29 | 105 | ]
|
0 commit comments