chore: eslint tuning (#316)
This commit is contained in:
@@ -37,6 +37,7 @@ export default function (sequelize) {
|
|||||||
const cases = caseRecords.map((c) => c.get({ plain: true }));
|
const cases = caseRecords.map((c) => c.get({ plain: true }));
|
||||||
|
|
||||||
const clonedCases = cases.map((c) => {
|
const clonedCases = cases.map((c) => {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedCase } = c;
|
const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedCase } = c;
|
||||||
return { ...clonedCase, folderId: targetFolderId };
|
return { ...clonedCase, folderId: targetFolderId };
|
||||||
});
|
});
|
||||||
@@ -47,6 +48,7 @@ export default function (sequelize) {
|
|||||||
|
|
||||||
if (c.Steps) {
|
if (c.Steps) {
|
||||||
const clonedSteps = c.Steps.map((s) => {
|
const clonedSteps = c.Steps.map((s) => {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedStep } = s;
|
const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedStep } = s;
|
||||||
return clonedStep;
|
return clonedStep;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ export default function (sequelize) {
|
|||||||
const cases = folderCases.map((c) => c.get({ plain: true }));
|
const cases = folderCases.map((c) => c.get({ plain: true }));
|
||||||
|
|
||||||
const clonedCases = cases.map((c) => {
|
const clonedCases = cases.map((c) => {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedCase } = c;
|
const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedCase } = c;
|
||||||
return { ...clonedCase, folderId: targetFolderId };
|
return { ...clonedCase, folderId: targetFolderId };
|
||||||
});
|
});
|
||||||
@@ -63,6 +64,7 @@ export default function (sequelize) {
|
|||||||
|
|
||||||
if (c.Steps && c.Steps.length > 0) {
|
if (c.Steps && c.Steps.length > 0) {
|
||||||
const clonedSteps = c.Steps.map((s) => {
|
const clonedSteps = c.Steps.map((s) => {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedStep } = s;
|
const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...clonedStep } = s;
|
||||||
return clonedStep;
|
return clonedStep;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import eslintConfigPrettier from 'eslint-config-prettier';
|
|||||||
import eslintPluginReact from 'eslint-plugin-react';
|
import eslintPluginReact from 'eslint-plugin-react';
|
||||||
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
|
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
|
||||||
import * as eslintPluginImport from 'eslint-plugin-import';
|
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';
|
import eslintPluginNext from '@next/eslint-plugin-next';
|
||||||
|
|
||||||
export default tseslint.config(
|
export default tseslint.config(
|
||||||
@@ -25,11 +23,9 @@ export default tseslint.config(
|
|||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
import: eslintPluginImport,
|
import: eslintPluginImport,
|
||||||
'unused-imports': eslintPluginUnusedImports,
|
|
||||||
react: eslintPluginReact,
|
react: eslintPluginReact,
|
||||||
'react-hooks': eslintPluginReactHooks,
|
'react-hooks': eslintPluginReactHooks,
|
||||||
'@next/next': eslintPluginNext,
|
'@next/next': eslintPluginNext,
|
||||||
'only-warn': eslintPluginOnlyWarn,
|
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
react: {
|
react: {
|
||||||
@@ -46,16 +42,7 @@ export default tseslint.config(
|
|||||||
extends: [eslint.configs.recommended],
|
extends: [eslint.configs.recommended],
|
||||||
rules: {
|
rules: {
|
||||||
'import/order': 'error',
|
'import/order': 'error',
|
||||||
'unused-imports/no-unused-imports': 'error',
|
'no-unused-vars': 'error',
|
||||||
'unused-imports/no-unused-vars': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
vars: 'all',
|
|
||||||
varsIgnorePattern: '^_',
|
|
||||||
args: 'after-used',
|
|
||||||
argsIgnorePattern: '^_',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -67,7 +54,6 @@ export default tseslint.config(
|
|||||||
eslintPluginReact.configs.flat['jsx-runtime'],
|
eslintPluginReact.configs.flat['jsx-runtime'],
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
'@typescript-eslint/no-unused-vars': 'off',
|
|
||||||
'@typescript-eslint/no-namespace': 'off',
|
'@typescript-eslint/no-namespace': 'off',
|
||||||
'react/prop-types': 'off',
|
'react/prop-types': 'off',
|
||||||
...eslintPluginReactHooks.configs.recommended.rules,
|
...eslintPluginReactHooks.configs.recommended.rules,
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import { ChevronDown } from 'lucide-react';
|
|||||||
import { MemberType, UserType } from '@/types/user';
|
import { MemberType, UserType } from '@/types/user';
|
||||||
import { memberRoles } from '@/config/selection';
|
import { memberRoles } from '@/config/selection';
|
||||||
import { MembersMessages } from '@/types/member';
|
import { MembersMessages } from '@/types/member';
|
||||||
import Config from '@/config/config';
|
|
||||||
import UserAvatar from '@/components/UserAvatar';
|
import UserAvatar from '@/components/UserAvatar';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|||||||
26
package-lock.json
generated
26
package-lock.json
generated
@@ -16,9 +16,7 @@
|
|||||||
"eslint-config-next": "^15.3.0",
|
"eslint-config-next": "^15.3.0",
|
||||||
"eslint-config-prettier": "^10.1.2",
|
"eslint-config-prettier": "^10.1.2",
|
||||||
"eslint-plugin-import": "^2.31.0",
|
"eslint-plugin-import": "^2.31.0",
|
||||||
"eslint-plugin-only-warn": "^1.1.0",
|
|
||||||
"eslint-plugin-react": "^7.37.5",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
"eslint-plugin-unused-imports": "^4.1.4",
|
|
||||||
"express": "^4.21.0",
|
"express": "^4.21.0",
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.0.0",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
@@ -3438,15 +3436,6 @@
|
|||||||
"eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9"
|
"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": {
|
"node_modules/eslint-plugin-react": {
|
||||||
"version": "7.37.5",
|
"version": "7.37.5",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz",
|
||||||
@@ -3517,21 +3506,6 @@
|
|||||||
"semver": "bin/semver.js"
|
"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": {
|
"node_modules/eslint-scope": {
|
||||||
"version": "8.3.0",
|
"version": "8.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz",
|
||||||
|
|||||||
@@ -22,9 +22,7 @@
|
|||||||
"eslint-config-next": "^15.3.0",
|
"eslint-config-next": "^15.3.0",
|
||||||
"eslint-config-prettier": "^10.1.2",
|
"eslint-config-prettier": "^10.1.2",
|
||||||
"eslint-plugin-import": "^2.31.0",
|
"eslint-plugin-import": "^2.31.0",
|
||||||
"eslint-plugin-only-warn": "^1.1.0",
|
|
||||||
"eslint-plugin-react": "^7.37.5",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
"eslint-plugin-unused-imports": "^4.1.4",
|
|
||||||
"express": "^4.21.0",
|
"express": "^4.21.0",
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.0.0",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user