|
| 1 | +/** |
| 2 | + * @type {import("eslint").Linter.Config} |
| 3 | + */ |
| 4 | +module.exports = { |
| 5 | + root: true, |
| 6 | + parser: '@typescript-eslint/parser', |
| 7 | + parserOptions: { |
| 8 | + warnOnUnsupportedTypeScriptVersion: false, |
| 9 | + }, |
| 10 | + extends: [ |
| 11 | + 'eslint:recommended', |
| 12 | + 'plugin:@typescript-eslint/strict', |
| 13 | + 'plugin:@typescript-eslint/stylistic', |
| 14 | + 'plugin:jsx-a11y/recommended', |
| 15 | + 'plugin:react/recommended', |
| 16 | + 'prettier', |
| 17 | + 'plugin:react-hook-form/recommended', |
| 18 | + ], |
| 19 | + plugins: ['@typescript-eslint', 'react-hooks', 'prettier', 'jsx-a11y', 'react-hook-form'], |
| 20 | + settings: { |
| 21 | + react: { |
| 22 | + version: 'detect', |
| 23 | + }, |
| 24 | + }, |
| 25 | + env: { |
| 26 | + node: true, |
| 27 | + }, |
| 28 | + rules: { |
| 29 | + '@typescript-eslint/array-type': 'off', |
| 30 | + '@typescript-eslint/consistent-type-definitions': 'off', |
| 31 | + '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }], |
| 32 | + '@typescript-eslint/no-empty-function': 'off', |
| 33 | + '@typescript-eslint/no-empty-interface': 'off', |
| 34 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 35 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 36 | + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], |
| 37 | + eqeqeq: ['error', 'always', { null: 'ignore' }], |
| 38 | + 'jsx-a11y/label-has-associated-control': [2, { controlComponents: ['button'] }], |
| 39 | + 'no-param-reassign': 'error', |
| 40 | + 'no-restricted-imports': [ |
| 41 | + 'error', |
| 42 | + { |
| 43 | + paths: [ |
| 44 | + '.', // preventing confusion due to auto-imports and barrel files |
| 45 | + ], |
| 46 | + patterns: [ |
| 47 | + // import all CSS except index.css at top level through CSS @import statements |
| 48 | + // to avoid bad ordering situations. See https://github.com/oxidecomputer/console/pull/2035 |
| 49 | + '*.css', |
| 50 | + ], |
| 51 | + }, |
| 52 | + ], |
| 53 | + 'no-return-assign': 'error', |
| 54 | + 'no-unused-vars': 'off', |
| 55 | + 'prefer-arrow-callback': 'off', |
| 56 | + 'prettier/prettier': 'error', |
| 57 | + radix: 'error', |
| 58 | + 'react-hooks/exhaustive-deps': 'error', |
| 59 | + 'react-hooks/rules-of-hooks': 'error', |
| 60 | + 'react/jsx-boolean-value': 'error', |
| 61 | + 'react/display-name': 'off', |
| 62 | + 'react/react-in-jsx-scope': 'off', |
| 63 | + 'react/prop-types': 'off', |
| 64 | + }, |
| 65 | + ignorePatterns: ['dist/'], |
| 66 | + overrides: [ |
| 67 | + { |
| 68 | + files: ['*.js'], |
| 69 | + rules: { |
| 70 | + '@typescript-eslint/no-var-requires': 'off', |
| 71 | + }, |
| 72 | + }, |
| 73 | + { |
| 74 | + files: ['*.e2e.ts'], |
| 75 | + extends: ['plugin:playwright/playwright-test'], |
| 76 | + rules: { |
| 77 | + 'playwright/expect-expect': [ |
| 78 | + 'warn', |
| 79 | + { assertFunctionNames: ['expectVisible', 'expectRowVisible'] }, |
| 80 | + ], |
| 81 | + }, |
| 82 | + }, |
| 83 | + ], |
| 84 | +} |
0 commit comments