Skip to content

Commit 5705945

Browse files
authored
support eslint v9. it is time. (#66)
1 parent 308cdb1 commit 5705945

File tree

14 files changed

+3064
-2231
lines changed

14 files changed

+3064
-2231
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/autofix.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ jobs:
1111
autofix:
1212
runs-on: ubuntu-latest
1313
steps:
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: '24'
1417
- uses: actions/checkout@v4
15-
- run: npm install -g [email protected] # todo: delete if https://github.com/nodejs/corepack/issues/612 is resolved
1618
- run: corepack enable
1719
- run: pnpm install
1820
- run: pnpm run lint --fix

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ jobs:
66
test:
77
runs-on: ubuntu-latest
88
steps:
9+
- uses: actions/setup-node@v4
10+
with:
11+
node-version: '24'
912
- uses: actions/checkout@v4
10-
- run: npm install -g [email protected] # todo: delete if https://github.com/nodejs/corepack/issues/612 is resolved
1113
- run: corepack enable
1214
- run: pnpm install
13-
- run: pnpm run build
14-
- run: pnpm run lint
15+
- run: pnpm build
16+
- run: node -v
17+
- run: pnpm lint
1518
- run: pnpm test

.github/workflows/pkg.pr.new.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v4
10-
- run: npm install -g [email protected] # todo: delete if https://github.com/nodejs/corepack/issues/612 is resolved
1110
- run: corepack enable
1211
- run: pnpm install
1312
- run: pnpm build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The following plugins/libraries are usable and should "just work" without needin
4141
1. eslint-plugin-import
4242
1. eslint-plugin-vitest
4343
1. eslint-plugin-promise
44-
1. @rushstack/eslint-plugin-packlets
44+
1. ~@rushstack/eslint-plugin-packlets~ - packlets plugin not working since eslint v9 🤷
4545
1. eslint-plugin-react
4646
1. eslint-plugin-react-hooks
4747
1. with some shims to work with trpc and react-query better

eslint.config.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
require('tsx/cjs')
1+
import 'tsx/esm'
22

3-
const library = require('./src')
3+
import * as library from './src/index.ts'
44

5-
module.exports = [
6-
...library.recommendedFlatConfigs,
7-
...library.crazyConfigs, // experimental stuff
8-
]
5+
const getDefaultExport = () => {
6+
let exp = [
7+
...library.recommendedFlatConfigs,
8+
...library.crazyConfigs, // experimental stuff
9+
]
910

10-
if (process.env.ALT_CONFIG in library) {
11-
module.exports = library[process.env.ALT_CONFIG]
12-
} else if (process.env.ALT_CONFIG) {
13-
throw new Error(`Unknown config ${process.env.ALT_CONFIG} (options: ${Object.keys(library).join(', ')})`)
11+
if (process.env.ALT_CONFIG in library) {
12+
exp = library[process.env.ALT_CONFIG]
13+
} else if (process.env.ALT_CONFIG) {
14+
throw new Error(`Unknown config ${process.env.ALT_CONFIG} (options: ${Object.keys(library).join(', ')})`)
15+
}
16+
17+
return exp
1418
}
19+
20+
export default getDefaultExport()

package.json

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
],
1111
"main": "dist/index.js",
1212
"types": "dist/index.d.ts",
13+
"type": "module",
1314
"repository": {
1415
"type": "git",
1516
"url": "https://github.com/mmkal/eslint-plugin-mmkal"
@@ -27,46 +28,46 @@
2728
"keywords": [],
2829
"author": "",
2930
"license": "ISC",
30-
"devDependencies": {
31-
"@eslint/config-inspector": "0.5.4",
32-
"@types/lodash": "^4.17.7",
33-
"@types/node": "20.16.5",
34-
"eslint": "^8.57.0",
35-
"execa": "^9.0.0",
36-
"link": "^2.1.1",
37-
"np": "^10.0.7",
38-
"pkg-pr-new": "^0.0.25",
39-
"tsx": "^4.7.1",
40-
"typescript": "5.6.2",
41-
"vitest": "^2.0.0"
42-
},
4331
"dependencies": {
44-
"@eslint/js": "^9.0.0",
45-
"@next/eslint-plugin-next": "^14.1.4",
46-
"@rushstack/eslint-config": "^4.0.0",
47-
"@rushstack/eslint-plugin": "^0.16.0",
48-
"@rushstack/eslint-plugin-packlets": "^0.8.1",
49-
"@rushstack/eslint-plugin-security": "^0.8.0",
50-
"@types/eslint": "^8.44.7",
51-
"eslint-config-prettier": "^9.1.0",
52-
"eslint-config-xo": "^0.46.0",
53-
"eslint-config-xo-react": "^0.27.0",
54-
"eslint-config-xo-typescript": "^7.0.0",
55-
"eslint-plugin-codegen": "^0.33.0",
32+
"@eslint/js": "^9.21.0",
33+
"@next/eslint-plugin-next": "^15.2.1",
34+
"@rushstack/eslint-config": "^4.2.0",
35+
"@rushstack/eslint-plugin": "^0.17.0",
36+
"@rushstack/eslint-plugin-packlets": "^0.10.0",
37+
"@rushstack/eslint-plugin-security": "^0.9.0",
38+
"@types/eslint": "^9.6.1",
39+
"eslint": "^9.21.0",
40+
"eslint-config-prettier": "^10.0.2",
41+
"eslint-config-xo": "^0.49.0",
42+
"eslint-config-xo-react": "^0.28.0",
43+
"eslint-config-xo-typescript": "^9.0.0",
44+
"eslint-plugin-codegen": "^0.34.0",
5645
"eslint-plugin-functional": "^7.0.0",
57-
"eslint-plugin-import-x": "^4.0.0",
58-
"eslint-plugin-jsx-a11y": "^6.8.0",
59-
"eslint-plugin-markdown": "^5.0.0",
60-
"eslint-plugin-prettier": "^5.1.3",
61-
"eslint-plugin-promise": "^7.0.0",
62-
"eslint-plugin-react": "^7.33.2",
63-
"eslint-plugin-react-hooks": "^4.6.0",
64-
"eslint-plugin-unicorn": "^55.0.0",
65-
"eslint-plugin-vitest": "^0.5.0",
46+
"eslint-plugin-import-x": "^4.6.1",
47+
"eslint-plugin-jsx-a11y": "^6.10.2",
48+
"eslint-plugin-markdown": "^5.1.0",
49+
"eslint-plugin-prettier": "^5.2.3",
50+
"eslint-plugin-promise": "^7.2.1",
51+
"eslint-plugin-react": "^7.37.4",
52+
"eslint-plugin-react-hooks": "^5.2.0",
53+
"eslint-plugin-unicorn": "^61.0.2",
54+
"eslint-plugin-vitest": "^0.5.4",
6655
"eslint-plugin-wrapper": "0.1.0-1",
67-
"globals": "^15.0.0",
56+
"globals": "^16.0.0",
6857
"lodash": "^4.17.21",
69-
"prettier": "^3.1.0",
70-
"typescript-eslint": "^8.6.0"
58+
"prettier": "^3.5.3",
59+
"typescript-eslint": "^8.44.1"
60+
},
61+
"devDependencies": {
62+
"@eslint/config-inspector": "^1.0.2",
63+
"@types/lodash": "^4.17.16",
64+
"@types/node": "^22.13.9",
65+
"execa": "^9.5.2",
66+
"link": "^2.1.1",
67+
"np": "^10.2.0",
68+
"pkg-pr-new": "^0.0.40",
69+
"tsx": "^4.19.3",
70+
"typescript": "^5.8.2",
71+
"vitest": "^3.0.8"
7172
}
7273
}

0 commit comments

Comments
 (0)