|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + extends: [ |
| 4 | + 'kentcdodds', |
| 5 | + 'plugin:jest/recommended', |
| 6 | + 'plugin:jest-formatting/recommended', |
| 7 | + 'prettier', |
| 8 | + ], |
| 9 | + rules: { |
| 10 | + // Base |
| 11 | + 'max-lines-per-function': 'off', |
| 12 | + 'no-restricted-imports': [ |
| 13 | + 'error', |
| 14 | + { |
| 15 | + patterns: [ |
| 16 | + { |
| 17 | + group: ['@typescript-eslint/utils/dist/*'], |
| 18 | + message: 'Import from `@typescript-eslint/utils` instead.', |
| 19 | + }, |
| 20 | + ], |
| 21 | + }, |
| 22 | + ], |
| 23 | + |
| 24 | + // Import |
| 25 | + 'import/order': [ |
| 26 | + 'warn', |
| 27 | + { |
| 28 | + groups: ['builtin', 'external', 'parent', 'sibling', 'index'], |
| 29 | + 'newlines-between': 'always', |
| 30 | + alphabetize: { |
| 31 | + order: 'asc', |
| 32 | + caseInsensitive: false, |
| 33 | + }, |
| 34 | + }, |
| 35 | + ], |
| 36 | + }, |
| 37 | + overrides: [ |
| 38 | + { |
| 39 | + // TypeScript |
| 40 | + files: ['**/*.ts?(x)'], |
| 41 | + parser: '@typescript-eslint/parser', |
| 42 | + parserOptions: { |
| 43 | + tsconfigRootDir: __dirname, |
| 44 | + project: ['./tsconfig.eslint.json'], |
| 45 | + }, |
| 46 | + extends: [ |
| 47 | + 'plugin:@typescript-eslint/recommended', |
| 48 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 49 | + ], |
| 50 | + rules: { |
| 51 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 52 | + '@typescript-eslint/no-unused-vars': [ |
| 53 | + 'warn', |
| 54 | + { argsIgnorePattern: '^_' }, |
| 55 | + ], |
| 56 | + '@typescript-eslint/no-use-before-define': 'off', |
| 57 | + }, |
| 58 | + }, |
| 59 | + ], |
| 60 | +}; |
0 commit comments