From 7d3fe834575bde9060d8a725b80fe8feaa1c19e8 Mon Sep 17 00:00:00 2001 From: beefchimi Date: Mon, 15 Jul 2024 13:22:21 -0400 Subject: [PATCH] :alembic: [Eslint] More config experiments --- app/website/eslint.config.mjs | 22 +++++++ app/website/package.json | 2 + pnpm-lock.yaml | 109 +++++++++++++++++++++++++++++++--- 3 files changed, 126 insertions(+), 7 deletions(-) diff --git a/app/website/eslint.config.mjs b/app/website/eslint.config.mjs index a7cdaa8..2ce76d0 100644 --- a/app/website/eslint.config.mjs +++ b/app/website/eslint.config.mjs @@ -11,6 +11,10 @@ import {fileURLToPath} from 'node:url'; import {FlatCompat} from '@eslint/eslintrc'; import pluginVue from 'eslint-plugin-vue'; +// import vueParser from 'vue-eslint-parser'; +// import tsParser from '@typescript-eslint/parser'; +// import tsPlugin from '@typescript-eslint/eslint-plugin'; + const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const compat = new FlatCompat({ @@ -21,6 +25,12 @@ const compat = new FlatCompat({ // to end up with the correct parser. export default [ { + // ignores: ['.nx/cache', 'coverage/**', 'dist/**', 'scrap/**'], + + // We want the root `eslint` config to handle everything outside + // of this folder, so we will ignore everything except `/app`. + // ignores: ['**/*', '!app/**/*/'], + ignores: ['.nx/cache', 'coverage/**', 'dist/**', 'scrap/**'], }, @@ -45,6 +55,18 @@ export default [ sourceType: 'module', }, + // Taken from: + // https://github.com/vuejs/vue-eslint-parser/issues/232 + /* + languageOptions: { + parser: vueParser, + parserOptions: { + parser: tsParser, + }, + ecmaVersion: 'latest', + }, + */ + rules: { 'no-console': 'warn', diff --git a/app/website/package.json b/app/website/package.json index 74d5309..512d54f 100644 --- a/app/website/package.json +++ b/app/website/package.json @@ -34,10 +34,12 @@ "@earwurm/types": "workspace:*", "@eslint/eslintrc": "^3.1.0", "@tsconfig/node20": "^20.1.4", + "@typescript-eslint/parser": "^7.12.0", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^13.0.0", "@vue/tsconfig": "^0.5.1", + "vue-eslint-parser": "^9.4.3", "eslint-plugin-vue": "^9.26.0", "lightningcss": "^1.25.1", "vite-plugin-svg-sprite": "^0.5.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a038d10..13f7f71 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -75,6 +75,9 @@ importers: '@tsconfig/node20': specifier: ^20.1.4 version: 20.1.4 + '@typescript-eslint/parser': + specifier: ^7.12.0 + version: 7.12.0(eslint@8.57.0)(typescript@5.4.5) '@vitejs/plugin-vue': specifier: ^5.0.4 version: 5.0.4(vite@5.2.12(@types/node@20.12.13)(lightningcss@1.25.1))(vue@3.4.27(typescript@5.4.5)) @@ -96,6 +99,9 @@ importers: vite-plugin-svg-sprite: specifier: ^0.5.2 version: 0.5.2(vite@5.2.12(@types/node@20.12.13)(lightningcss@1.25.1)) + vue-eslint-parser: + specifier: ^9.4.3 + version: 9.4.3(eslint@8.57.0) vue-tsc: specifier: ^2.0.19 version: 2.0.19(typescript@5.4.5) @@ -639,10 +645,24 @@ packages: typescript: optional: true + '@typescript-eslint/parser@7.12.0': + resolution: {integrity: sha512-dm/J2UDY3oV3TKius2OUZIFHsomQmpHtsV0FTh1WO8EKgHLQ1QCADUqscPgTpU+ih1e21FQSRjXckHn3txn6kQ==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + '@typescript-eslint/scope-manager@7.11.0': resolution: {integrity: sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/scope-manager@7.12.0': + resolution: {integrity: sha512-itF1pTnN6F3unPak+kutH9raIkL3lhH1YRPGgt7QQOh43DQKVJXmWkpb+vpc/TiDHs6RSd9CTbDsc/Y+Ygq7kg==} + engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/type-utils@7.11.0': resolution: {integrity: sha512-WmppUEgYy+y1NTseNMJ6mCFxt03/7jTOy08bcg7bxJJdsM4nuhnchyBbE8vryveaJUf62noH7LodPSo5Z0WUCg==} engines: {node: ^18.18.0 || >=20.0.0} @@ -657,6 +677,10 @@ packages: resolution: {integrity: sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/types@7.12.0': + resolution: {integrity: sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg==} + engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/typescript-estree@7.11.0': resolution: {integrity: sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ==} engines: {node: ^18.18.0 || >=20.0.0} @@ -666,6 +690,15 @@ packages: typescript: optional: true + '@typescript-eslint/typescript-estree@7.12.0': + resolution: {integrity: sha512-5bwqLsWBULv1h6pn7cMW5dXX/Y2amRqLaKqsASVwbBHMZSnHqE/HN4vT4fE0aFsiwxYvr98kqOWh1a8ZKXalCQ==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + '@typescript-eslint/utils@7.11.0': resolution: {integrity: sha512-xlAWwPleNRHwF37AhrZurOxA1wyXowW4PqVXZVUNCLjB48CqdPJoJWkrpH2nij9Q3Lb7rtWindtoXwxjxlKKCA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -676,6 +709,10 @@ packages: resolution: {integrity: sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/visitor-keys@7.12.0': + resolution: {integrity: sha512-uZk7DevrQLL3vSnfFl5bj4sL75qC9D6EdjemIdbtkuUmIheWpuiiylSY01JxJE7+zGrOWDZrp1WxOuDntvKrHQ==} + engines: {node: ^18.18.0 || >=20.0.0} + '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -3094,8 +3131,8 @@ packages: jsdom: optional: true - vue-eslint-parser@9.4.2: - resolution: {integrity: sha512-Ry9oiGmCAK91HrKMtCrKFWmSFWvYkpGglCeFAIqDdr9zdXmMMpJOmUJS7WWsW7fX81h6mwHmUZCQQ1E0PkSwYQ==} + vue-eslint-parser@9.4.3: + resolution: {integrity: sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' @@ -3778,6 +3815,24 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': + dependencies: + '@eslint-community/regexpp': 4.10.0 + '@typescript-eslint/parser': 7.12.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.11.0 + '@typescript-eslint/type-utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.11.0 + eslint: 8.57.0 + graphemer: 1.4.0 + ignore: 5.3.1 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.4.5) + optionalDependencies: + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/scope-manager': 7.11.0 @@ -3791,11 +3846,29 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5)': + dependencies: + '@typescript-eslint/scope-manager': 7.12.0 + '@typescript-eslint/types': 7.12.0 + '@typescript-eslint/typescript-estree': 7.12.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.12.0 + debug: 4.3.4 + eslint: 8.57.0 + optionalDependencies: + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/scope-manager@7.11.0': dependencies: '@typescript-eslint/types': 7.11.0 '@typescript-eslint/visitor-keys': 7.11.0 + '@typescript-eslint/scope-manager@7.12.0': + dependencies: + '@typescript-eslint/types': 7.12.0 + '@typescript-eslint/visitor-keys': 7.12.0 + '@typescript-eslint/type-utils@7.11.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5) @@ -3810,6 +3883,8 @@ snapshots: '@typescript-eslint/types@7.11.0': {} + '@typescript-eslint/types@7.12.0': {} + '@typescript-eslint/typescript-estree@7.11.0(typescript@5.4.5)': dependencies: '@typescript-eslint/types': 7.11.0 @@ -3825,6 +3900,21 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/typescript-estree@7.12.0(typescript@5.4.5)': + dependencies: + '@typescript-eslint/types': 7.12.0 + '@typescript-eslint/visitor-keys': 7.12.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.4 + semver: 7.6.2 + ts-api-utils: 1.3.0(typescript@5.4.5) + optionalDependencies: + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/utils@7.11.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) @@ -3841,6 +3931,11 @@ snapshots: '@typescript-eslint/types': 7.11.0 eslint-visitor-keys: 3.4.3 + '@typescript-eslint/visitor-keys@7.12.0': + dependencies: + '@typescript-eslint/types': 7.12.0 + eslint-visitor-keys: 3.4.3 + '@ungap/structured-clone@1.2.0': {} '@vitejs/plugin-vue@5.0.4(vite@5.2.12(@types/node@20.12.13)(lightningcss@1.25.1))(vue@3.4.27(typescript@5.4.5))': @@ -3974,11 +4069,11 @@ snapshots: '@vue/eslint-config-typescript@13.0.0(eslint-plugin-vue@9.26.0(eslint@8.57.0))(eslint@8.57.0)(typescript@5.4.5)': dependencies: - '@typescript-eslint/eslint-plugin': 7.11.0(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.11.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/eslint-plugin': 7.11.0(@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.12.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 eslint-plugin-vue: 9.26.0(eslint@8.57.0) - vue-eslint-parser: 9.4.2(eslint@8.57.0) + vue-eslint-parser: 9.4.3(eslint@8.57.0) optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: @@ -4751,7 +4846,7 @@ snapshots: nth-check: 2.1.1 postcss-selector-parser: 6.1.0 semver: 7.6.2 - vue-eslint-parser: 9.4.2(eslint@8.57.0) + vue-eslint-parser: 9.4.3(eslint@8.57.0) xml-name-validator: 4.0.0 transitivePeerDependencies: - supports-color @@ -6535,7 +6630,7 @@ snapshots: - supports-color - terser - vue-eslint-parser@9.4.2(eslint@8.57.0): + vue-eslint-parser@9.4.3(eslint@8.57.0): dependencies: debug: 4.3.4 eslint: 8.57.0