From 41a03c4b190969a079e94ddabfbeaca8a2732724 Mon Sep 17 00:00:00 2001 From: ada Date: Fri, 9 Aug 2024 12:39:11 -0600 Subject: [PATCH] eslint ts conf --- eslint.config.mjs | 18 ++-- package.json | 4 +- pnpm-lock.yaml | 263 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 274 insertions(+), 11 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 2090f43..def6330 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,11 +1,9 @@ -import js from '@eslint/js' +// @ts-check -export default [ - js.configs.recommended, - { - rules: { - 'no-unused-vars': 'warn', - 'no-undef': 'warn', - }, - }, -] +import eslint from '@eslint/js' +import tseslint from 'typescript-eslint' + +export default tseslint.config( + eslint.configs.recommended, + ...tseslint.configs.recommended, +) diff --git a/package.json b/package.json index 6e3f9f9..386f736 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "scripts": { "src:dev": "vuepress dev src", "src:build": "vuepress build src", + "lint": "eslint . ", "prepare": "husky" }, "devDependencies": { @@ -17,6 +18,7 @@ }, "dependencies": { "eslint": "^9.8.0", - "husky": "^9.1.4" + "husky": "^9.1.4", + "typescript-eslint": "^8.0.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed13f6d..6572b7a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,6 +13,9 @@ importers: husky: specifier: ^9.1.4 version: 9.1.4 + typescript-eslint: + specifier: ^8.0.1 + version: 8.0.1(eslint@9.8.0)(typescript@5.5.4) devDependencies: '@vuepress/bundler-vite': specifier: 2.0.0-rc.14 @@ -1395,6 +1398,87 @@ packages: integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==, } + '@typescript-eslint/eslint-plugin@8.0.1': + resolution: + { + integrity: sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + peerDependencies: + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/parser@8.0.1': + resolution: + { + integrity: sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/scope-manager@8.0.1': + resolution: + { + integrity: sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + + '@typescript-eslint/type-utils@8.0.1': + resolution: + { + integrity: sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/types@8.0.1': + resolution: + { + integrity: sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + + '@typescript-eslint/typescript-estree@8.0.1': + resolution: + { + integrity: sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/utils@8.0.1': + resolution: + { + integrity: sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + + '@typescript-eslint/visitor-keys@8.0.1': + resolution: + { + integrity: sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + '@typescript/vfs@1.5.0': resolution: { @@ -1947,6 +2031,13 @@ packages: integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==, } + array-union@2.1.0: + resolution: + { + integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==, + } + engines: { node: '>=8' } + autoprefixer@10.4.20: resolution: { @@ -2228,6 +2319,13 @@ packages: integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==, } + dir-glob@3.0.1: + resolution: + { + integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==, + } + engines: { node: '>=8' } + dom-serializer@2.0.0: resolution: { @@ -2588,6 +2686,13 @@ packages: } engines: { node: '>=18' } + globby@11.1.0: + resolution: + { + integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==, + } + engines: { node: '>=10' } + globby@14.0.2: resolution: { @@ -2601,6 +2706,12 @@ packages: integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==, } + graphemer@1.4.0: + resolution: + { + integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==, + } + gray-matter@4.0.3: resolution: { @@ -3399,6 +3510,13 @@ packages: } engines: { node: '>=12' } + path-type@4.0.0: + resolution: + { + integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==, + } + engines: { node: '>=8' } + path-type@5.0.0: resolution: { @@ -3658,6 +3776,13 @@ packages: engines: { node: '>=14.0.0', npm: '>=6.0.0' } hasBin: true + slash@3.0.0: + resolution: + { + integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==, + } + engines: { node: '>=8' } + slash@5.1.0: resolution: { @@ -3785,6 +3910,15 @@ packages: integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==, } + ts-api-utils@1.3.0: + resolution: + { + integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==, + } + engines: { node: '>=16' } + peerDependencies: + typescript: '>=4.2.0' + ts-debounce@4.0.0: resolution: { @@ -3820,6 +3954,18 @@ packages: } engines: { node: '>= 0.8.0' } + typescript-eslint@8.0.1: + resolution: + { + integrity: sha512-V3Y+MdfhawxEjE16dWpb7/IOgeXnLwAEEkS7v8oDqNcR1oYlqWhGH/iHqHdKVdpWme1VPZ0SoywXAkCqawj2eQ==, + } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + typescript@5.5.4: resolution: { @@ -4838,6 +4984,87 @@ snapshots: '@types/web-bluetooth@0.0.20': {} + '@typescript-eslint/eslint-plugin@8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4)': + dependencies: + '@eslint-community/regexpp': 4.11.0 + '@typescript-eslint/parser': 8.0.1(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.0.1 + '@typescript-eslint/type-utils': 8.0.1(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.1(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.0.1 + eslint: 9.8.0 + graphemer: 1.4.0 + ignore: 5.3.1 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4)': + dependencies: + '@typescript-eslint/scope-manager': 8.0.1 + '@typescript-eslint/types': 8.0.1 + '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.0.1 + debug: 4.3.6 + eslint: 9.8.0 + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@8.0.1': + dependencies: + '@typescript-eslint/types': 8.0.1 + '@typescript-eslint/visitor-keys': 8.0.1 + + '@typescript-eslint/type-utils@8.0.1(eslint@9.8.0)(typescript@5.5.4)': + dependencies: + '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.1(eslint@9.8.0)(typescript@5.5.4) + debug: 4.3.6 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - eslint + - supports-color + + '@typescript-eslint/types@8.0.1': {} + + '@typescript-eslint/typescript-estree@8.0.1(typescript@5.5.4)': + dependencies: + '@typescript-eslint/types': 8.0.1 + '@typescript-eslint/visitor-keys': 8.0.1 + debug: 4.3.6 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.0.1(eslint@9.8.0)(typescript@5.5.4)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) + '@typescript-eslint/scope-manager': 8.0.1 + '@typescript-eslint/types': 8.0.1 + '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) + eslint: 9.8.0 + transitivePeerDependencies: + - supports-color + - typescript + + '@typescript-eslint/visitor-keys@8.0.1': + dependencies: + '@typescript-eslint/types': 8.0.1 + eslint-visitor-keys: 3.4.3 + '@typescript/vfs@1.5.0': dependencies: debug: 4.3.6 @@ -5416,6 +5643,8 @@ snapshots: argparse@2.0.1: {} + array-union@2.1.0: {} + autoprefixer@10.4.20(postcss@8.4.41): dependencies: browserslist: 4.23.3 @@ -5570,6 +5799,10 @@ snapshots: dependencies: dequal: 2.0.3 + dir-glob@3.0.1: + dependencies: + path-type: 4.0.0 + dom-serializer@2.0.0: dependencies: domelementtype: 2.3.0 @@ -5846,6 +6079,15 @@ snapshots: globals@14.0.0: {} + globby@11.1.0: + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.2 + ignore: 5.3.1 + merge2: 1.4.1 + slash: 3.0.0 + globby@14.0.2: dependencies: '@sindresorhus/merge-streams': 2.3.0 @@ -5857,6 +6099,8 @@ snapshots: graceful-fs@4.2.11: {} + graphemer@1.4.0: {} + gray-matter@4.0.3: dependencies: js-yaml: 3.14.1 @@ -6398,6 +6642,8 @@ snapshots: path-key@4.0.0: {} + path-type@4.0.0: {} + path-type@5.0.0: {} pathe@1.1.2: {} @@ -6528,6 +6774,8 @@ snapshots: arg: 5.0.2 sax: 1.4.1 + slash@3.0.0: {} + slash@5.1.0: {} source-map-js@1.2.0: {} @@ -6578,6 +6826,10 @@ snapshots: trim-lines@3.0.1: {} + ts-api-utils@1.3.0(typescript@5.5.4): + dependencies: + typescript: 5.5.4 + ts-debounce@4.0.0: {} twoslash-protocol@0.2.9: {} @@ -6603,6 +6855,17 @@ snapshots: dependencies: prelude-ls: 1.2.1 + typescript-eslint@8.0.1(eslint@9.8.0)(typescript@5.5.4): + dependencies: + '@typescript-eslint/eslint-plugin': 8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.1(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.1(eslint@9.8.0)(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - eslint + - supports-color + typescript@5.5.4: {} uc.micro@2.1.0: {}