Skip to content

Commit cbf68e1

Browse files
committed
Update eslint
1 parent 606e87f commit cbf68e1

File tree

6 files changed

+229
-152
lines changed

6 files changed

+229
-152
lines changed

.eslintrc.json

-28
This file was deleted.

eslint.config.mjs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import js from "@eslint/js";
2+
import node from "eslint-plugin-n";
3+
import eslintPlugin from "eslint-plugin-eslint-plugin";
4+
import prettier from "eslint-config-prettier";
5+
import globals from "globals";
6+
7+
export default [
8+
js.configs.recommended,
9+
node.configs["flat/recommended"],
10+
eslintPlugin.configs["flat/all"],
11+
prettier,
12+
{
13+
languageOptions: { globals: { ...globals.mocha, ...globals.node } },
14+
linterOptions: { reportUnusedDisableDirectives: true },
15+
rules: {
16+
"arrow-body-style": "error",
17+
strict: "error",
18+
"n/prefer-global/buffer": "error",
19+
"n/prefer-global/console": "error",
20+
"n/prefer-global/process": "error",
21+
"n/prefer-global/text-decoder": "error",
22+
"n/prefer-global/url": "error",
23+
"n/prefer-global/url-search-params": "error",
24+
"eslint-plugin/require-meta-docs-url": [
25+
"error",
26+
{
27+
pattern:
28+
"https://github.com/joshuajaco/eslint-plugin-workspaces/blob/main/docs/rules/{{name}}.md",
29+
},
30+
],
31+
},
32+
},
33+
{
34+
files: ["**/*.mjs"],
35+
languageOptions: { sourceType: "module" },
36+
},
37+
];

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"scripts": {
2929
"format": "prettier . --write",
3030
"format:check": "prettier . --check",
31-
"lint": "eslint . --ignore-path=.gitignore --max-warnings=0",
31+
"lint": "eslint . --max-warnings=0",
3232
"lint:fix": "npm run lint -- --fix",
3333
"test": "nyc -r=lcov -r=text mocha tests --recursive --file tests/setup.js"
3434
},
@@ -37,10 +37,13 @@
3737
},
3838
"devDependencies": {
3939
"@babel/eslint-parser": "^7.25.0",
40-
"eslint": "^8.56.0",
40+
"@eslint/js": "^9.8.0",
41+
"eslint": "^9.8.0",
4142
"eslint-config-prettier": "^9.1.0",
4243
"eslint-plugin-eslint-plugin": "^6.2.0",
44+
"eslint-plugin-n": "^17.10.1",
4345
"eslint-plugin-node": "^11.1.0",
46+
"globals": "^15.8.0",
4447
"mocha": "^10.7.0",
4548
"nyc": "^17.0.0",
4649
"prettier": "^3.3.3",

0 commit comments

Comments
 (0)