Skip to content

chore: enable import/consistent-type-specifier-style internally #8527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ export default tseslint.config(
//
// eslint-plugin-import
//

// enforces consistent type specifier style for named imports
'import/consistent-type-specifier-style': 'error',
// disallow non-import statements appearing before import statements
'import/first': 'error',
// Require a newline after the last import/require in a group
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-plugin/src/rules/ban-ts-comment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AST_TOKEN_TYPES, type TSESLint } from '@typescript-eslint/utils';
import type { TSESLint } from '@typescript-eslint/utils';
import { AST_TOKEN_TYPES } from '@typescript-eslint/utils';

import { createRule, getStringLength } from '../util';

Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-plugin/src/rules/max-params.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AST_NODE_TYPES, type TSESTree } from '@typescript-eslint/utils';
import type { TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';

import type {
InferMessageIdsTypeFromRule,
Expand Down
3 changes: 2 additions & 1 deletion packages/scope-manager/src/referencer/TypeVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type { TSESTree } from '@typescript-eslint/types';
import { AST_NODE_TYPES } from '@typescript-eslint/types';

import { ParameterDefinition, TypeDefinition } from '../definition';
import { type Scope, ScopeType } from '../scope';
import type { Scope } from '../scope';
import { ScopeType } from '../scope';
import type { Referencer } from './Referencer';
import { Visitor } from './Visitor';

Expand Down
6 changes: 2 additions & 4 deletions packages/type-utils/tests/isTypeReadonly.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import type { TSESTree } from '@typescript-eslint/utils';
import path from 'path';
import type * as ts from 'typescript';

import {
isTypeReadonly,
type ReadonlynessOptions,
} from '../src/isTypeReadonly';
import type { ReadonlynessOptions } from '../src/isTypeReadonly';
import { isTypeReadonly } from '../src/isTypeReadonly';
import { expectToHaveParserServices } from './test-utils/expectToHaveParserServices';

describe('isTypeReadonly', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { minimatch } from 'minimatch';

import { createProjectProgram } from './create-program/createProjectProgram';
import type { ProjectServiceSettings } from './create-program/createProjectService';
import type { ASTAndDefiniteProgram } from './create-program/shared';
import {
type ASTAndDefiniteProgram,
ensureAbsolutePath,
getCanonicalFileName,
} from './create-program/shared';
Expand Down
8 changes: 2 additions & 6 deletions packages/website/src/components/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
import { useWindowSize } from '@docusaurus/theme-common';
import clsx from 'clsx';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import {
type ImperativePanelHandle,
Panel,
PanelGroup,
PanelResizeHandle,
} from 'react-resizable-panels';
import type { ImperativePanelHandle } from 'react-resizable-panels';
import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels';

import ASTViewer from './ast/ASTViewer';
import ConfigEslint from './config/ConfigEslint';
Expand Down
6 changes: 2 additions & 4 deletions packages/website/src/components/RulesTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import { useRulesMeta } from '@site/src/hooks/useRulesMeta';
import clsx from 'clsx';
import React, { useMemo } from 'react';

import {
type HistorySelector,
useHistorySelector,
} from '../../hooks/useHistorySelector';
import type { HistorySelector } from '../../hooks/useHistorySelector';
import { useHistorySelector } from '../../hooks/useHistorySelector';
import {
CONFIG_EMOJI,
DEPRECATED_RULE_EMOJI,
Expand Down
3 changes: 2 additions & 1 deletion packages/website/src/components/editor/useSandboxServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import rootPackageJson from '../../../../../package.json';
import type { createTypeScriptSandbox } from '../../vendor/sandbox';
import { createCompilerOptions } from '../lib/createCompilerOptions';
import { createFileSystem } from '../linter/bridge';
import { type CreateLinter, createLinter } from '../linter/createLinter';
import type { CreateLinter } from '../linter/createLinter';
import { createLinter } from '../linter/createLinter';
import type { PlaygroundSystem } from '../linter/types';
import type { RuleDetails } from '../types';
import { createTwoslashInlayProvider } from './createProvideTwoslashInlay';
Expand Down
3 changes: 2 additions & 1 deletion packages/website/src/theme/CodeBlock/Content/String.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import Line from '@theme/CodeBlock/Line';
import WordWrapButton from '@theme/CodeBlock/WordWrapButton';
import clsx from 'clsx';
import * as lz from 'lz-string';
import Highlight, { defaultProps, type Language } from 'prism-react-renderer';
import type { Language } from 'prism-react-renderer';
import Highlight, { defaultProps } from 'prism-react-renderer';
import React from 'react';

import { TryInPlayground } from '../../MDXComponents/TryInPlayground';
Expand Down