From c934d2a9ecc23f99a30e1241ab7e92c3a905c31d Mon Sep 17 00:00:00 2001 From: kimatata <117462761+kimatata@users.noreply.github.com> Date: Sun, 26 Oct 2025 19:35:21 +0900 Subject: [PATCH] chore: eslint tuning (#316) --- backend/routes/cases/clone.js | 2 ++ backend/routes/folders/clone.js | 2 ++ eslint.config.mjs | 16 +----------- .../[projectId]/members/MembersTable.tsx | 1 - package-lock.json | 26 ------------------- package.json | 2 -- 6 files changed, 5 insertions(+), 44 deletions(-) diff --git a/backend/routes/cases/clone.js b/backend/routes/cases/clone.js index 1dbc890..2c95e4e 100644 --- a/backend/routes/cases/clone.js +++ b/backend/routes/cases/clone.js @@ -37,6 +37,7 @@ export default function (sequelize) { const cases = caseRecords.map((c) => c.get({ plain: true })); const clonedCases = cases.map((c) => { + // eslint-disable-next-line no-unused-vars const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedCase } = c; return { ...clonedCase, folderId: targetFolderId }; }); @@ -47,6 +48,7 @@ export default function (sequelize) { if (c.Steps) { const clonedSteps = c.Steps.map((s) => { + // eslint-disable-next-line no-unused-vars const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedStep } = s; return clonedStep; }); diff --git a/backend/routes/folders/clone.js b/backend/routes/folders/clone.js index b9c4e38..db816e7 100644 --- a/backend/routes/folders/clone.js +++ b/backend/routes/folders/clone.js @@ -54,6 +54,7 @@ export default function (sequelize) { const cases = folderCases.map((c) => c.get({ plain: true })); const clonedCases = cases.map((c) => { + // eslint-disable-next-line no-unused-vars const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedCase } = c; return { ...clonedCase, folderId: targetFolderId }; }); @@ -63,6 +64,7 @@ export default function (sequelize) { if (c.Steps && c.Steps.length > 0) { const clonedSteps = c.Steps.map((s) => { + // eslint-disable-next-line no-unused-vars const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedStep } = s; return clonedStep; }); diff --git a/eslint.config.mjs b/eslint.config.mjs index 1be3b86..db2473c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -5,8 +5,6 @@ import eslintConfigPrettier from 'eslint-config-prettier'; import eslintPluginReact from 'eslint-plugin-react'; import eslintPluginReactHooks from 'eslint-plugin-react-hooks'; import * as eslintPluginImport from 'eslint-plugin-import'; -import eslintPluginUnusedImports from 'eslint-plugin-unused-imports'; -import eslintPluginOnlyWarn from 'eslint-plugin-only-warn'; import eslintPluginNext from '@next/eslint-plugin-next'; export default tseslint.config( @@ -25,11 +23,9 @@ export default tseslint.config( }, plugins: { import: eslintPluginImport, - 'unused-imports': eslintPluginUnusedImports, react: eslintPluginReact, 'react-hooks': eslintPluginReactHooks, '@next/next': eslintPluginNext, - 'only-warn': eslintPluginOnlyWarn, }, settings: { react: { @@ -46,16 +42,7 @@ export default tseslint.config( extends: [eslint.configs.recommended], rules: { 'import/order': 'error', - 'unused-imports/no-unused-imports': 'error', - 'unused-imports/no-unused-vars': [ - 'error', - { - vars: 'all', - varsIgnorePattern: '^_', - args: 'after-used', - argsIgnorePattern: '^_', - }, - ], + 'no-unused-vars': 'error', }, }, { @@ -67,7 +54,6 @@ export default tseslint.config( eslintPluginReact.configs.flat['jsx-runtime'], ], rules: { - '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-namespace': 'off', 'react/prop-types': 'off', ...eslintPluginReactHooks.configs.recommended.rules, diff --git a/frontend/src/app/[locale]/projects/[projectId]/members/MembersTable.tsx b/frontend/src/app/[locale]/projects/[projectId]/members/MembersTable.tsx index 19b95f9..9a7cacf 100644 --- a/frontend/src/app/[locale]/projects/[projectId]/members/MembersTable.tsx +++ b/frontend/src/app/[locale]/projects/[projectId]/members/MembersTable.tsx @@ -17,7 +17,6 @@ import { ChevronDown } from 'lucide-react'; import { MemberType, UserType } from '@/types/user'; import { memberRoles } from '@/config/selection'; import { MembersMessages } from '@/types/member'; -import Config from '@/config/config'; import UserAvatar from '@/components/UserAvatar'; type Props = { diff --git a/package-lock.json b/package-lock.json index 80bf588..5ecd736 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,9 +16,7 @@ "eslint-config-next": "^15.3.0", "eslint-config-prettier": "^10.1.2", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-only-warn": "^1.1.0", "eslint-plugin-react": "^7.37.5", - "eslint-plugin-unused-imports": "^4.1.4", "express": "^4.21.0", "globals": "^16.0.0", "prettier": "^3.3.3", @@ -3438,15 +3436,6 @@ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" } }, - "node_modules/eslint-plugin-only-warn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-only-warn/-/eslint-plugin-only-warn-1.1.0.tgz", - "integrity": "sha512-2tktqUAT+Q3hCAU0iSf4xAN1k9zOpjK5WO8104mB0rT/dGhOa09582HN5HlbxNbPRZ0THV7nLGvzugcNOSjzfA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/eslint-plugin-react": { "version": "7.37.5", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", @@ -3517,21 +3506,6 @@ "semver": "bin/semver.js" } }, - "node_modules/eslint-plugin-unused-imports": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.4.tgz", - "integrity": "sha512-YptD6IzQjDardkl0POxnnRBhU1OEePMV0nd6siHaRBbd+lyh6NAhFEobiznKU7kTsSsDeSD62Pe7kAM1b7dAZQ==", - "dev": true, - "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0", - "eslint": "^9.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "@typescript-eslint/eslint-plugin": { - "optional": true - } - } - }, "node_modules/eslint-scope": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", diff --git a/package.json b/package.json index f168b20..a8df1ae 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,7 @@ "eslint-config-next": "^15.3.0", "eslint-config-prettier": "^10.1.2", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-only-warn": "^1.1.0", "eslint-plugin-react": "^7.37.5", - "eslint-plugin-unused-imports": "^4.1.4", "express": "^4.21.0", "globals": "^16.0.0", "prettier": "^3.3.3",