Eslint prevent duplicate import (#2516)

- eslint: prevent duplicate import
This commit is contained in:
brendanlaschke
2023-11-16 12:26:43 +01:00
committed by GitHub
parent bee986749d
commit e5caa7a5df
10 changed files with 18 additions and 17 deletions

View File

@ -11,6 +11,7 @@ module.exports = {
'unused-imports', 'unused-imports',
'simple-import-sort', 'simple-import-sort',
'prefer-arrow', 'prefer-arrow',
'import',
'twenty', 'twenty',
], ],
extends: [ extends: [
@ -42,6 +43,7 @@ module.exports = {
'react/jsx-uses-react': 'off', 'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off', 'react/react-in-jsx-scope': 'off',
'no-control-regex': 0, 'no-control-regex': 0,
'import/no-duplicates': ["error", {"considerQueryString": true}],
'simple-import-sort/imports': [ 'simple-import-sort/imports': [
'error', 'error',
{ {

View File

@ -1,5 +1,4 @@
import { expect } from '@storybook/jest'; import { expect, jest } from '@storybook/jest';
import { jest } from '@storybook/jest';
import { Decorator, Meta, StoryObj } from '@storybook/react'; import { Decorator, Meta, StoryObj } from '@storybook/react';
import { userEvent, within } from '@storybook/testing-library'; import { userEvent, within } from '@storybook/testing-library';

View File

@ -13,8 +13,7 @@ import { useSpreadsheetImportInternal } from '@/spreadsheet-import/hooks/useSpre
import { Fields } from '@/spreadsheet-import/types'; import { Fields } from '@/spreadsheet-import/types';
import { IconChevronDown, IconForbid } from '@/ui/display/icon'; import { IconChevronDown, IconForbid } from '@/ui/display/icon';
import { Column, Columns } from '../MatchColumnsStep'; import { Column, Columns, ColumnType } from '../MatchColumnsStep';
import { ColumnType } from '../MatchColumnsStep';
import { SubMatchingSelect } from './SubMatchingSelect'; import { SubMatchingSelect } from './SubMatchingSelect';

View File

@ -1,5 +1,4 @@
import { expect } from '@storybook/jest'; import { expect, jest } from '@storybook/jest';
import { jest } from '@storybook/jest';
import { Meta, StoryObj } from '@storybook/react'; import { Meta, StoryObj } from '@storybook/react';
import { userEvent, within } from '@storybook/testing-library'; import { userEvent, within } from '@storybook/testing-library';

View File

@ -1,5 +1,4 @@
import { expect } from '@storybook/jest'; import { expect, jest } from '@storybook/jest';
import { jest } from '@storybook/jest';
import { Meta, StoryObj } from '@storybook/react'; import { Meta, StoryObj } from '@storybook/react';
import { userEvent, within } from '@storybook/testing-library'; import { userEvent, within } from '@storybook/testing-library';

View File

@ -1,5 +1,4 @@
import { expect } from '@storybook/jest'; import { expect, jest } from '@storybook/jest';
import { jest } from '@storybook/jest';
import { Meta, StoryObj } from '@storybook/react'; import { Meta, StoryObj } from '@storybook/react';
import { userEvent, within } from '@storybook/testing-library'; import { userEvent, within } from '@storybook/testing-library';

View File

@ -1,6 +1,5 @@
import { useEffect } from 'react'; import { useEffect } from 'react';
import { jest } from '@storybook/jest'; import { expect, jest } from '@storybook/jest';
import { expect } from '@storybook/jest';
import { Meta, StoryObj } from '@storybook/react'; import { Meta, StoryObj } from '@storybook/react';
import { userEvent, within } from '@storybook/testing-library'; import { userEvent, within } from '@storybook/testing-library';

View File

@ -1,6 +1,5 @@
import { useEffect } from 'react'; import { useEffect } from 'react';
import { expect } from '@storybook/jest'; import { expect, jest } from '@storybook/jest';
import { jest } from '@storybook/jest';
import { Meta, StoryObj } from '@storybook/react'; import { Meta, StoryObj } from '@storybook/react';
import { userEvent, within } from '@storybook/testing-library'; import { userEvent, within } from '@storybook/testing-library';

View File

@ -74,6 +74,7 @@ module.exports = {
pathGroupsExcludedImportTypes: ['@nestjs/**'], pathGroupsExcludedImportTypes: ['@nestjs/**'],
}, },
], ],
'import/no-duplicates': ["error", {"considerQueryString": true}],
'unused-imports/no-unused-imports': 'warn', 'unused-imports/no-unused-imports': 'warn',
"@typescript-eslint/consistent-type-imports": ["error", { "prefer": "no-type-imports" }], "@typescript-eslint/consistent-type-imports": ["error", { "prefer": "no-type-imports" }],
}, },

View File

@ -1,7 +1,12 @@
import { Resolver, Query, Args, Mutation } from '@nestjs/graphql'; import {
Resolver,
Query,
Args,
Mutation,
InputType,
Field,
} from '@nestjs/graphql';
import { UseGuards } from '@nestjs/common'; import { UseGuards } from '@nestjs/common';
import { InputType } from '@nestjs/graphql';
import { Field } from '@nestjs/graphql';
import { Prisma, Workspace } from '@prisma/client'; import { Prisma, Workspace } from '@prisma/client';