Skip to content

Commit 35c9afc

Browse files
authored
dependency updates and type fixes (#21)
1 parent f6b7eb1 commit 35c9afc

File tree

15 files changed

+2465
-2122
lines changed

15 files changed

+2465
-2122
lines changed

.eslintrc.js

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

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.17.1
1+
22.14.0

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ $ npm install eslint eslint-plugin-react-prefer-function-component --save-dev
6767
```js
6868
import eslint from "@eslint/js";
6969
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
70-
import preferFC from "eslint-plugin-react-prefer-function-component/config";
70+
import preferFunctionComponent from "eslint-plugin-react-prefer-function-component/config";
7171

7272
export default [
7373
{ files: ["**/*.{js,jsx}"] },
7474
eslint.configs.recommended,
7575
reactRecommended,
76-
preferFC.configs.recommended,
76+
preferFunctionComponent.configs.recommended,
7777
];
7878
```
7979

babel.config.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// eslint-disable-next-line no-undef
21
module.exports = {
32
presets: [
43
["@babel/preset-env", { targets: { node: "current" } }],

eslint.config.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import js from "@eslint/js";
2+
import eslintConfigPrettier from "eslint-config-prettier";
3+
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
4+
import tsParser from "@typescript-eslint/parser";
5+
6+
export default [
7+
{
8+
ignores: ["**/dist", "examples", "packages/e2e", "coverage"],
9+
},
10+
js.configs.recommended,
11+
{
12+
plugins: {
13+
"@typescript-eslint": typescriptPlugin,
14+
},
15+
languageOptions: {
16+
parser: tsParser,
17+
},
18+
rules: {
19+
...typescriptPlugin.configs.recommended.rules,
20+
},
21+
},
22+
{
23+
files: ["*.ts"],
24+
parser: "@typescript-eslint/parser",
25+
parserOptions: {
26+
// eslint-disable-next-line no-undef
27+
tsconfigRootDir: process.cwd(),
28+
project: [
29+
"./tsconfig.json",
30+
"./packages/*/tsconfig.json",
31+
"./examples/*/tsconfig.json",
32+
],
33+
},
34+
rules: {
35+
...typescriptPlugin.configs["recommended-requiring-type-checking"].rules,
36+
"@typescript-eslint/prefer-nullish-coalescing": "error",
37+
"@typescript-eslint/no-unnecessary-condition": "error",
38+
"@typescript-eslint/prefer-optional-chain": "error",
39+
},
40+
},
41+
eslintConfigPrettier,
42+
];

examples/custom-config/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"license": "ISC",
1010
"main": "index.js",
1111
"devDependencies": {
12-
"eslint": "^8.48.0",
13-
"eslint-plugin-react": "^7.33.2",
12+
"eslint": "^9.22.0",
13+
"eslint-plugin-react": "^7.37.4",
1414
"eslint-plugin-react-prefer-function-component": "workspace:*"
1515
}
1616
}

examples/flat-config/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"license": "ISC",
1111
"main": "index.js",
1212
"devDependencies": {
13-
"eslint": "^8.48.0",
14-
"eslint-plugin-react": "^7.33.2",
13+
"eslint": "^9.22.0",
14+
"eslint-plugin-react": "^7.37.4",
1515
"eslint-plugin-react-prefer-function-component": "workspace:*"
1616
}
1717
}

examples/recommended-config/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"license": "ISC",
1010
"main": "index.js",
1111
"devDependencies": {
12-
"eslint": "^8.48.0",
13-
"eslint-plugin-react": "^7.33.2",
12+
"eslint": "^9.22.0",
13+
"eslint-plugin-react": "^7.37.4",
1414
"eslint-plugin-react-prefer-function-component": "workspace:*"
1515
}
1616
}

jest.config.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// eslint-disable-next-line no-undef
21
module.exports = {
32
clearMocks: true,
43
coverageDirectory: "coverage",

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@
2424
"typecheck": "pnpm run --recursive typecheck"
2525
},
2626
"devDependencies": {
27-
"@babel/preset-env": "^7.22.10",
28-
"@babel/preset-react": "^7.22.5",
29-
"@babel/preset-typescript": "^7.22.11",
30-
"@types/eslint": "^8.44.2",
31-
"@types/estree": "^1.0.1",
32-
"@types/jest": "^29.5.4",
33-
"@types/node": "^20.5.7",
34-
"@typescript-eslint/eslint-plugin": "^6.5.0",
35-
"@typescript-eslint/parser": "^6.5.0",
27+
"@babel/preset-env": "^7.26.9",
28+
"@babel/preset-react": "^7.26.3",
29+
"@babel/preset-typescript": "^7.26.0",
30+
"@types/eslint": "^9.6.1",
31+
"@types/estree": "^1.0.6",
32+
"@types/jest": "^29.5.14",
33+
"@types/node": "^22.13.10",
34+
"@typescript-eslint/eslint-plugin": "^8.26.1",
35+
"@typescript-eslint/parser": "^8.26.1",
3636
"codecov": "^3.8.3",
37-
"eslint": "^8.48.0",
38-
"eslint-config-prettier": "^9.0.0",
39-
"eslint-plugin-react": "^7.33.2",
40-
"eslint-plugin-react-hooks": "^4.6.0",
41-
"husky": "^8.0.3",
42-
"jest": "^29.6.4",
43-
"prettier": "^3.0.3",
37+
"eslint": "^9.22.0",
38+
"eslint-config-prettier": "^10.1.1",
39+
"eslint-plugin-react": "^7.37.4",
40+
"eslint-plugin-react-hooks": "^5.2.0",
41+
"husky": "^9.1.7",
42+
"jest": "^29.7.0",
43+
"prettier": "^3.5.3",
4444
"prettier-package-json": "^2.8.0",
45-
"typescript": "^5.2.2"
45+
"typescript": "^5.8.2"
4646
},
4747
"packageManager": "pnpm@8.6.9"
4848
}

0 commit comments

Comments
 (0)