|
| 1 | +import globals from 'globals'; |
| 2 | +import js from '@eslint/js'; |
| 3 | +import tseslint from 'typescript-eslint'; |
| 4 | +import playwright from 'eslint-plugin-playwright'; |
| 5 | + |
| 6 | +export default [ |
| 7 | + { |
| 8 | + ignores: ['dist'], |
| 9 | + }, |
| 10 | + js.configs.recommended, |
| 11 | + ...tseslint.configs.recommended, |
| 12 | + { |
| 13 | + languageOptions: { |
| 14 | + globals: globals.node, |
| 15 | + }, |
| 16 | + }, |
| 17 | + { |
| 18 | + files: ['**/*.ts'], |
| 19 | + rules: { |
| 20 | + 'no-console': 'error', |
| 21 | + |
| 22 | + complexity: ['error', { max: 5 }], |
| 23 | + 'max-depth': ['error', { max: 2 }], |
| 24 | + 'max-nested-callbacks': ['error', { max: 2 }], |
| 25 | + 'max-params': ['error', { max: 3 }], |
| 26 | + 'max-statements': ['error', { max: 12 }, { ignoreTopLevelFunctions: false }], |
| 27 | + 'max-len': ['error', { code: 120, ignoreUrls: true }], |
| 28 | + 'max-lines': ['error', { max: 200, skipComments: true, skipBlankLines: true }], |
| 29 | + semi: ['error', 'always'], |
| 30 | + 'no-multiple-empty-lines': ['error', { max: 1 }], |
| 31 | + 'space-before-function-paren': [ |
| 32 | + 'error', |
| 33 | + { anonymous: 'always', named: 'never', asyncArrow: 'always' }, |
| 34 | + ], |
| 35 | + '@typescript-eslint/triple-slash-reference': 0, |
| 36 | + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], |
| 37 | + 'no-undef': 0, |
| 38 | + 'no-empty-pattern': 0, |
| 39 | + }, |
| 40 | + }, |
| 41 | + { |
| 42 | + files: ['test/**/*.{ts,js}'], |
| 43 | + plugins: { |
| 44 | + playwright, |
| 45 | + }, |
| 46 | + rules: { |
| 47 | + 'max-params': 0, |
| 48 | + 'no-empty-pattern': 0, |
| 49 | + '@typescript-eslint/no-empty-function': 0, |
| 50 | + 'playwright/no-focused-test': 'error', |
| 51 | + }, |
| 52 | + }, |
| 53 | +]; |
0 commit comments