diff --git a/package.json b/package.json index 4419e50d..a6ce9cd2 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "build": "nr build:typegen && tsup", "dev": "npx @eslint/config-inspector", "lint": "eslint --flag unstable_ts_config .", - "lint:fix": "eslint . --fix", + "lint:fix": "eslint --flag unstable_ts_config . --fix", "build:inspector": "pnpm build && npx @eslint/config-inspector build", "build:typegen": "tsx scripts/typegen.ts", "prepack": "nr build", diff --git a/scripts/typegen.ts b/scripts/typegen.ts index 8dbc1417..7241e27f 100644 --- a/scripts/typegen.ts +++ b/scripts/typegen.ts @@ -1,6 +1,6 @@ import { writeFile } from 'node:fs/promises' -import { flatConfigsToRulesDTS } from 'eslint-typegen/core' import { builtinRules } from 'eslint/use-at-your-own-risk' +import { flatConfigsToRulesDTS } from 'eslint-typegen/core' import picocolors from 'picocolors' import { command, @@ -60,7 +60,6 @@ const configs = await combine( const configNames = configs.map(i => i.name).filter(Boolean) as string[] -// @ts-expect-error eslint typegen version let dts = await flatConfigsToRulesDTS(configs, { includeAugmentation: false, }) diff --git a/src/configs/formatter.ts b/src/configs/formatter.ts index 10340bd9..d82966aa 100644 --- a/src/configs/formatter.ts +++ b/src/configs/formatter.ts @@ -10,6 +10,7 @@ import { GLOB_YAML, } from '../constants/glob' import { ensurePackages, interopDefault, parserPlain } from '../shared' +import { StylisticConfigDefaults } from './stylistic' import type { OptionsFormatters, PartialPrettierExtendedOptions, @@ -17,7 +18,6 @@ import type { StylisticConfig, TypedFlatConfigItem, } from '../types' -import { StylisticConfigDefaults } from './stylistic' export async function formatter( options: OptionsFormatters | true = {}, diff --git a/src/configs/imports.ts b/src/configs/imports.ts index 913864b9..0171902f 100644 --- a/src/configs/imports.ts +++ b/src/configs/imports.ts @@ -1,4 +1,3 @@ -import { GLOB_SRC_EXT } from '../constants/glob' import { pluginAntfu, pluginImport } from '../plugins' import type { OptionsStylistic, TypedFlatConfigItem } from '../types' diff --git a/src/configs/index.ts b/src/configs/index.ts index 0a3e2e51..9aca8397 100644 --- a/src/configs/index.ts +++ b/src/configs/index.ts @@ -1,23 +1,23 @@ +export * from './command' export * from './comments' +export * from './disables' +export * from './formatter' export * from './ignores' export * from './imports' export * from './javascript' export * from './jsdoc' export * from './jsonc' +export * from './jsx' export * from './node' +export * from './perfectionist' +export * from './react' +export * from './regexp' export * from './sort' export * from './stylistic' +export * from './svelte' +export * from './tailwindcss' +export * from './test' export * from './typescript' export * from './unicorn' -export * from './vue' -export * from './test' -export * from './perfectionist' -export * from './react' export * from './unocss' -export * from './formatter' -export * from './svelte' -export * from './tailwindcss' -export * from './command' -export * from './regexp' -export * from './jsx' -export * from './disables' +export * from './vue' diff --git a/src/configs/javascript.ts b/src/configs/javascript.ts index 9f7f2bd6..fd7a0886 100644 --- a/src/configs/javascript.ts +++ b/src/configs/javascript.ts @@ -1,5 +1,4 @@ import globals from 'globals' -import { GLOB_SRC, GLOB_SRC_EXT } from '../constants/glob' import { pluginUnusedImports } from '../plugins' import type { OptionsIsInEditor, diff --git a/src/configs/typescript.ts b/src/configs/typescript.ts index 5602d827..37bf6676 100644 --- a/src/configs/typescript.ts +++ b/src/configs/typescript.ts @@ -1,5 +1,5 @@ import process from 'node:process' -import { GLOB_ASTRO_TS, GLOB_DTS, GLOB_MARKDOWN, GLOB_TS, GLOB_TSX } from '../constants/glob' +import { GLOB_ASTRO_TS, GLOB_MARKDOWN, GLOB_TS, GLOB_TSX } from '../constants/glob' import { pluginAntfu } from '../plugins' import { interopDefault, renameRules } from '../shared' import type { diff --git a/src/index.ts b/src/index.ts index 1f28beb0..8ec1d845 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,8 @@ +import type { Linter } from 'eslint' import { command, comments, + disables, formatter, ignores, imports, @@ -21,7 +23,6 @@ import { typescript, unicorn, unocss, - disables, vue, } from './configs' import { @@ -37,7 +38,6 @@ import { resolveSubOptions, } from './shared' import type { Awaitable, OptionsConfig, TypedFlatConfigItem } from './types' -import type { Linter } from 'eslint' const flatConfigProps = [ 'name', diff --git a/src/plugins/index.ts b/src/plugins/index.ts index f9abd14a..4a002652 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -1,10 +1,10 @@ // eslint-disable-next-line ts/ban-ts-comment // @ts-nocheck -export { default as pluginAntfu } from 'eslint-plugin-antfu' export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments' +export { default as pluginAntfu } from 'eslint-plugin-antfu' export * as pluginImport from 'eslint-plugin-import-x' export { default as pluginNode } from 'eslint-plugin-n' +export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist' export { default as pluginUnicorn } from 'eslint-plugin-unicorn' export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports' -export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist' diff --git a/src/types/index.ts b/src/types/index.ts index d7de4f8f..37fb1797 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,11 +1,11 @@ -import type { - PartialPrettierExtendedOptions, - TypedFlatConfigItem, -} from './rule' import type { StylisticCustomizeOptions } from '@stylistic/eslint-plugin' import type { ParserOptions } from '@typescript-eslint/parser' import type { FlatGitignoreOptions } from 'eslint-config-flat-gitignore' import type { Options as VueBlocksOptions } from 'eslint-processor-vue-blocks' +import type { + PartialPrettierExtendedOptions, + TypedFlatConfigItem, +} from './rule' export * from './rule' diff --git a/src/types/rule.ts b/src/types/rule.ts index 235d8bbd..fc49bc84 100644 --- a/src/types/rule.ts +++ b/src/types/rule.ts @@ -1,5 +1,5 @@ -import type { ConfigNames, RuleOptions } from './typegen' import type { Linter } from 'eslint' +import type { ConfigNames, RuleOptions } from './typegen' export type Rules = RuleOptions