chore: eslint tuning (#316)

This commit is contained in:
kimatata
2025-10-26 19:35:21 +09:00
committed by GitHub
parent 7922996845
commit c934d2a9ec
6 changed files with 5 additions and 44 deletions

View File

@@ -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;
});

View File

@@ -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;
});

View File

@@ -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,

View File

@@ -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 = {

26
package-lock.json generated
View File

@@ -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",

View File

@@ -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",