|
1 | 1 | import { defineConfig, globalIgnores } from 'eslint/config'; |
| 2 | +import { fixupPluginRules } from '@eslint/compat'; |
2 | 3 | import markdown from '@eslint/markdown'; |
3 | | -import ts from 'typescript-eslint'; |
4 | | -import yml from 'eslint-plugin-yml'; |
| 4 | +import tsEslint from 'typescript-eslint'; |
| 5 | +import ymlEslint from 'eslint-plugin-yml'; |
5 | 6 | import json from '@eslint/json'; |
6 | | -import js from '@eslint/js'; |
| 7 | +import jsEslint from '@eslint/js'; |
| 8 | +import reactHooks from 'eslint-plugin-react-hooks'; |
| 9 | +import reactEslint from 'eslint-plugin-react'; |
| 10 | +import reactNativeEslint from 'eslint-plugin-react-native'; |
7 | 11 |
|
8 | 12 | export default defineConfig([ |
9 | 13 | { |
| 14 | + settings: { |
| 15 | + react: { |
| 16 | + version: 'detect', |
| 17 | + }, |
| 18 | + }, |
10 | 19 | files: ['**/*.{ts,tsx}'], |
11 | | - plugins: { ts }, |
12 | | - extends: [ts.configs.recommended], |
| 20 | + plugins: { |
| 21 | + tsEslint, |
| 22 | + jsEslint, |
| 23 | + reactEslint, |
| 24 | + 'react-hooks': reactHooks, |
| 25 | + 'react-native': fixupPluginRules({ |
| 26 | + rules: reactNativeEslint.rules, |
| 27 | + }), |
| 28 | + }, |
| 29 | + extends: [ |
| 30 | + jsEslint.configs.recommended, |
| 31 | + tsEslint.configs.recommended, |
| 32 | + reactEslint.configs.flat.recommended, |
| 33 | + reactHooks.configs.flat.recommended, |
| 34 | + ], |
| 35 | + rules: { |
| 36 | + ...reactNativeEslint.configs.all.rules, |
| 37 | + '@typescript-eslint/no-require-imports': [ |
| 38 | + 'error', |
| 39 | + { allow: ['/*\\.png$'] }, |
| 40 | + ], |
| 41 | + }, |
13 | 42 | }, |
14 | 43 | { |
15 | 44 | files: ['**/*.{mjs}'], |
16 | | - plugins: { js }, |
17 | | - extends: ['js/recommended'], |
| 45 | + plugins: { jsEslint }, |
| 46 | + extends: [jsEslint.configs.recommended], |
18 | 47 | }, |
19 | 48 | { |
20 | 49 | files: ['**/*.md'], |
21 | 50 | plugins: { markdown }, |
22 | 51 | processor: 'markdown/markdown', |
23 | 52 | }, |
24 | 53 | { |
25 | | - files: ['**/*.yml'], |
26 | | - plugins: { yml }, |
27 | | - extends: [yml.configs['flat/recommended']], |
| 54 | + files: ['**/*.ymlEslint'], |
| 55 | + plugins: { ymlEslint }, |
| 56 | + extends: [ymlEslint.configs['flat/recommended']], |
28 | 57 | }, |
29 | 58 | { |
30 | 59 | files: ['**/*.json'], |
|
0 commit comments