Skip to content

Commit fbdd7c3

Browse files
committed
upgrade eslint and react-native
1 parent 7084f1d commit fbdd7c3

File tree

3 files changed

+1547
-205
lines changed

3 files changed

+1547
-205
lines changed

eslint.config.mjs

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,59 @@
11
import { defineConfig, globalIgnores } from 'eslint/config';
2+
import { fixupPluginRules } from '@eslint/compat';
23
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';
56
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';
711

812
export default defineConfig([
913
{
14+
settings: {
15+
react: {
16+
version: 'detect',
17+
},
18+
},
1019
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+
},
1342
},
1443
{
1544
files: ['**/*.{mjs}'],
16-
plugins: { js },
17-
extends: ['js/recommended'],
45+
plugins: { jsEslint },
46+
extends: [jsEslint.configs.recommended],
1847
},
1948
{
2049
files: ['**/*.md'],
2150
plugins: { markdown },
2251
processor: 'markdown/markdown',
2352
},
2453
{
25-
files: ['**/*.yml'],
26-
plugins: { yml },
27-
extends: [yml.configs['flat/recommended']],
54+
files: ['**/*.ymlEslint'],
55+
plugins: { ymlEslint },
56+
extends: [ymlEslint.configs['flat/recommended']],
2857
},
2958
{
3059
files: ['**/*.json'],

package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,32 @@
2929
"author": "Brian Sinnicke",
3030
"license": "MIT",
3131
"devDependencies": {
32+
"@eslint/compat": "^1.4.0",
3233
"@eslint/js": "9.35.0",
3334
"@eslint/json": "0.13.2",
3435
"@eslint/markdown": "7.2.0",
35-
"@react-native/babel-preset": "0.81.1",
36-
"@react-native/eslint-config": "0.81.1",
37-
"@react-native/metro-config": "0.81.1",
38-
"@react-native/typescript-config": "0.81.1",
36+
"@react-native/babel-preset": "0.81.4",
37+
"@react-native/eslint-config": "0.81.4",
38+
"@react-native/metro-config": "0.81.4",
39+
"@react-native/typescript-config": "0.81.4",
3940
"@testing-library/react-native": "13.3.3",
4041
"@types/jest": "30.0.0",
4142
"@types/react": "19.1.0",
4243
"@types/react-test-renderer": "19.1.0",
4344
"babel-jest": "30.1.2",
44-
"eslint": "9.35.0",
45+
"eslint": "9.38.0",
46+
"eslint-plugin-react": "7.37.5",
47+
"eslint-plugin-react-hooks": "7.0.0",
48+
"eslint-plugin-react-native": "^5.0.0",
4549
"eslint-plugin-yml": "1.18.0",
4650
"jest": "30.1.3",
4751
"prettier": "3.6.2",
4852
"react": "19.1.0",
49-
"react-native": "0.81.1",
53+
"react-native": "0.81.4",
5054
"react-test-renderer": "19.1.0",
5155
"ts-jest": "29.4.1",
5256
"typescript": "5.8.3",
53-
"typescript-eslint": "8.42.0"
57+
"typescript-eslint": "8.46.2"
5458
},
5559
"engines": {
5660
"node": ">=20"

0 commit comments

Comments
 (0)