Skip to content

Commit

Permalink
chore: migrate to eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
co-sic committed Jul 12, 2024
1 parent c6aaa60 commit e25c9d8
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 69 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintrc.json

This file was deleted.

3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
.husky/
test/
.commitlintrc.yml
.eslintignore
.eslintrc.json
eslint.config.mjs
.gitignore
.lintstagedrc.yml
.prettierrc.yml
Expand Down
30 changes: 30 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/node_modules", "**/dist", "**/coverage"],
}, ...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
), {
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
},
}];
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"test:with-different-timezones": "TZ=America/New_York jest && TZ=Europe/Berlin jest && TZ=Asia/Tokyo jest",
"test:coverage": "jest --coverage",
"tsc:check": "tsc --noEmit",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier **/*.{ts,json} --check",
"format:fix": "prettier **/*.{ts,json} --write",
"prepare": "husky"
Expand Down Expand Up @@ -47,8 +47,8 @@
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"@types/jest": "29.5.12",
"@typescript-eslint/eslint-plugin": "7.15.0",
"@typescript-eslint/parser": "7.15.0",
"@typescript-eslint/eslint-plugin": "7.16.0",
"@typescript-eslint/parser": "7.16.0",
"eslint": "9.6.0",
"fast-check": "3.19.0",
"husky": "9.0.11",
Expand Down
100 changes: 50 additions & 50 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1256,85 +1256,85 @@
dependencies:
"@types/yargs-parser" "*"

"@typescript-eslint/eslint-plugin@7.15.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.15.0.tgz#8eaf396ac2992d2b8f874b68eb3fcd6b179cb7f3"
integrity sha512-uiNHpyjZtFrLwLDpHnzaDlP3Tt6sGMqTCiqmxaN4n4RP0EfYZDODJyddiFDF44Hjwxr5xAcaYxVKm9QKQFJFLA==
"@typescript-eslint/eslint-plugin@7.16.0":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.16.0.tgz#b3563927341eca15124a18c6f94215f779f5c02a"
integrity sha512-py1miT6iQpJcs1BiJjm54AMzeuMPBSPuKPlnT8HlfudbcS5rYeX5jajpLf3mrdRh9dA/Ec2FVUY0ifeVNDIhZw==
dependencies:
"@eslint-community/regexpp" "^4.10.0"
"@typescript-eslint/scope-manager" "7.15.0"
"@typescript-eslint/type-utils" "7.15.0"
"@typescript-eslint/utils" "7.15.0"
"@typescript-eslint/visitor-keys" "7.15.0"
"@typescript-eslint/scope-manager" "7.16.0"
"@typescript-eslint/type-utils" "7.16.0"
"@typescript-eslint/utils" "7.16.0"
"@typescript-eslint/visitor-keys" "7.16.0"
graphemer "^1.4.0"
ignore "^5.3.1"
natural-compare "^1.4.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/parser@7.15.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.15.0.tgz#f4a536e5fc6a1c05c82c4d263a2bfad2da235c80"
integrity sha512-k9fYuQNnypLFcqORNClRykkGOMOj+pV6V91R4GO/l1FDGwpqmSwoOQrOHo3cGaH63e+D3ZiCAOsuS/D2c99j/A==
"@typescript-eslint/parser@7.16.0":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.16.0.tgz#53fae8112f8c912024aea7b499cf7374487af6d8"
integrity sha512-ar9E+k7CU8rWi2e5ErzQiC93KKEFAXA2Kky0scAlPcxYblLt8+XZuHUZwlyfXILyQa95P6lQg+eZgh/dDs3+Vw==
dependencies:
"@typescript-eslint/scope-manager" "7.15.0"
"@typescript-eslint/types" "7.15.0"
"@typescript-eslint/typescript-estree" "7.15.0"
"@typescript-eslint/visitor-keys" "7.15.0"
"@typescript-eslint/scope-manager" "7.16.0"
"@typescript-eslint/types" "7.16.0"
"@typescript-eslint/typescript-estree" "7.16.0"
"@typescript-eslint/visitor-keys" "7.16.0"
debug "^4.3.4"

"@typescript-eslint/scope-manager@7.15.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.15.0.tgz#201b34b0720be8b1447df17b963941bf044999b2"
integrity sha512-Q/1yrF/XbxOTvttNVPihxh1b9fxamjEoz2Os/Pe38OHwxC24CyCqXxGTOdpb4lt6HYtqw9HetA/Rf6gDGaMPlw==
"@typescript-eslint/scope-manager@7.16.0":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.16.0.tgz#eb0757af5720c9c53c8010d7a0355ae27e17b7e5"
integrity sha512-8gVv3kW6n01Q6TrI1cmTZ9YMFi3ucDT7i7aI5lEikk2ebk1AEjrwX8MDTdaX5D7fPXMBLvnsaa0IFTAu+jcfOw==
dependencies:
"@typescript-eslint/types" "7.15.0"
"@typescript-eslint/visitor-keys" "7.15.0"
"@typescript-eslint/types" "7.16.0"
"@typescript-eslint/visitor-keys" "7.16.0"

"@typescript-eslint/type-utils@7.15.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.15.0.tgz#5b83c904c6de91802fb399305a50a56d10472c39"
integrity sha512-SkgriaeV6PDvpA6253PDVep0qCqgbO1IOBiycjnXsszNTVQe5flN5wR5jiczoEoDEnAqYFSFFc9al9BSGVltkg==
"@typescript-eslint/type-utils@7.16.0":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.16.0.tgz#ec52b1932b8fb44a15a3e20208e0bd49d0b6bd00"
integrity sha512-j0fuUswUjDHfqV/UdW6mLtOQQseORqfdmoBNDFOqs9rvNVR2e+cmu6zJu/Ku4SDuqiJko6YnhwcL8x45r8Oqxg==
dependencies:
"@typescript-eslint/typescript-estree" "7.15.0"
"@typescript-eslint/utils" "7.15.0"
"@typescript-eslint/typescript-estree" "7.16.0"
"@typescript-eslint/utils" "7.16.0"
debug "^4.3.4"
ts-api-utils "^1.3.0"

"@typescript-eslint/types@7.15.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.15.0.tgz#fb894373a6e3882cbb37671ffddce44f934f62fc"
integrity sha512-aV1+B1+ySXbQH0pLK0rx66I3IkiZNidYobyfn0WFsdGhSXw+P3YOqeTq5GED458SfB24tg+ux3S+9g118hjlTw==
"@typescript-eslint/types@7.16.0":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.16.0.tgz#60a19d7e7a6b1caa2c06fac860829d162a036ed2"
integrity sha512-fecuH15Y+TzlUutvUl9Cc2XJxqdLr7+93SQIbcZfd4XRGGKoxyljK27b+kxKamjRkU7FYC6RrbSCg0ALcZn/xw==

"@typescript-eslint/typescript-estree@7.15.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.15.0.tgz#e323bfa3966e1485b638ce751f219fc1f31eba37"
integrity sha512-gjyB/rHAopL/XxfmYThQbXbzRMGhZzGw6KpcMbfe8Q3nNQKStpxnUKeXb0KiN/fFDR42Z43szs6rY7eHk0zdGQ==
"@typescript-eslint/typescript-estree@7.16.0":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.0.tgz#98ac779d526fab2a781e5619c9250f3e33867c09"
integrity sha512-a5NTvk51ZndFuOLCh5OaJBELYc2O3Zqxfl3Js78VFE1zE46J2AaVuW+rEbVkQznjkmlzWsUI15BG5tQMixzZLw==
dependencies:
"@typescript-eslint/types" "7.15.0"
"@typescript-eslint/visitor-keys" "7.15.0"
"@typescript-eslint/types" "7.16.0"
"@typescript-eslint/visitor-keys" "7.16.0"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
minimatch "^9.0.4"
semver "^7.6.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/utils@7.15.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.15.0.tgz#9e6253c4599b6e7da2fb64ba3f549c73eb8c1960"
integrity sha512-hfDMDqaqOqsUVGiEPSMLR/AjTSCsmJwjpKkYQRo1FNbmW4tBwBspYDwO9eh7sKSTwMQgBw9/T4DHudPaqshRWA==
"@typescript-eslint/utils@7.16.0":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.16.0.tgz#b38dc0ce1778e8182e227c98d91d3418449aa17f"
integrity sha512-PqP4kP3hb4r7Jav+NiRCntlVzhxBNWq6ZQ+zQwII1y/G/1gdIPeYDCKr2+dH6049yJQsWZiHU6RlwvIFBXXGNA==
dependencies:
"@eslint-community/eslint-utils" "^4.4.0"
"@typescript-eslint/scope-manager" "7.15.0"
"@typescript-eslint/types" "7.15.0"
"@typescript-eslint/typescript-estree" "7.15.0"
"@typescript-eslint/scope-manager" "7.16.0"
"@typescript-eslint/types" "7.16.0"
"@typescript-eslint/typescript-estree" "7.16.0"

"@typescript-eslint/visitor-keys@7.15.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.15.0.tgz#1da0726201a859343fe6a05742a7c1792fff5b66"
integrity sha512-Hqgy/ETgpt2L5xueA/zHHIl4fJI2O4XUE9l4+OIfbJIRSnTJb/QscncdqqZzofQegIJugRIF57OJea1khw2SDw==
"@typescript-eslint/visitor-keys@7.16.0":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.0.tgz#a1d99fa7a3787962d6e0efd436575ef840e23b06"
integrity sha512-rMo01uPy9C7XxG7AFsxa8zLnWXTF8N3PYclekWSrurvhwiw1eW88mrKiAYe6s53AUY57nTRz8dJsuuXdkAhzCg==
dependencies:
"@typescript-eslint/types" "7.15.0"
"@typescript-eslint/types" "7.16.0"
eslint-visitor-keys "^3.4.3"

JSONStream@^1.3.5:
Expand Down

0 comments on commit e25c9d8

Please sign in to comment.