Skip to content

Commit

Permalink
Upgrade ESLint to v9
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Nov 5, 2024
1 parent f9a0fad commit dc6dcf1
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 106 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

91 changes: 0 additions & 91 deletions .eslintrc.cjs

This file was deleted.

50 changes: 50 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import js from "@eslint/js";
import import_ from "eslint-plugin-import";
import node from "eslint-plugin-n";
import promise from "eslint-plugin-promise";
import globals from "globals";
import ts from "typescript-eslint";

export default ts.config(
{
ignores: [".makefiles", "artifacts"],
},
js.configs.recommended,
// eslint-disable-next-line import/no-named-as-default-member
...ts.configs.recommended,
node.configs["flat/recommended-module"],
import_.flatConfigs.recommended,
import_.flatConfigs.typescript,
promise.configs["flat/recommended"],
{
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.es2022,
...globals.node,
},
},
settings: {
"import/resolver": {
typescript: true,
node: true,
},
},
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
// allow unused args if they start with _
argsIgnorePattern: "^_",
},
],
// handled by import/no-unresolved
"n/no-missing-import": "off",
// don't check for unsupported features - too much config to make this work
"n/no-unsupported-features/es-builtins": "off",
"n/no-unsupported-features/es-syntax": "off",
"n/no-unsupported-features/node-builtins": "off",
},
},
);
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"/artifacts/dist/"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"scripts": {
"prepublishOnly": "make artifacts/dist"
Expand All @@ -75,27 +75,29 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.16.4",
"@eslint/js": "^9.14.0",
"@skypack/package-check": "^0.2.2",
"@stryker-mutator/core": "^8.0.0",
"@stryker-mutator/typescript-checker": "^8.0.0",
"@stryker-mutator/vitest-runner": "^8.2.6",
"@types/eslint__js": "^8.42.3",
"@types/mdast": "^4.0.3",
"@types/node": "^22.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@vitest/coverage-v8": "^2.0.0",
"eslint": "^8.17.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.2.5",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^17.0.0",
"eslint-plugin-promise": "^7.0.0",
"eslint-plugin-vitest": "^0.4.0",
"@vitest/eslint-plugin": "^1.1.7",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^17.12.0",
"eslint-plugin-promise": "^7.1.0",
"globals": "^15.12.0",
"prettier": "^3.0.0",
"prettier-plugin-organize-imports": "^4.0.0",
"publint": "^0.2.12",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
"typescript-eslint": "^8.13.0",
"vite-tsconfig-paths": "^5.1.0",
"vitest": "^2.0.0"
}
Expand Down
3 changes: 0 additions & 3 deletions test/suite/specification-prettier.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe("Specification documents (Prettier unavailable)", () => {

describe("when Prettier is not installed", () => {
beforeAll(() => {
// eslint-disable-next-line @typescript-eslint/require-await
vi.doMock("prettier", async () => {
throw new Error('Cannot find module "prettier"');
});
Expand All @@ -63,14 +62,12 @@ describe("Specification documents (Prettier unavailable)", () => {

describe("when Prettier is installed but not configured", () => {
beforeAll(() => {
// eslint-disable-next-line @typescript-eslint/require-await
vi.doMock("prettier", async () => {
const prettier = await vi.importActual("prettier");

return {
...prettier,

// eslint-disable-next-line @typescript-eslint/require-await
async resolveConfig() {
return null;
},
Expand Down

0 comments on commit dc6dcf1

Please sign in to comment.