Skip to content

Commit 890019a

Browse files
chore(deps): upgrade ESLint to v9 (#200)
Co-authored-by: Timothy Jones <timothy.l.jones@gmail.com>
1 parent 7168feb commit 890019a

File tree

4 files changed

+76
-55
lines changed

4 files changed

+76
-55
lines changed

.eslintrc

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

eslint.config.mjs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import globals from "globals";
2+
import js from "@eslint/js";
3+
import jest from "eslint-plugin-jest";
4+
import eslintConfigPrettier from "eslint-config-prettier";
5+
6+
/**
7+
* @type {import("eslint").Linter.Config}
8+
*/
9+
export default [
10+
{
11+
"ignores": [".git/", ".github/", ".husky/", ".scannerwork/", ".vscode/", "coverage/", "node_modules/"],
12+
"name": "Files to ignore"
13+
},
14+
{
15+
...eslintConfigPrettier,
16+
"name": "Prettier"
17+
},
18+
{
19+
...js.configs.recommended,
20+
"files": ["**/*.{js,cjs,mjs}"],
21+
"languageOptions": {
22+
"ecmaVersion": 2023
23+
},
24+
"name": "JavaScript files",
25+
"rules": {
26+
...js.configs.recommended.rules,
27+
"no-var": "error",
28+
"no-unused-vars": [
29+
"error",
30+
{
31+
"argsIgnorePattern": "_.*"
32+
}
33+
]
34+
}
35+
},
36+
{
37+
"files": ["**/*.mjs"],
38+
"languageOptions": {
39+
"sourceType": "module"
40+
},
41+
"name": "JavaScript modules"
42+
},
43+
{
44+
"files": ["**/*.{js,cjs,mjs}"],
45+
"languageOptions": {
46+
"globals": {
47+
...globals.node
48+
}
49+
},
50+
"name": "Node.js files"
51+
},
52+
{
53+
...jest.configs["flat/recommended"],
54+
"files": ["test/**/*{spec,test}.{js,cjs,mjs}", "test/mocks/jest-mocks.js"],
55+
"languageOptions": {
56+
"globals": {
57+
...globals.jest
58+
}
59+
},
60+
"name": "Test files",
61+
"rules": {
62+
...jest.configs["flat/recommended"].rules,
63+
"jest/prefer-expect-assertions": "off",
64+
"jest/expect-expect": "off"
65+
}
66+
}
67+
];

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module.exports = async function standardVersion(argv) {
6969
: false,
7070
};
7171
break;
72+
// eslint-disable-next-line no-unused-vars
7273
} catch (err) {
7374
/* This probably shouldn't be empty? */
7475
}

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"description": "replacement for `npm version` with automatic CHANGELOG generation",
55
"bin": "bin/cli.js",
66
"scripts": {
7-
"fix": "eslint . --fix",
8-
"posttest": "eslint . && npm run format:check",
7+
"eslint": "eslint .",
8+
"eslint:fix": "npm run eslint -- --fix",
9+
"posttest": "npm run eslint && npm run format:check",
910
"format:base": "prettier \"./**/*.{ts,js}\"",
1011
"format:fix": "npm run format:base -- --write",
1112
"format:check": "npm run format:base -- --check",
@@ -56,12 +57,13 @@
5657
"yargs": "^17.7.2"
5758
},
5859
"devDependencies": {
59-
"eslint": "^8.57.1",
60+
"@eslint/js": "^9.13.0",
61+
"eslint": "^9.13.0",
6062
"eslint-config-prettier": "^9.1.0",
6163
"eslint-plugin-import": "^2.31.0",
62-
"eslint-plugin-jest": "^27.9.0",
63-
"eslint-plugin-n": "^15.7.0",
64-
"eslint-plugin-promise": "^6.6.0",
64+
"eslint-plugin-jest": "^28.8.3",
65+
"eslint-plugin-n": "^17.11.1",
66+
"eslint-plugin-promise": "^7.1.0",
6567
"jest": "^29.7.0",
6668
"jest-serial-runner": "^1.2.1",
6769
"prettier": "^3.3.3",

0 commit comments

Comments
 (0)