From 406e9211f19ba67db5c792bd0a993e96abdb81f6 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Thu, 31 Oct 2024 11:09:24 -0500 Subject: refactor: Update eslint configuration Signed-off-by: Matt Strapp --- package.json | 4 +- pnpm-lock.yaml | 83 +++++++--------------- .../eslint-config/eslint.library.config.js | 14 ++-- src/packages/locusts/eslint.config.mjs | 7 +- src/packages/locusts/package.json | 4 +- src/packages/svelte/package.json | 5 +- turbo.json | 5 ++ 7 files changed, 47 insertions(+), 75 deletions(-) diff --git a/package.json b/package.json index 1159828..848867e 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,7 @@ "@changesets/cli": "^2.27.9", "prettier": "^3.3.2", "syncpack": "13.0.0", - "turbo": "^2.2.3", - "typescript": "^5.6.3" + "turbo": "^2.2.3" }, "engines": { "node": ">=18" @@ -15,6 +14,7 @@ "private": true, "scripts": { "build": "turbo build", + "clean": "turbo clean && rm -rf node_modules", "dev": "turbo dev", "format": "turbo format && prettier --write \"**/*.md\"", "lint": "turbo lint", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a254140..a4fbade 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,9 +20,6 @@ importers: turbo: specifier: ^2.2.3 version: 2.2.3 - typescript: - specifier: ^5.6.3 - version: 5.6.3 src/packages/eslint-config: devDependencies: @@ -31,7 +28,7 @@ importers: version: 9.6.1 '@typescript-eslint/eslint-plugin': specifier: 8.12.2 - version: 8.12.2(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3) + version: 8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3) '@vercel/style-guide': specifier: 6.0.0 version: 6.0.0(eslint@9.13.0)(prettier@3.3.3)(typescript@5.6.3)(vitest@2.1.4(@types/node@22.8.4)) @@ -59,12 +56,6 @@ importers: src/packages/locusts: devDependencies: - '@eslint/eslintrc': - specifier: ^3.1.0 - version: 3.1.0 - '@eslint/js': - specifier: ^9.13.0 - version: 9.13.0 '@repo/eslint-config': specifier: workspace:* version: link:../eslint-config @@ -110,24 +101,12 @@ importers: '@sveltejs/vite-plugin-svelte': specifier: ^4.0.0 version: 4.0.0(svelte@5.1.6)(vite@5.4.10(@types/node@22.8.4)) - '@types/eslint': - specifier: ^9.6.0 - version: 9.6.1 - eslint: - specifier: ^9.7.0 - version: 9.13.0 eslint-config-prettier: specifier: ^9.1.0 version: 9.1.0(eslint@9.13.0) eslint-plugin-svelte: specifier: ^2.36.0 version: 2.46.0(eslint@9.13.0)(svelte@5.1.6) - globals: - specifier: ^15.0.0 - version: 15.11.0 - prettier: - specifier: ^3.3.2 - version: 3.3.3 prettier-plugin-svelte: specifier: ^3.2.6 version: 3.2.7(prettier@3.3.3)(svelte@5.1.6) @@ -4286,24 +4265,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3)': - dependencies: - '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 7.18.0(eslint@9.13.0)(typescript@5.6.3) - '@typescript-eslint/scope-manager': 8.12.2 - '@typescript-eslint/type-utils': 8.12.2(eslint@9.13.0)(typescript@5.6.3) - '@typescript-eslint/utils': 8.12.2(eslint@9.13.0)(typescript@5.6.3) - '@typescript-eslint/visitor-keys': 8.12.2 - eslint: 9.13.0 - graphemer: 1.4.0 - ignore: 5.3.2 - natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.6.3) - optionalDependencies: - typescript: 5.6.3 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3)': dependencies: '@eslint-community/regexpp': 4.12.1 @@ -4497,11 +4458,11 @@ snapshots: '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3) '@typescript-eslint/parser': 7.18.0(eslint@9.13.0)(typescript@5.6.3) eslint-config-prettier: 9.1.0(eslint@9.13.0) - eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.30.0) - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0)(eslint@9.13.0) + eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0))(eslint@9.13.0)) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0) eslint-plugin-eslint-comments: 3.2.0(eslint@9.13.0) - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0) - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0))(eslint@9.13.0) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3) eslint-plugin-jsx-a11y: 6.10.0(eslint@9.13.0) eslint-plugin-playwright: 1.6.2(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0) eslint-plugin-react: 7.35.2(eslint@9.13.0) @@ -5159,9 +5120,9 @@ snapshots: eslint: 9.13.0 eslint-plugin-turbo: 2.2.3(eslint@9.13.0) - eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.30.0): + eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0))(eslint@9.13.0)): dependencies: - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0))(eslint@9.13.0) eslint-import-resolver-node@0.3.9: dependencies: @@ -5171,33 +5132,43 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0)(eslint@9.13.0): + eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.3.7 enhanced-resolve: 5.17.1 eslint: 9.13.0 - eslint-module-utils: 2.11.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0) + eslint-module-utils: 2.11.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0))(eslint@9.13.0) fast-glob: 3.3.2 get-tsconfig: 4.8.0 is-bun-module: 1.2.1 is-glob: 4.0.3 optionalDependencies: - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0))(eslint@9.13.0) transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.11.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0): + eslint-module-utils@2.11.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0))(eslint@9.13.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 7.18.0(eslint@9.13.0)(typescript@5.6.3) eslint: 9.13.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0)(eslint@9.13.0) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0) + transitivePeerDependencies: + - supports-color + + eslint-module-utils@2.11.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0))(eslint@9.13.0): + dependencies: + debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 7.18.0(eslint@9.13.0)(typescript@5.6.3) + eslint: 9.13.0 + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0) transitivePeerDependencies: - supports-color @@ -5207,7 +5178,7 @@ snapshots: eslint: 9.13.0 ignore: 5.3.2 - eslint-plugin-import@2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0): + eslint-plugin-import@2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0))(eslint@9.13.0): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -5218,7 +5189,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.13.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.11.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0) + eslint-module-utils: 2.11.0(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0))(eslint@9.13.0))(eslint@9.13.0) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -5235,12 +5206,12 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3): + eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3): dependencies: '@typescript-eslint/utils': 5.62.0(eslint@9.13.0)(typescript@5.6.3) eslint: 9.13.0 optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.12.2(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3) + '@typescript-eslint/eslint-plugin': 8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3) transitivePeerDependencies: - supports-color - typescript @@ -5272,7 +5243,7 @@ snapshots: eslint: 9.13.0 globals: 13.24.0 optionalDependencies: - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@7.18.0(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3))(eslint@9.13.0)(typescript@5.6.3) eslint-plugin-react-hooks@4.6.2(eslint@9.13.0): dependencies: diff --git a/src/packages/eslint-config/eslint.library.config.js b/src/packages/eslint-config/eslint.library.config.js index e3c7866..8154244 100644 --- a/src/packages/eslint-config/eslint.library.config.js +++ b/src/packages/eslint-config/eslint.library.config.js @@ -6,14 +6,9 @@ import ts from "typescript-eslint"; import prettier from "eslint-config-prettier"; import turboPlugin from "eslint-plugin-turbo"; -import { resolve } from "node:path"; - -const project = resolve(process.cwd(), "tsconfig.json"); - export default ts.config( eslint.configs.recommended, ...ts.configs.recommended, - prettier, { name: "eslint-config-turbo (recreated flat)", plugins: { @@ -26,14 +21,15 @@ export default ts.config( { name: "library", languageOptions: { - // parserOptions: { - // project: resolve(process.cwd(), "tsconfig.json") - // }, globals: { ...globals.browser, ...globals.node, + React: true, + JSX: true, + Svelte: true }, }, - ignores: ["build/", ".svelte-kit/", "dist/"], + ignores: ["**/build/", "**/.svelte-kit/", "**/dist/"], }, + prettier, ); diff --git a/src/packages/locusts/eslint.config.mjs b/src/packages/locusts/eslint.config.mjs index 1946c04..eab1d3a 100644 --- a/src/packages/locusts/eslint.config.mjs +++ b/src/packages/locusts/eslint.config.mjs @@ -2,4 +2,9 @@ import library from "@repo/eslint-config/eslint.library.config.js"; /** @type {import("eslint").Linter.Config[]} */ -export default [...library]; +export default [ + ...library, + { + ignores: ["dist/"], + }, +]; diff --git a/src/packages/locusts/package.json b/src/packages/locusts/package.json index 93bce80..4128954 100644 --- a/src/packages/locusts/package.json +++ b/src/packages/locusts/package.json @@ -5,13 +5,10 @@ "author": "Matt Strapp (https://mattstrapp.net)", "bugs": "https://github.com/locusts-r-us/locusts/issues", "devDependencies": { - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "^9.13.0", "@repo/eslint-config": "workspace:*", "@repo/typescript-config": "workspace:*", "@types/node": "^22.8.4", "globals": "^15.0.0", - "prettier": "^3.3.2", "publint": "^0.2.0", "tsup": "^8.3.5", "tsx": "^4.19.2", @@ -34,6 +31,7 @@ }, "scripts": { "build": "tsup src/index.ts --format cjs,esm --dts && publint", + "clean": "rm -rf dist && rm -rf node_modules", "dev": "tsup src/index.ts --format cjs,esm --dts --watch", "lint": "prettier --check . && eslint .", "format": "prettier --write . && eslint --fix .", diff --git a/src/packages/svelte/package.json b/src/packages/svelte/package.json index 713a633..ac054c3 100644 --- a/src/packages/svelte/package.json +++ b/src/packages/svelte/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "vite dev", "build": "vite build && npm run package", + "clean": "rm -rf dist && rm -rf node_modules", "preview": "vite preview", "package": "svelte-kit sync && svelte-package && publint", "prepublishOnly": "npm run package", @@ -56,12 +57,8 @@ "@sveltejs/kit": "^2.0.0", "@sveltejs/package": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^4.0.0", - "@types/eslint": "^9.6.0", - "eslint": "^9.7.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.36.0", - "globals": "^15.0.0", - "prettier": "^3.3.2", "prettier-plugin-svelte": "^3.2.6", "publint": "^0.2.0", "svelte": "^5.0.0", diff --git a/turbo.json b/turbo.json index 75b7694..e97e08d 100644 --- a/turbo.json +++ b/turbo.json @@ -14,6 +14,11 @@ "dist/**" ] }, + "clean": { + "dependsOn": [ + "^clean" + ] + }, "format": { "dependsOn": [ "^format" -- cgit v1.2.3