Skip to content

Commit 747a4e3

Browse files
authored
Update eslint (#4)
* dev-deps: Update eslint, typescript-eslint and related modules * eslint: Update config * eslint: Fix no-wrapper-object-types * eslint: Fix no-unsafe-function-type * eslint: Fix no-empty-object-type * eslint: Fix no-explicit-any * dev-deps: Update typescript * Fix typescript problems * eslint: Fix eslint config * eslint: disable @typescript-eslint/no-require-imports on build.js * pkg: Update lint command
1 parent 6f4a968 commit 747a4e3

8 files changed

+369
-622
lines changed

.eslintrc.js

-41
This file was deleted.

build.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
/* eslint-disable @typescript-eslint/no-require-imports */
4+
35
// estrella build script
46
// ref: https://github.com/rsms/estrella
57

eslint.config.mjs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js'
4+
import globals from 'globals'
5+
import tseslint from 'typescript-eslint'
6+
7+
const recommended = tseslint.config(
8+
eslint.configs.recommended,
9+
...tseslint.configs.recommended,
10+
)
11+
12+
export default [
13+
...recommended,
14+
{
15+
languageOptions: {
16+
globals: {
17+
...globals.browser,
18+
...globals.node,
19+
Atomics: 'readonly',
20+
SharedArrayBuffer: 'readonly',
21+
},
22+
},
23+
rules: {
24+
indent: ['error', 4],
25+
'linebreak-style': ['error', 'unix'],
26+
quotes: ['error', 'single'],
27+
semi: ['error', 'never'],
28+
},
29+
},
30+
]

package.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"doc": "typedoc src",
2828
"size": "size-limit",
2929
"prepare": "tsc -noEmit && ./build.js",
30-
"lint": "eslint",
30+
"lint": "eslint --config eslint.config.mjs src *.js *.mjs",
3131
"coverage": "TS_NODE_PROJECT=tsconfig.test.json tap --no-browser --coverage-report=html 'src/**/*.test.ts'",
3232
"test": "TS_NODE_PROJECT=tsconfig.test.json tap",
3333
"build": "rm -rf dist/* && ./build.js",
@@ -39,16 +39,17 @@
3939
}
4040
},
4141
"devDependencies": {
42+
"@eslint/js": "^9.9.1",
4243
"@size-limit/esbuild": "^11.1.4",
4344
"@size-limit/esbuild-why": "^11.1.4",
4445
"@size-limit/preset-small-lib": "^11.1.4",
46+
"@types/eslint__js": "^8.42.3",
4547
"@types/node": "^22.5.2",
4648
"@types/tap": "^15.0.12",
47-
"@typescript-eslint/eslint-plugin": "^4.28.3",
48-
"@typescript-eslint/parser": "^4.28.3",
49-
"eslint": "^7.31.0",
49+
"eslint": "^9.9.1",
5050
"estrella": "^1.4.1",
5151
"fast-check": "^2.17.0",
52+
"globals": "^15.9.0",
5253
"husky": "^7.0.1",
5354
"prettier": "^2.3.2",
5455
"size-limit": "^11.1.4",
@@ -57,7 +58,8 @@
5758
"ts-node": "^10.1.0",
5859
"tslib": "^2.3.0",
5960
"typedoc": "^0.26.6",
60-
"typescript": "^4.3.5"
61+
"typescript": "^5.5.4",
62+
"typescript-eslint": "^8.4.0"
6163
},
6264
"keywords": [
6365
"ngram",

0 commit comments

Comments
 (0)