Skip to content

Commit 1219944

Browse files
chore: ESLint 9 (#1728)
1 parent 7f25adf commit 1219944

34 files changed

+1275
-1340
lines changed

.codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ coverage:
33
round: down
44
range: 70...100
55
status:
6+
patch:
7+
default:
8+
target: 80% # Required patch coverage target
69
project:
710
default:
811
threshold: 0.5% # Allowable coverage drop in percentage points

.eslintignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import tseslint from 'typescript-eslint';
2+
import callstackConfig from '@callstack/eslint-config/react-native.flat.js';
3+
4+
export default [
5+
{
6+
ignores: [
7+
'flow-typed/',
8+
'build/',
9+
'experiments-rtl/',
10+
'website/',
11+
'eslint.config.mjs',
12+
'jest-setup.ts',
13+
],
14+
},
15+
...callstackConfig,
16+
...tseslint.configs.strict,
17+
{
18+
rules: {
19+
'no-console': 'error',
20+
},
21+
},
22+
{
23+
files: ['**/*.test.{ts,tsx}', 'src/test-utils/**'],
24+
rules: {
25+
'react/no-multi-comp': 'off',
26+
'react-native/no-color-literals': 'off',
27+
'react-native/no-inline-styles': 'off',
28+
'react-native/no-raw-text': 'off',
29+
'react-native-a11y/has-valid-accessibility-descriptors': 'off',
30+
'react-native-a11y/has-valid-accessibility-ignores-invert-colors': 'off',
31+
'react-native-a11y/has-valid-accessibility-value': 'off',
32+
'@typescript-eslint/no-explicit-any': 'off',
33+
},
34+
},
35+
];

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,24 @@
7373
"@babel/preset-typescript": "^7.26.0",
7474
"@callstack/eslint-config": "^15.0.0",
7575
"@react-native/babel-preset": "0.77.0-rc.0",
76-
"@release-it/conventional-changelog": "^9.0.2",
76+
"@release-it/conventional-changelog": "^10.0.0",
7777
"@relmify/jest-serializer-strip-ansi": "^1.0.2",
7878
"@types/jest": "^29.5.14",
7979
"@types/react": "^18.3.12",
8080
"@types/react-test-renderer": "^18.3.0",
8181
"babel-jest": "^29.7.0",
8282
"babel-plugin-module-resolver": "^5.0.2",
8383
"del-cli": "^6.0.0",
84-
"eslint": "^8.57.1",
85-
"eslint-plugin-prettier": "^4.2.1",
84+
"eslint": "^9.17.0",
8685
"flow-bin": "~0.170.0",
8786
"jest": "^29.7.0",
8887
"prettier": "^2.8.8",
8988
"react": "18.3.1",
9089
"react-native": "0.77.0-rc.0",
9190
"react-test-renderer": "18.3.1",
9291
"release-it": "^18.0.0",
93-
"strip-ansi": "^6.0.1",
94-
"typescript": "^5.6.3"
92+
"typescript": "^5.6.3",
93+
"typescript-eslint": "^8.19.1"
9594
},
9695
"publishConfig": {
9796
"registry": "https://registry.npmjs.org"

src/__tests__/__snapshots__/render-debug.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ exports[`debug with only props from TextInput components 1`] = `
288288
exports[`debug: another custom message 1`] = `
289289
"another custom message
290290
291+
291292
<View>
292293
<Text>
293294
Is the banana fresh?
@@ -370,6 +371,7 @@ exports[`debug: another custom message 1`] = `
370371
exports[`debug: with message 1`] = `
371372
"my custom message
372373
374+
373375
<View>
374376
<Text>
375377
Is the banana fresh?

src/__tests__/auto-cleanup-skip.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { View } from 'react-native';
44
let render: (element: React.ReactElement) => void;
55
beforeAll(() => {
66
process.env.RNTL_SKIP_AUTO_CLEANUP = 'true';
7+
// eslint-disable-next-line @typescript-eslint/no-require-imports
78
const rntl = require('..');
89
render = rntl.render;
910
});

src/__tests__/cleanup.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/no-multi-comp */
21
import * as React from 'react';
32
import { View } from 'react-native';
43
import { cleanup, render } from '../pure';

src/__tests__/questionsBoard.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { render, screen, userEvent } from '..';
44

55
type QuestionsBoardProps = {
66
questions: string[];
7-
onSubmit: (obj: {}) => void;
7+
onSubmit: (obj: object) => void;
88
};
99

1010
jest.useFakeTimers();

0 commit comments

Comments
 (0)