|
| 1 | +import { FlatCompat } from '@eslint/eslintrc'; |
| 2 | +import f1BaseConfig from '@forumone/eslint-config-es5'; |
| 3 | +import f1ReactConfig from '@forumone/eslint-config-react'; |
| 4 | +import { defineConfig, globalIgnores } from 'eslint/config'; |
| 5 | + |
| 6 | +const compat = new FlatCompat({ |
| 7 | + // import.meta.dirname is available after Node.js v20.11.0 |
| 8 | + baseDirectory: import.meta.dirname, |
| 9 | +}); |
| 10 | + |
| 11 | +const config = defineConfig([ |
| 12 | + globalIgnores(['**/Icon/icons/*.tsx']), |
| 13 | + compat.config({ |
| 14 | + extends: ['plugin:@next/next/recommended'], |
| 15 | + }), |
| 16 | + f1BaseConfig, |
| 17 | + { |
| 18 | + files: ['*.tsx', '*.jsx'], |
| 19 | + extends: [f1ReactConfig], |
| 20 | + }, |
| 21 | + { |
| 22 | + files: ['**/*.stories.tsx', '**/*Args.tsx'], |
| 23 | + rules: { |
| 24 | + '@next/next/no-img-element': 'off', |
| 25 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 26 | + '@typescript-eslint/no-unsafe-argument': 'off', |
| 27 | + '@typescript-eslint/no-unsafe-call': 'off', |
| 28 | + '@typescript-eslint/no-unsafe-member-access': 'off', |
| 29 | + }, |
| 30 | + }, |
| 31 | + { |
| 32 | + files: ['next.config.js', '.storybook/**/*.js'], |
| 33 | + rules: { |
| 34 | + '@typescript-eslint/no-var-requires': 'off', |
| 35 | + }, |
| 36 | + }, |
| 37 | + { |
| 38 | + files: [ |
| 39 | + 'lib/drupal/generate-graphql-types.ts', |
| 40 | + 'util/drupal/prepMenuItems.ts', |
| 41 | + ], |
| 42 | + rules: { |
| 43 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 44 | + }, |
| 45 | + }, |
| 46 | +]); |
| 47 | + |
| 48 | +export default config; |
0 commit comments