From 1a9f2f84b334e336dba45ab08989ac072a4f7022 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Tue, 15 Oct 2024 21:41:36 -0400 Subject: [PATCH] fix linting and type checks in all packages --- packages/backend/package.json | 2 +- packages/backend/tsconfig.json | 1 + packages/frontend-embed/package.json | 2 +- packages/frontend-embed/tsconfig.json | 2 ++ packages/frontend-shared/package.json | 2 +- packages/frontend-shared/tsconfig.json | 1 + packages/frontend/package.json | 2 +- packages/frontend/tsconfig.json | 2 ++ packages/megalodon/tsconfig.json | 1 + packages/misskey-bubble-game/package.json | 2 +- packages/misskey-bubble-game/tsconfig.json | 1 + packages/misskey-js/package.json | 2 +- packages/misskey-js/tsconfig.json | 1 + packages/misskey-reversi/package.json | 2 +- packages/misskey-reversi/tsconfig.json | 1 + packages/sw/package.json | 2 +- packages/sw/tsconfig.json | 4 ++++ 17 files changed, 22 insertions(+), 8 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index ae43af32a5..e80d8e4d41 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -20,7 +20,7 @@ "restart": "pnpm build && pnpm start", "dev": "node ./scripts/dev.mjs", "typecheck": "pnpm --filter megalodon build && tsc --noEmit && tsc -p test --noEmit", - "eslint": "eslint --quiet \"src/**/*.ts\" --cache", + "eslint": "eslint --quiet \"{src,test,js,@types}/**/*.{js,jsx,ts,tsx,vue}\" --cache", "lint": "pnpm typecheck && pnpm eslint", "jest": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --forceExit --config jest.config.unit.cjs", "jest:e2e": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --forceExit --config jest.config.e2e.cjs", diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index 2b15a5cc7a..392da169ad 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -46,6 +46,7 @@ "./src/**/*.ts" ], "exclude": [ + "node_modules", "./src/**/*.test.ts" ] } diff --git a/packages/frontend-embed/package.json b/packages/frontend-embed/package.json index 7c515787a9..021a63068a 100644 --- a/packages/frontend-embed/package.json +++ b/packages/frontend-embed/package.json @@ -7,7 +7,7 @@ "dev": "vite --config vite.config.local-dev.ts --debug hmr", "build": "vite build", "typecheck": "vue-tsc --noEmit", - "eslint": "eslint --quiet \"src/**/*.{ts,vue}\"", + "eslint": "eslint --quiet \"{src,test,js,@types}/**/*.{js,jsx,ts,tsx,vue}\" --cache", "lint": "pnpm typecheck && pnpm eslint" }, "dependencies": { diff --git a/packages/frontend-embed/tsconfig.json b/packages/frontend-embed/tsconfig.json index 3701343623..c90e0dd472 100644 --- a/packages/frontend-embed/tsconfig.json +++ b/packages/frontend-embed/tsconfig.json @@ -21,6 +21,7 @@ "allowSyntheticDefaultImports": true, "isolatedModules": true, "useDefineForClassFields": true, + "skipLibCheck": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"], @@ -48,6 +49,7 @@ "./**/*.vue" ], "exclude": [ + "node_modules", ".storybook/**/*" ] } diff --git a/packages/frontend-shared/package.json b/packages/frontend-shared/package.json index 9981d10dd2..82fa62cb32 100644 --- a/packages/frontend-shared/package.json +++ b/packages/frontend-shared/package.json @@ -16,7 +16,7 @@ "scripts": { "build": "node ./build.js", "watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"", - "eslint": "eslint './**/*.{js,jsx,ts,tsx}'", + "eslint": "eslint --quiet \"{src,test,js,@types}/**/*.{js,jsx,ts,tsx,vue}\" --cache", "typecheck": "tsc --noEmit", "lint": "pnpm typecheck && pnpm eslint" }, diff --git a/packages/frontend-shared/tsconfig.json b/packages/frontend-shared/tsconfig.json index 09a8ff76aa..48228d4e48 100644 --- a/packages/frontend-shared/tsconfig.json +++ b/packages/frontend-shared/tsconfig.json @@ -16,6 +16,7 @@ "experimentalDecorators": true, "noImplicitReturns": true, "esModuleInterop": true, + "skipLibCheck": true, "baseUrl": ".", "paths": { "@/*": ["./*"], diff --git a/packages/frontend/package.json b/packages/frontend/package.json index c7789e6159..7f4e70f744 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -13,7 +13,7 @@ "test": "vitest --run --globals", "test-and-coverage": "vitest --run --coverage --globals", "typecheck": "vue-tsc --noEmit", - "eslint": "eslint --quiet \"src/**/*.{ts,vue}\" --cache", + "eslint": "eslint --quiet \"{src,test,js,@types}/**/*.{js,jsx,ts,tsx,vue}\" --cache", "lint": "pnpm typecheck && pnpm eslint" }, "dependencies": { diff --git a/packages/frontend/tsconfig.json b/packages/frontend/tsconfig.json index b88773b598..997e1378db 100644 --- a/packages/frontend/tsconfig.json +++ b/packages/frontend/tsconfig.json @@ -21,6 +21,7 @@ "allowSyntheticDefaultImports": true, "isolatedModules": true, "useDefineForClassFields": true, + "skipLibCheck": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"], @@ -49,6 +50,7 @@ "./**/*.vue" ], "exclude": [ + "node_modules", ".storybook/**/*" ] } diff --git a/packages/megalodon/tsconfig.json b/packages/megalodon/tsconfig.json index b2b4a984b1..6327d7c31d 100644 --- a/packages/megalodon/tsconfig.json +++ b/packages/megalodon/tsconfig.json @@ -34,6 +34,7 @@ "noUnusedParameters": true, /* Report errors on unused parameters. */ "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + "skipLibCheck": true, /* Module Resolution Options */ "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ diff --git a/packages/misskey-bubble-game/package.json b/packages/misskey-bubble-game/package.json index acd6ab9dd2..2b280f17fc 100644 --- a/packages/misskey-bubble-game/package.json +++ b/packages/misskey-bubble-game/package.json @@ -17,7 +17,7 @@ "scripts": { "build": "node ./build.js", "watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"", - "eslint": "eslint './**/*.{js,jsx,ts,tsx}' --cache", + "eslint": "eslint --quiet \"{src,test,js,@types}/**/*.{js,jsx,ts,tsx,vue}\" --cache", "typecheck": "tsc --noEmit", "lint": "pnpm typecheck && pnpm eslint" }, diff --git a/packages/misskey-bubble-game/tsconfig.json b/packages/misskey-bubble-game/tsconfig.json index 6e34e332e0..f467951ef6 100644 --- a/packages/misskey-bubble-game/tsconfig.json +++ b/packages/misskey-bubble-game/tsconfig.json @@ -15,6 +15,7 @@ "experimentalDecorators": true, "noImplicitReturns": true, "esModuleInterop": true, + "skipLibCheck": true, "typeRoots": [ "./node_modules/@types" ], diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index 0c9ef0bece..9ea493bae1 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -22,7 +22,7 @@ "tsd": "tsd", "api": "pnpm api-extractor run --local --verbose", "api-prod": "pnpm api-extractor run --verbose", - "eslint": "eslint './**/*.{js,jsx,ts,tsx}' --cache", + "eslint": "eslint --quiet \"{src,test,js,@types}/**/*.{js,jsx,ts,tsx,vue}\" --cache", "typecheck": "tsc --noEmit", "lint": "pnpm typecheck && pnpm eslint", "jest": "jest --coverage --detectOpenHandles", diff --git a/packages/misskey-js/tsconfig.json b/packages/misskey-js/tsconfig.json index f7bbc47304..95128b8fab 100644 --- a/packages/misskey-js/tsconfig.json +++ b/packages/misskey-js/tsconfig.json @@ -16,6 +16,7 @@ "noImplicitReturns": true, "esModuleInterop": true, "exactOptionalPropertyTypes": true, + "skipLibCheck": true, "typeRoots": [ "./node_modules/@types" ], diff --git a/packages/misskey-reversi/package.json b/packages/misskey-reversi/package.json index f32b31d4d9..6386f40118 100644 --- a/packages/misskey-reversi/package.json +++ b/packages/misskey-reversi/package.json @@ -17,7 +17,7 @@ "scripts": { "build": "node ./build.js", "watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"", - "eslint": "eslint './**/*.{js,jsx,ts,tsx}' --cache", + "eslint": "eslint --quiet \"{src,test,js,@types}/**/*.{js,jsx,ts,tsx,vue}\" --cache", "typecheck": "tsc --noEmit", "lint": "pnpm typecheck && pnpm eslint" }, diff --git a/packages/misskey-reversi/tsconfig.json b/packages/misskey-reversi/tsconfig.json index 6e34e332e0..f467951ef6 100644 --- a/packages/misskey-reversi/tsconfig.json +++ b/packages/misskey-reversi/tsconfig.json @@ -15,6 +15,7 @@ "experimentalDecorators": true, "noImplicitReturns": true, "esModuleInterop": true, + "skipLibCheck": true, "typeRoots": [ "./node_modules/@types" ], diff --git a/packages/sw/package.json b/packages/sw/package.json index a788c52879..ed63a02662 100644 --- a/packages/sw/package.json +++ b/packages/sw/package.json @@ -5,7 +5,7 @@ "watch": "nodemon -w ../../package.json -e json --exec \"node build.js watch\"", "build": "node build.js", "typecheck": "tsc --noEmit", - "eslint": "eslint --quiet src/**/*.ts --cache", + "eslint": "eslint --quiet \"{src,test,js,@types}/**/*.{js,jsx,ts,tsx,vue}\" --cache", "lint": "pnpm typecheck && pnpm eslint" }, "dependencies": { diff --git a/packages/sw/tsconfig.json b/packages/sw/tsconfig.json index 2712475a37..112a932e58 100644 --- a/packages/sw/tsconfig.json +++ b/packages/sw/tsconfig.json @@ -19,6 +19,7 @@ "experimentalDecorators": true, "resolveJsonModule": true, "isolatedModules": true, + "skipLibCheck": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"], @@ -36,5 +37,8 @@ "compileOnSave": false, "include": [ "./**/*.ts" + ], + "exclude": [ + "node_modules" ] }