Skip to content

Commit 1e9a532

Browse files
authored
chore: upgrade to eslint 9 (#1569)
1 parent 35dcacd commit 1e9a532

File tree

18 files changed

+486
-540
lines changed

18 files changed

+486
-540
lines changed

.eslintrc.json

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

.github/workflows/checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Install Node.js
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: 20
20+
node-version: 22
2121
cache: 'pnpm'
2222
- name: Check size
2323
uses: andresz1/size-limit-action@master
@@ -47,7 +47,7 @@ jobs:
4747
- name: Install Node.js
4848
uses: actions/setup-node@v4
4949
with:
50-
node-version: 20
50+
node-version: 22
5151
cache: 'pnpm'
5252
- name: Check package.json files
5353
run: pnpm dlx @trigen/lint-package-json

.github/workflows/commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Install Node.js
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: 20
20+
node-version: 22
2121
cache: 'pnpm'
2222
- name: Install dependencies
2323
run: pnpm install

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install Node.js
1717
uses: actions/setup-node@v4
1818
with:
19-
node-version: 20
19+
node-version: 22
2020
cache: 'pnpm'
2121
registry-url: 'https://registry.npmjs.org'
2222
- name: Install dependencies

.github/workflows/tests.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,31 @@ jobs:
1919
- name: Install Node.js
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: 20
22+
node-version: 22
2323
cache: 'pnpm'
2424
- name: Install dependencies
2525
run: pnpm install
2626
- name: Check types
2727
run: pnpm test:types
28+
lint:
29+
runs-on: ubuntu-latest
30+
name: lint
31+
steps:
32+
- name: Checkout the repository
33+
uses: actions/checkout@v4
34+
- name: Install pnpm
35+
uses: pnpm/action-setup@v4
36+
with:
37+
version: 10
38+
- name: Install Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 22
42+
cache: 'pnpm'
43+
- name: Install dependencies
44+
run: pnpm install
45+
- name: Lint files
46+
run: pnpm lint
2847
unit:
2948
runs-on: ubuntu-latest
3049
name: unit
@@ -38,12 +57,12 @@ jobs:
3857
- name: Install Node.js
3958
uses: actions/setup-node@v4
4059
with:
41-
node-version: 20
60+
node-version: 22
4261
cache: 'pnpm'
4362
- name: Install dependencies
4463
run: pnpm install
4564
- name: Run tests
46-
run: pnpm test
65+
run: pnpm test:unit
4766
- name: Collect coverage
4867
uses: codecov/codecov-action@v5
4968
if: success()

.github/workflows/website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Install Node.js
3030
uses: actions/setup-node@v4
3131
with:
32-
node-version: 20
32+
node-version: 22
3333
cache: 'pnpm'
3434
- name: Install dependencies
3535
run: pnpm install

.nano-staged.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"*.{js,ts,tsx}": "eslint --fix"
2+
"*.{c,m,}{js,ts}{x,}": "eslint --flag v10_config_lookup_from_file --fix"
33
}

eslint.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { globalIgnores } from 'eslint/config'
2+
import baseConfig from '@trigen/eslint-config'
3+
import moduleConfig from '@trigen/eslint-config/module'
4+
import tsConfig from '@trigen/eslint-config/typescript'
5+
// import tsTypeCheckedConfig from '@trigen/eslint-config/typescript-type-checked'
6+
import testConfig from '@trigen/eslint-config/test'
7+
import env from '@trigen/eslint-config/env'
8+
9+
export default [
10+
globalIgnores(['**/dist/', '**/package/']),
11+
...baseConfig,
12+
...moduleConfig,
13+
...tsConfig,
14+
// ...tsTypeCheckedConfig,
15+
...testConfig,
16+
env.node,
17+
{
18+
languageOptions: {
19+
parserOptions: {
20+
projectService: true,
21+
tsconfigRootDir: import.meta.dirname
22+
}
23+
},
24+
rules: {
25+
'@typescript-eslint/no-magic-numbers': 'off',
26+
'@stylistic/array-element-newline': 'off'
27+
}
28+
}
29+
]

examples/.eslintrc.json

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

examples/eslint.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import rootConfig from '../eslint.config.js'
2+
3+
export default [
4+
...rootConfig,
5+
{
6+
rules: {
7+
'no-console': 'off'
8+
}
9+
}
10+
]

0 commit comments

Comments
 (0)