From 3aaed7767ff0f38c2eb4306906b0e0f2548f3b2d Mon Sep 17 00:00:00 2001 From: AriPerkkio Date: Sun, 21 Apr 2024 10:36:35 +0300 Subject: [PATCH] chore(dev-deps): eslint v9 --- .eslintrc.js | 39 ----------------- eslint.config.mjs | 41 +++++++++++++++++ package.json | 7 +-- pnpm-lock.yaml | 109 +++++++++++++++++++++++++++++----------------- 4 files changed, 113 insertions(+), 83 deletions(-) delete mode 100644 .eslintrc.js create mode 100644 eslint.config.mjs diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 925110f..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,39 +0,0 @@ -/** @type {import('eslint/lib/shared/types').ConfigData} */ -module.exports = { - root: true, - env: { - node: true, - es6: true, - jasmine: true, - }, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 2020, - sourceType: 'module', - ecmaFeatures: { - jsx: true, - }, - }, - plugins: ['@typescript-eslint'], - extends: [ - 'eslint:recommended', - 'plugin:prettier/recommended', - 'plugin:@typescript-eslint/recommended', - ], - rules: { - '@typescript-eslint/ban-types': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-namespace': 'off', - '@typescript-eslint/triple-slash-reference': 'off', - '@typescript-eslint/no-empty-interface': 'off', - }, - overrides: [ - { - files: ['*.test.ts*'], - rules: { - '@typescript-eslint/no-non-null-assertion': 'off', - }, - }, - ], - ignorePatterns: ['dist'], -}; diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..847756a --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,41 @@ +import js from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; +import globals from 'globals'; + +export default defineConfig([ + js.configs.recommended, + ...tseslint.configs.recommended, + { + languageOptions: { + ecmaVersion: 2020, + sourceType: 'module', + globals: { + ...globals.node, + ...globals.jasmine, + }, + }, + }, + { + rules: { + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/triple-slash-reference': 'off', + '@typescript-eslint/no-empty-interface': 'off', + }, + }, + { + files: ['*.test.ts*'], + rules: { + '@typescript-eslint/no-non-null-assertion': 'off', + }, + }, + { ignores: ['dist'] }, + eslintPluginPrettierRecommended, +]); + +/** @param config {import('eslint').Linter.FlatConfig} */ +function defineConfig(config) { + return config; +} diff --git a/package.json b/package.json index 6f620a6..04bc163 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "build": "rollup --config rollup.config.ts --configPlugin typescript", "test": "vitest run", "test:watch": "vitest watch", - "lint": "eslint . --max-warnings 0 --ext .js,.ts", + "lint": "eslint . --max-warnings 0", "validate": "pnpm build && pnpm lint && pnpm test" }, "repository": { @@ -57,14 +57,14 @@ "aria-live-capture": "^1.0.2" }, "devDependencies": { + "@eslint/js": "^9.1.1", "@types/node": "^20.12.7", - "@typescript-eslint/eslint-plugin": "^7.6.0", - "@typescript-eslint/parser": "^7.6.0", "@vitest/expect": "^1.5.0", "esbuild": "^0.20.2", "eslint": "^9.1.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", + "globals": "^15.0.0", "jsdom": "^24.0.0", "prettier": "^3.2.5", "rollup": "^4.14.2", @@ -73,6 +73,7 @@ "rollup-plugin-local-import": "^1.2.0", "rollup-plugin-typescript": "^1.0.1", "typescript": "^5.4.5", + "typescript-eslint": "^7.7.0", "vitest": "^1.5.0" }, "packageManager": "pnpm@8.15.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e6e3d04..4541ab7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,15 +10,12 @@ dependencies: version: 1.0.2 devDependencies: + '@eslint/js': + specifier: ^9.1.1 + version: 9.1.1 '@types/node': specifier: ^20.12.7 version: 20.12.7 - '@typescript-eslint/eslint-plugin': - specifier: ^7.6.0 - version: 7.6.0(@typescript-eslint/parser@7.6.0)(eslint@9.1.0)(typescript@5.4.5) - '@typescript-eslint/parser': - specifier: ^7.6.0 - version: 7.6.0(eslint@9.1.0)(typescript@5.4.5) '@vitest/expect': specifier: ^1.5.0 version: 1.5.0 @@ -34,6 +31,9 @@ devDependencies: eslint-plugin-prettier: specifier: ^5.1.3 version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@9.1.0)(prettier@3.2.5) + globals: + specifier: ^15.0.0 + version: 15.0.0 jsdom: specifier: ^24.0.0 version: 24.0.0 @@ -58,6 +58,9 @@ devDependencies: typescript: specifier: ^5.4.5 version: 5.4.5 + typescript-eslint: + specifier: ^7.7.0 + version: 7.7.0(eslint@9.1.0)(typescript@5.4.5) vitest: specifier: ^1.5.0 version: 1.5.0(@types/node@20.12.7)(jsdom@24.0.0) @@ -774,8 +777,8 @@ packages: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true - /@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0)(eslint@9.1.0)(typescript@5.4.5): - resolution: {integrity: sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A==} + /@typescript-eslint/eslint-plugin@7.7.0(@typescript-eslint/parser@7.7.0)(eslint@9.1.0)(typescript@5.4.5): + resolution: {integrity: sha512-GJWR0YnfrKnsRoluVO3PRb9r5aMZriiMMM/RHj5nnTrBy1/wIgk76XCtCKcnXGjpZQJQRFtGV9/0JJ6n30uwpQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -786,11 +789,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.6.0(eslint@9.1.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/type-utils': 7.6.0(eslint@9.1.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@9.1.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.6.0 + '@typescript-eslint/parser': 7.7.0(eslint@9.1.0)(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.7.0 + '@typescript-eslint/type-utils': 7.7.0(eslint@9.1.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.7.0(eslint@9.1.0)(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.7.0 debug: 4.3.4 eslint: 9.1.0 graphemer: 1.4.0 @@ -803,8 +806,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@7.6.0(eslint@9.1.0)(typescript@5.4.5): - resolution: {integrity: sha512-usPMPHcwX3ZoPWnBnhhorc14NJw9J4HpSXQX4urF2TPKG0au0XhJoZyX62fmvdHONUkmyUe74Hzm1//XA+BoYg==} + /@typescript-eslint/parser@7.7.0(eslint@9.1.0)(typescript@5.4.5): + resolution: {integrity: sha512-fNcDm3wSwVM8QYL4HKVBggdIPAy9Q41vcvC/GtDobw3c4ndVT3K6cqudUmjHPw8EAp4ufax0o58/xvWaP2FmTg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -813,10 +816,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.6.0 + '@typescript-eslint/scope-manager': 7.7.0 + '@typescript-eslint/types': 7.7.0 + '@typescript-eslint/typescript-estree': 7.7.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.7.0 debug: 4.3.4 eslint: 9.1.0 typescript: 5.4.5 @@ -824,16 +827,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@7.6.0: - resolution: {integrity: sha512-ngttyfExA5PsHSx0rdFgnADMYQi+Zkeiv4/ZxGYUWd0nLs63Ha0ksmp8VMxAIC0wtCFxMos7Lt3PszJssG/E6w==} + /@typescript-eslint/scope-manager@7.7.0: + resolution: {integrity: sha512-/8INDn0YLInbe9Wt7dK4cXLDYp0fNHP5xKLHvZl3mOT5X17rK/YShXaiNmorl+/U4VKCVIjJnx4Ri5b0y+HClw==} engines: {node: ^18.18.0 || >=20.0.0} dependencies: - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/visitor-keys': 7.6.0 + '@typescript-eslint/types': 7.7.0 + '@typescript-eslint/visitor-keys': 7.7.0 dev: true - /@typescript-eslint/type-utils@7.6.0(eslint@9.1.0)(typescript@5.4.5): - resolution: {integrity: sha512-NxAfqAPNLG6LTmy7uZgpK8KcuiS2NZD/HlThPXQRGwz6u7MDBWRVliEEl1Gj6U7++kVJTpehkhZzCJLMK66Scw==} + /@typescript-eslint/type-utils@7.7.0(eslint@9.1.0)(typescript@5.4.5): + resolution: {integrity: sha512-bOp3ejoRYrhAlnT/bozNQi3nio9tIgv3U5C0mVDdZC7cpcQEDZXvq8inrHYghLVwuNABRqrMW5tzAv88Vy77Sg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -842,8 +845,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@9.1.0)(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 7.7.0(typescript@5.4.5) + '@typescript-eslint/utils': 7.7.0(eslint@9.1.0)(typescript@5.4.5) debug: 4.3.4 eslint: 9.1.0 ts-api-utils: 1.3.0(typescript@5.4.5) @@ -852,13 +855,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types@7.6.0: - resolution: {integrity: sha512-h02rYQn8J+MureCvHVVzhl69/GAfQGPQZmOMjG1KfCl7o3HtMSlPaPUAPu6lLctXI5ySRGIYk94clD/AUMCUgQ==} + /@typescript-eslint/types@7.7.0: + resolution: {integrity: sha512-G01YPZ1Bd2hn+KPpIbrAhEWOn5lQBrjxkzHkWvP6NucMXFtfXoevK82hzQdpfuQYuhkvFDeQYbzXCjR1z9Z03w==} engines: {node: ^18.18.0 || >=20.0.0} dev: true - /@typescript-eslint/typescript-estree@7.6.0(typescript@5.4.5): - resolution: {integrity: sha512-+7Y/GP9VuYibecrCQWSKgl3GvUM5cILRttpWtnAu8GNL9j11e4tbuGZmZjJ8ejnKYyBRb2ddGQ3rEFCq3QjMJw==} + /@typescript-eslint/typescript-estree@7.7.0(typescript@5.4.5): + resolution: {integrity: sha512-8p71HQPE6CbxIBy2kWHqM1KGrC07pk6RJn40n0DSc6bMOBBREZxSDJ+BmRzc8B5OdaMh1ty3mkuWRg4sCFiDQQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' @@ -866,8 +869,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/visitor-keys': 7.6.0 + '@typescript-eslint/types': 7.7.0 + '@typescript-eslint/visitor-keys': 7.7.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -879,8 +882,8 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@7.6.0(eslint@9.1.0)(typescript@5.4.5): - resolution: {integrity: sha512-x54gaSsRRI+Nwz59TXpCsr6harB98qjXYzsRxGqvA5Ue3kQH+FxS7FYU81g/omn22ML2pZJkisy6Q+ElK8pBCA==} + /@typescript-eslint/utils@7.7.0(eslint@9.1.0)(typescript@5.4.5): + resolution: {integrity: sha512-LKGAXMPQs8U/zMRFXDZOzmMKgFv3COlxUQ+2NMPhbqgVm6R1w+nU1i4836Pmxu9jZAuIeyySNrN/6Rc657ggig==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -888,9 +891,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@9.1.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.7.0 + '@typescript-eslint/types': 7.7.0 + '@typescript-eslint/typescript-estree': 7.7.0(typescript@5.4.5) eslint: 9.1.0 semver: 7.6.0 transitivePeerDependencies: @@ -898,11 +901,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@7.6.0: - resolution: {integrity: sha512-4eLB7t+LlNUmXzfOu1VAIAdkjbu5xNSerURS9X/S5TUKWFRpXRQZbmtPqgKmYx8bj3J0irtQXSiWAOY82v+cgw==} + /@typescript-eslint/visitor-keys@7.7.0: + resolution: {integrity: sha512-h0WHOj8MhdhY8YWkzIF30R379y0NqyOHExI9N9KCzvmu05EgG4FumeYa3ccfKUSphyWkWQE1ybVrgz/Pbam6YA==} engines: {node: ^18.18.0 || >=20.0.0} dependencies: - '@typescript-eslint/types': 7.6.0 + '@typescript-eslint/types': 7.7.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1646,6 +1649,11 @@ packages: engines: {node: '>=18'} dev: true + /globals@15.0.0: + resolution: {integrity: sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw==} + engines: {node: '>=18'} + dev: true + /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -2589,6 +2597,25 @@ packages: engines: {node: '>=4'} dev: true + /typescript-eslint@7.7.0(eslint@9.1.0)(typescript@5.4.5): + resolution: {integrity: sha512-wZZ+7mTQJCn4mGAvzdERtL4vwKGM/mF9cMSMeKUllz3Hgbd1Mdd5L60Q+nJmCio9RB4OyMMr0EX4Ry2Q7jiAyw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/eslint-plugin': 7.7.0(@typescript-eslint/parser@7.7.0)(eslint@9.1.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.7.0(eslint@9.1.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.7.0(eslint@9.1.0)(typescript@5.4.5) + eslint: 9.1.0 + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + /typescript@5.4.5: resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} engines: {node: '>=14.17'}