Skip to content

Commit 0b08cf0

Browse files
committed
chore: Upgrade ESLint
1 parent e95ccba commit 0b08cf0

8 files changed

Lines changed: 611 additions & 1734 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import { nighttraxReact } from '@nighttrax/eslint-config-tsx';
22

3+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
34
export default nighttraxReact();

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
},
5050
"devDependencies": {
5151
"@arethetypeswrong/cli": "~0.18.2",
52-
"@nighttrax/eslint-config-tsx": "~12.4.0",
52+
"@nighttrax/eslint-config-tsx": "~13.1.2",
5353
"@testing-library/dom": "~10.4.1",
5454
"@testing-library/react": "~16.3.2",
5555
"@types/lodash": "~4.17.24",
5656
"@types/react": "~19.2.14",
5757
"@types/react-dom": "~19.2.3",
5858
"@vitejs/plugin-react": "~6.0.1",
5959
"@vitest/coverage-v8": "~4.1.0",
60-
"eslint": "~9.39.4",
60+
"eslint": "~10.4.1",
6161
"jsdom": "~29.1.0",
6262
"publint": "~0.3.19",
6363
"prettier": "~3.8.1",

pnpm-lock.yaml

Lines changed: 584 additions & 1729 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
allowBuilds:
22
unrs-resolver: false
33
autoInstallPeers: false
4+
minimumReleaseAgeExclude:
5+
- '@nighttrax/eslint-config-ts@13.1.1'
6+
- '@nighttrax/eslint-config-tsx@13.1.2'
47
strictPeerDependencies: true

src/index.spec.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
55
import createReactMock, { resetAll } from './index.js';
66

77
// @ts-expect-error https://react.dev/reference/react/act#error-the-current-testing-environment-is-not-configured-to-support-act
8+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
89
global.IS_REACT_ACT_ENVIRONMENT = true;
910

1011
describe('createReactMock', () => {
@@ -229,7 +230,7 @@ describe('createReactMock', () => {
229230

230231
beforeEach(() => {
231232
console.error = (...args: unknown[]) => {
232-
if (typeof args[0] === 'string' && /act/.test(args[0])) {
233+
if (typeof args[0] === 'string' && args[0].includes('act')) {
233234
throw new Error(args[0]);
234235
}
235236

@@ -277,7 +278,14 @@ describe('createReactMock', () => {
277278
it('should opt out of wrapping last prop calls in act', async () => {
278279
const Child = createReactMock<ChildProps>({ wrapInAct: false });
279280

280-
render(<Child onSubmit={async () => {}} someState={23} />);
281+
render(
282+
<Child
283+
onSubmit={async () => {
284+
/* empty */
285+
}}
286+
someState={23}
287+
/>,
288+
);
281289

282290
await act(() => Child.renderCalls[0].onSubmit(-1));
283291
});

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export default function createReactMock<Props extends object>({
117117
let renderCalls: Props[] = [];
118118
let mounted = false;
119119

120+
// eslint-disable-next-line @eslint-react/no-class-component
120121
const Stub = class Stub extends Component<Props> {
121122
public static withProps(
122123
expectedProps: DeepPartial<Props>,
@@ -185,6 +186,7 @@ export default function createReactMock<Props extends object>({
185186
return prop;
186187
}
187188

189+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-return
188190
return (...args: unknown[]) => act(() => prop(...args));
189191
}
190192

tsconfig.eslint.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"noEmit": true
5+
},
6+
"include": ["eslint.config.js", ".prettierrc.js"]
7+
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"files": [],
33
"references": [
44
{ "path": "./tsconfig.app.json" },
5-
{ "path": "./tsconfig.test.json" }
5+
{ "path": "./tsconfig.test.json" },
6+
{ "path": "./tsconfig.eslint.json" }
67
]
78
}

0 commit comments

Comments
 (0)