@borela-tech/eslint-config 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/bin/build +1 -1
- package/bin/test +1 -1
- package/dist/index.d.mts +7 -0
- package/dist/index.mjs +872 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +6 -5
- package/tsdown.config.ts +22 -0
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -1094
- package/dist/index.js.map +0 -1
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/rules/importsAndReExportsAtTop/getStatementType.ts","../src/rules/importsAndReExportsAtTop/isImportDeclaration.ts","../src/rules/importsAndReExportsAtTop/isReExport.ts","../src/rules/importsAndReExportsAtTop/categorizeStatements.ts","../src/rules/importsAndReExportsAtTop/findStatementIndices.ts","../src/rules/importsAndReExportsAtTop/generateSortedText.ts","../src/rules/importsAndReExportsAtTop/hasViolation.ts","../src/rules/importsAndReExportsAtTop/index.ts","../src/rules/individualImports.ts","../src/rules/individualReExports.ts","../src/rules/multilineUnionTypes/createFix.ts","../src/rules/multilineUnionTypes/isMultiline.ts","../src/rules/multilineUnionTypes/index.ts","../src/rules/singleLineImports/formatAttributes.ts","../src/rules/singleLineImports/formatNamed.ts","../src/rules/singleLineImports/formatSpecifiers.ts","../src/rules/singleLineImports/createFix.ts","../src/rules/singleLineImports/isMultiline.ts","../src/rules/singleLineImports/index.ts","../src/rules/singleLineReExports/createFix.ts","../src/rules/singleLineReExports/isMultiline.ts","../src/rules/singleLineReExports/index.ts","../src/rules/sortedImports/categorizeImport.ts","../src/rules/sortedImports/getSortKey.ts","../src/rules/sortedImports/categorizeImports.ts","../src/lib/compare.ts","../src/rules/sortedImports/ImportGroupOrder.ts","../src/rules/sortedImports/checkAlphabeticalSorting.ts","../src/rules/sortedImports/checkGroupOrdering.ts","../src/rules/sortedImports/getSpecifierName.ts","../src/rules/sortedImports/areSpecifiersSorted.ts","../src/rules/sortedImports/getNamedSpecifiers.ts","../src/rules/sortedImports/checkSpecifiersSorting.ts","../src/rules/sortedImports/sortSpecifiersText.ts","../src/rules/sortedImports/createFix/formatNamedImport.ts","../src/rules/sortedImports/createFix/buildSortedCode.ts","../src/rules/sortedImports/createFix/groupImportsByType.ts","../src/rules/sortedImports/createFix/sortImportGroups.ts","../src/rules/sortedImports/createFix/index.ts","../src/rules/sortedImports/getImportGroups.ts","../src/rules/sortedImports/index.ts","../src/rules/sortedReExports/categorizeReExport.ts","../src/rules/sortedReExports/getSortKey.ts","../src/rules/sortedReExports/categorizeReExports.ts","../src/rules/sortedReExports/ReExportGroupOrder.ts","../src/rules/sortedReExports/checkAlphabeticalSorting.ts","../src/rules/sortedReExports/checkGroupOrdering.ts","../src/rules/sortedReExports/getSpecifierName.ts","../src/rules/sortedReExports/areSpecifiersSorted.ts","../src/rules/sortedReExports/getNamedSpecifiers.ts","../src/rules/sortedReExports/isNamedReExport.ts","../src/rules/sortedReExports/checkSpecifiersSorting.ts","../src/rules/sortedReExports/sortSpecifiersText.ts","../src/rules/sortedReExports/createFix/formatNamedReExport.ts","../src/rules/sortedReExports/createFix/buildSortedCode.ts","../src/rules/sortedReExports/createFix/groupReExportsByType.ts","../src/rules/sortedReExports/createFix/sortExportGroups.ts","../src/rules/sortedReExports/createFix/index.ts","../src/rules/sortedReExports/getReExportGroups.ts","../src/rules/sortedReExports/index.ts"],"sourcesContent":["import eslint from '@eslint/js'\nimport react from 'eslint-plugin-react'\nimport reactHooks from 'eslint-plugin-react-hooks'\nimport stylistic from '@stylistic/eslint-plugin'\nimport typescript from 'typescript-eslint'\nimport {importsAndReExportsAtTop} from './rules/importsAndReExportsAtTop'\nimport {individualImports} from './rules/individualImports'\nimport {individualReExports} from './rules/individualReExports'\nimport {multilineUnionTypes} from './rules/multilineUnionTypes'\nimport {singleLineImports} from './rules/singleLineImports'\nimport {singleLineReExports} from './rules/singleLineReExports'\nimport {sortedImports} from './rules/sortedImports'\nimport {sortedReExports} from './rules/sortedReExports'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\nexport const CONFIG: TSESLint.FlatConfig.ConfigArray = [\n {\n ignores: [\n 'src/graphql/sdk.ts',\n '**/node_modules/**',\n '**/dist/**',\n ],\n },\n {\n settings: {\n react: {\n version: '19',\n },\n },\n },\n eslint.configs.recommended,\n react.configs.flat.recommended,\n stylistic.configs.recommended,\n ...typescript.configs.recommended,\n ...typescript.configs.stylistic,\n {\n plugins: {\n 'react-hooks': reactHooks,\n },\n rules: reactHooks.configs.recommended.rules,\n },\n {\n plugins: {\n '@borela-tech': {\n rules: {\n 'imports-and-re-exports-at-top': importsAndReExportsAtTop,\n 'individual-imports': individualImports,\n 'individual-re-exports': individualReExports,\n 'multiline-union-types': multilineUnionTypes,\n 'single-line-imports': singleLineImports,\n 'single-line-re-exports': singleLineReExports,\n 'sorted-imports': sortedImports,\n 'sorted-re-exports': sortedReExports,\n },\n },\n },\n rules: {\n '@borela-tech/imports-and-re-exports-at-top': 'error',\n '@borela-tech/individual-imports': 'error',\n '@borela-tech/individual-re-exports': 'error',\n '@borela-tech/multiline-union-types': 'error',\n '@borela-tech/single-line-imports': 'error',\n '@borela-tech/single-line-re-exports': 'error',\n '@borela-tech/sorted-imports': 'error',\n '@borela-tech/sorted-re-exports': 'error',\n },\n },\n {\n rules: {\n 'capitalized-comments': [\n 'error',\n 'always',\n {ignoreConsecutiveComments: true},\n ],\n 'react/react-in-jsx-scope': 'off',\n '@stylistic/arrow-parens': [\n 'error',\n 'as-needed',\n ],\n '@stylistic/array-bracket-newline': [\n 'error',\n 'consistent',\n ],\n '@stylistic/array-bracket-spacing': [\n 'error',\n 'never',\n ],\n '@stylistic/array-element-newline': [\n 'error',\n 'consistent',\n ],\n '@stylistic/block-spacing': 'off',\n '@stylistic/brace-style': [\n 'error',\n '1tbs',\n {allowSingleLine: true},\n ],\n '@stylistic/indent': [\n 'error',\n 2,\n {ignoredNodes: ['TSMappedType > *']},\n ],\n '@stylistic/jsx-tag-spacing': [\n 'error',\n {\n afterOpening: 'never',\n beforeClosing: 'never',\n beforeSelfClosing: 'never',\n closingSlash: 'never',\n },\n ],\n '@stylistic/jsx-wrap-multilines': 'off',\n '@stylistic/lines-between-class-members': 'off',\n '@stylistic/object-curly-newline': [\n 'error',\n {consistent: true},\n ],\n '@stylistic/object-curly-spacing': [\n 'error',\n 'never',\n ],\n '@stylistic/operator-linebreak': [\n 'error',\n 'before',\n {overrides: {'=': 'after'}},\n ],\n '@stylistic/quotes': [\n 'error',\n 'single',\n {avoidEscape: true},\n ],\n '@stylistic/quote-props': [\n 'error',\n 'as-needed',\n ],\n '@stylistic/semi': [\n 'error',\n 'never',\n {beforeStatementContinuationChars: 'always'},\n ],\n '@typescript-eslint/no-empty-function': 'off',\n '@typescript-eslint/consistent-indexed-object-style': 'off',\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {fixStyle: 'separate-type-imports'},\n ],\n },\n },\n]\n","import type {StatementType} from './statementType'\nimport type {TSESTree} from '@typescript-eslint/types'\n\nexport function getStatementType(statement: TSESTree.Statement): StatementType {\n if (statement.type === 'ImportDeclaration')\n return 'import'\n\n if (statement.type === 'ExportAllDeclaration')\n return 're-export'\n\n if (statement.type === 'ExportNamedDeclaration') {\n if (statement.source !== null)\n return 're-export'\n }\n\n return 'other'\n}\n","import type {TSESTree} from '@typescript-eslint/types'\n\nexport function isImportDeclaration(\n statement: TSESTree.ProgramStatement,\n): statement is TSESTree.ImportDeclaration {\n return statement.type === 'ImportDeclaration'\n}\n","import type {ReExportDeclaration} from '@lib/ReExportDeclaration'\nimport type {TSESTree} from '@typescript-eslint/types'\n\nexport function isReExport(\n statement: TSESTree.ProgramStatement,\n): statement is ReExportDeclaration {\n if (statement.type === 'ExportAllDeclaration')\n return true\n if (statement.type === 'ExportNamedDeclaration')\n return statement.source !== null\n return false\n}\n","import {getStatementType} from './getStatementType'\nimport {isImportDeclaration} from './isImportDeclaration'\nimport {isReExport} from './isReExport'\nimport type {CategorizedStatements} from './CategorizedStatements'\nimport type {TSESTree} from '@typescript-eslint/types'\n\nexport function categorizeStatements(\n statements: TSESTree.ProgramStatement[],\n): CategorizedStatements {\n const result: CategorizedStatements = {\n imports: [],\n reExports: [],\n other: [],\n }\n\n for (const statement of statements) {\n const type = getStatementType(statement)\n\n if (type === 'import' && isImportDeclaration(statement))\n result.imports.push(statement)\n else if (type === 're-export' && isReExport(statement))\n result.reExports.push(statement)\n else\n result.other.push(statement)\n }\n\n return result\n}\n","import {getStatementType} from './getStatementType'\nimport type {StatementIndices} from './StatementIndices'\nimport type {StatementType} from './statementType'\nimport type {TSESTree} from '@typescript-eslint/types'\n\nexport function findStatementIndices(\n statements: TSESTree.Statement[],\n): StatementIndices {\n let firstRegularStatement = -1\n let lastImport = -1\n let lastReExport = -1\n\n for (let i = 0; i < statements.length; i++) {\n const type: StatementType = getStatementType(statements[i])\n\n if (type === 'import')\n lastImport = i\n else if (type === 're-export')\n lastReExport = i\n else if (type === 'other' && firstRegularStatement === -1)\n firstRegularStatement = i\n }\n\n return {firstRegularStatement, lastImport, lastReExport}\n}\n","import type {CategorizedStatements} from './CategorizedStatements'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\nexport function generateSortedText(\n context: TSESLint.RuleContext<'importsAndReExportsAtTop', []>,\n categories: CategorizedStatements,\n): string {\n const allStatements = [\n ...categories.imports,\n ...categories.reExports,\n ...categories.other,\n ]\n return allStatements.map(\n node => context.sourceCode.getText(node),\n ).join('\\n')\n}\n","import type {CategorizedStatements} from './CategorizedStatements'\nimport type {StatementIndices} from './StatementIndices'\n\nexport function hasViolation(\n indices: StatementIndices,\n categories: CategorizedStatements,\n): boolean {\n const {firstRegularStatement, lastImport, lastReExport} = indices\n\n if (categories.imports.length === 0 && categories.reExports.length === 0)\n return false\n\n const hasImportAfterRegularStatement = (\n categories.imports.length > 0\n && firstRegularStatement !== -1\n && lastImport > firstRegularStatement\n )\n const hasReExportAfterRegularStatement = (\n categories.reExports.length > 0\n && firstRegularStatement !== -1\n && lastReExport > firstRegularStatement\n )\n\n return hasImportAfterRegularStatement || hasReExportAfterRegularStatement\n}\n","import {categorizeStatements} from './categorizeStatements'\nimport {findStatementIndices} from './findStatementIndices'\nimport {generateSortedText} from './generateSortedText'\nimport {hasViolation} from './hasViolation'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\ntype MessageIds = 'importsAndReExportsAtTop'\n\nexport const importsAndReExportsAtTop: TSESLint.RuleModule<MessageIds, []> = {\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Enforce imports and re-exports at the top of the file',\n },\n fixable: 'code',\n messages: {\n importsAndReExportsAtTop:\n 'Imports and re-exports should be at the top of the file.',\n },\n schema: [],\n },\n\n create(context) {\n return {\n Program(node) {\n const statements = node.body\n const categories = categorizeStatements(statements)\n const indices = findStatementIndices(statements)\n\n if (!hasViolation(indices, categories))\n return\n\n context.report({\n node,\n messageId: 'importsAndReExportsAtTop',\n\n fix(fixer) {\n const sortedText = generateSortedText(context, categories)\n return fixer.replaceText(node, sortedText)\n },\n })\n },\n }\n },\n}\n","import type {TSESLint} from '@typescript-eslint/utils'\n\ntype MessageIds = 'individualImports'\n\nexport const individualImports: TSESLint.RuleModule<MessageIds, []> = {\n meta: {\n docs: {\n description: 'Enforce individual imports instead of grouped imports',\n },\n fixable: 'code',\n messages: {\n individualImports: 'Use individual imports instead of grouped imports.',\n },\n schema: [],\n type: 'suggestion',\n },\n create(context) {\n return {\n ImportDeclaration(node) {\n if (node.specifiers.length <= 1)\n return\n\n context.report({\n node,\n messageId: 'individualImports',\n fix(fixer) {\n const source = node.source.raw\n const specifiers = node.specifiers\n .filter(s => s.type === 'ImportSpecifier')\n .map(s => `import {${s.local.name}} from ${source}`)\n .join('\\n')\n return fixer.replaceText(node, specifiers)\n },\n })\n },\n }\n },\n}\n","import type {TSESLint} from '@typescript-eslint/utils'\n\ntype MessageIds = 'individualReExports'\n\nexport const individualReExports: TSESLint.RuleModule<MessageIds, []> = {\n meta: {\n docs: {\n description: 'Enforce individual exports instead of grouped exports',\n },\n fixable: 'code',\n messages: {\n individualReExports: 'Use individual exports instead of grouped exports.',\n },\n schema: [],\n type: 'suggestion',\n },\n create(context) {\n return {\n ExportNamedDeclaration(node) {\n if (!node.source || node.specifiers.length <= 1)\n return\n\n context.report({\n node,\n messageId: 'individualReExports',\n fix(fixer) {\n const source = node.source.value\n const typeKeyword = node.exportKind === 'type'\n ? 'type '\n : ''\n const specifiers = node.specifiers\n .map(s => {\n const localName = s.local.type === 'Identifier'\n ? s.local.name\n : s.local.value\n const exportedName = s.exported.type === 'Identifier'\n ? s.exported.name\n : s.exported.value\n const name = localName === exportedName\n ? localName\n : `${localName} as ${exportedName}`\n return `export ${typeKeyword}{${name}} from '${source}'`\n })\n .join('\\n')\n return fixer.replaceText(node, specifiers)\n },\n })\n },\n }\n },\n}\n","import type {TSESLint} from '@typescript-eslint/utils'\nimport type {TSESTree} from '@typescript-eslint/utils'\n\nexport function createFix(\n fixer: TSESLint.RuleFixer,\n node: TSESTree.TSUnionType,\n sourceCode: TSESLint.SourceCode,\n): TSESLint.RuleFix {\n const types = node.types.map(t => sourceCode.getText(t))\n const formattedTypes = types.map(t => ` | ${t}`).join('\\n')\n const result = `\\n${formattedTypes}`\n return fixer.replaceText(node, result)\n}\n","import type {TSESTree} from '@typescript-eslint/types'\n\nexport function isMultiline(unionType: TSESTree.TSUnionType) {\n const {start, end} = unionType.loc ?? {}\n return start?.line !== end?.line\n}\n","import {createFix} from './createFix'\nimport {isMultiline} from './isMultiline'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\ntype MessageIds =\n | 'singleLine'\n | 'missingPipes'\n\nexport const multilineUnionTypes: TSESLint.RuleModule<MessageIds, []> = {\n meta: {\n docs: {\n description: 'Enforce union types with multiple members to be on multiple lines',\n },\n fixable: 'code',\n messages: {\n singleLine: 'Union types with multiple members should be on multiple lines',\n missingPipes: 'Multiline union types should have leading pipes on each member',\n },\n schema: [],\n type: 'layout',\n },\n\n create(context) {\n return {\n TSUnionType(node) {\n if (node.types.length < 2)\n return\n\n const sourceCode = context.sourceCode\n const text = sourceCode.getText(node)\n\n if (text.trim().startsWith('|'))\n return\n\n if (!isMultiline(node)) {\n context.report({\n node,\n messageId: 'singleLine',\n fix: fixer => createFix(fixer, node, sourceCode),\n })\n return\n }\n\n context.report({\n node,\n messageId: 'missingPipes',\n fix: fixer => createFix(fixer, node, sourceCode),\n })\n },\n }\n },\n}\n","import type {TSESTree} from '@typescript-eslint/types'\n\nexport function formatAttributes(\n attributes: readonly TSESTree.ImportAttribute[],\n): string {\n if (attributes.length === 0)\n return ''\n\n const formatted = attributes.map(\n attr => {\n const key = attr.key.type === 'Identifier'\n ? attr.key.name\n : attr.key.value\n const value = attr.value.value\n return `${key}: '${value}'`\n },\n ).join(', ')\n\n return ` with {${formatted}}`\n}\n","import type {TSESLint} from '@typescript-eslint/utils'\nimport type {TSESTree} from '@typescript-eslint/utils'\n\nexport function formatNamed(\n specifiers: TSESTree.ImportSpecifier[],\n sourceCode: TSESLint.SourceCode,\n): string {\n return specifiers.map(s => sourceCode.getText(s)).join(', ')\n}\n","import {formatNamed} from './formatNamed'\nimport type {TSESLint} from '@typescript-eslint/utils'\nimport type {TSESTree} from '@typescript-eslint/utils'\n\nexport function formatSpecifiers(\n declaration: TSESTree.ImportDeclaration,\n sourceCode: TSESLint.SourceCode,\n): string {\n const defaultSpecifier = declaration.specifiers.find(\n (s): s is TSESTree.ImportDefaultSpecifier => s.type === 'ImportDefaultSpecifier',\n )\n const namespaceSpecifier = declaration.specifiers.find(\n (s): s is TSESTree.ImportNamespaceSpecifier => s.type === 'ImportNamespaceSpecifier',\n )\n const namedSpecifiers = declaration.specifiers.filter(\n (s): s is TSESTree.ImportSpecifier => s.type === 'ImportSpecifier',\n )\n\n if (namespaceSpecifier)\n return `* as ${namespaceSpecifier.local.name}`\n\n if (defaultSpecifier && namedSpecifiers.length > 0)\n return `${defaultSpecifier.local.name}, {${formatNamed(namedSpecifiers, sourceCode)}}`\n\n if (defaultSpecifier)\n return defaultSpecifier.local.name\n\n if (namedSpecifiers.length === 0)\n return ''\n\n return `{${formatNamed(namedSpecifiers, sourceCode)}}`\n}\n","import {formatAttributes} from './formatAttributes'\nimport {formatSpecifiers} from './formatSpecifiers'\nimport type {TSESLint} from '@typescript-eslint/utils'\nimport type {TSESTree} from '@typescript-eslint/utils'\n\nexport function createFix(\n fixer: TSESLint.RuleFixer,\n declaration: TSESTree.ImportDeclaration,\n sourceCode: TSESLint.SourceCode,\n): TSESLint.RuleFix {\n const source = declaration.source.value\n const prefix = declaration.importKind === 'type' ? 'import type ' : 'import '\n const specifiers = formatSpecifiers(declaration, sourceCode)\n const attributes = formatAttributes(declaration.attributes)\n\n if (specifiers === '') {\n const result = `${prefix}'${source}'${attributes}`\n return fixer.replaceText(declaration, result)\n }\n\n const result = `${prefix}${specifiers} from '${source}'${attributes}`\n return fixer.replaceText(declaration, result)\n}\n","import type {TSESTree} from '@typescript-eslint/types'\n\nexport function isMultiline(declaration: TSESTree.ImportDeclaration) {\n const {start, end} = declaration.loc ?? {}\n return start?.line !== end?.line\n}\n","import {createFix} from './createFix'\nimport {isMultiline} from './isMultiline'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\ntype MessageIds = 'multiline'\n\nexport const singleLineImports: TSESLint.RuleModule<MessageIds, []> = {\n meta: {\n docs: {\n description: 'Enforce imports to be on a single line',\n },\n fixable: 'code',\n messages: {\n multiline: 'Import should be on a single line',\n },\n schema: [],\n type: 'layout',\n },\n\n create(context) {\n return {\n ImportDeclaration(node) {\n if (!isMultiline(node))\n return\n\n context.report({\n node,\n messageId: 'multiline',\n fix: fixer => createFix(fixer, node, context.sourceCode),\n })\n },\n }\n },\n}\n","import {formatAttributes} from '../singleLineImports/formatAttributes'\nimport type {ReExportDeclaration} from '@lib/ReExportDeclaration'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\nexport function createFix(\n fixer: TSESLint.RuleFixer,\n declaration: ReExportDeclaration,\n sourceCode: TSESLint.SourceCode,\n): TSESLint.RuleFix {\n const source = declaration.source!.value\n\n if (declaration.type === 'ExportAllDeclaration') {\n const exported = declaration.exported\n ? `* as ${sourceCode.getText(declaration.exported)}`\n : '*'\n const attributes = formatAttributes(declaration.attributes)\n const result = `export ${exported} from '${source}'${attributes}`\n return fixer.replaceText(declaration, result)\n }\n\n const prefix = declaration.exportKind === 'type' ? 'export type ' : 'export '\n const specifiers = declaration.specifiers.map(\n s => sourceCode.getText(s),\n ).join(', ')\n const attributes = formatAttributes(declaration.attributes)\n const result = `${prefix}{${specifiers}} from '${source}'${attributes}`\n\n return fixer.replaceText(declaration, result)\n}\n","import type {ReExportDeclaration} from '@lib/ReExportDeclaration'\n\nexport function isMultiline(declaration: ReExportDeclaration) {\n const {start, end} = declaration.loc ?? {}\n return start?.line !== end?.line\n}\n","import {createFix} from './createFix'\nimport {isMultiline} from './isMultiline'\nimport type {ReExportDeclaration} from '@lib/ReExportDeclaration'\nimport type {TSESLint} from '@typescript-eslint/utils'\nimport type {TSESTree} from '@typescript-eslint/utils'\n\ntype MessageIds = 'multiline'\n\nexport const singleLineReExports: TSESLint.RuleModule<MessageIds, []> = {\n meta: {\n docs: {\n description: 'Enforce re-exports to be on a single line',\n },\n fixable: 'code',\n messages: {\n multiline: 'Re-export should be on a single line',\n },\n schema: [],\n type: 'layout',\n },\n\n create(context) {\n const checkDeclaration = (\n node: TSESTree.Node,\n declaration: ReExportDeclaration,\n ) => {\n // Skip local exports (only process re-exports with a source)\n if (!declaration.source)\n return\n\n if (!isMultiline(declaration))\n return\n\n context.report({\n node,\n messageId: 'multiline',\n fix: fixer => createFix(fixer, declaration, context.sourceCode),\n })\n }\n\n return {\n ExportNamedDeclaration: node =>\n checkDeclaration(node, node),\n ExportAllDeclaration: node =>\n checkDeclaration(node, node),\n }\n },\n}\n","import type {ImportGroup} from './ImportGroup'\nimport type {TSESTree} from '@typescript-eslint/types'\n\nexport function categorizeImport(declaration: TSESTree.ImportDeclaration): ImportGroup {\n // Example: import type {Type} from 'module'\n if (declaration.importKind === 'type')\n return 'type'\n\n // Example: import 'module'\n if (declaration.specifiers.length === 0)\n return 'side-effect'\n\n // Example: import * as fs from 'module'\n if (declaration.specifiers.some(s => s.type === 'ImportNamespaceSpecifier'))\n return 'namespace'\n\n // Example: import value from 'module'\n if (declaration.specifiers.some(s => s.type === 'ImportDefaultSpecifier'))\n return 'default'\n\n // Example: import {value} from 'module'\n return 'named'\n}\n","import {categorizeImport} from './categorizeImport'\nimport type {TSESTree} from '@typescript-eslint/types'\n\nexport function getSortKey(declaration: TSESTree.ImportDeclaration): string {\n const group = categorizeImport(declaration)\n\n if (group === 'side-effect')\n return declaration.source.value\n\n if (group === 'namespace') {\n const namespaceSpecifier = declaration.specifiers.find(\n s => s.type === 'ImportNamespaceSpecifier',\n )\n return `*${namespaceSpecifier?.local.name ?? ''}`\n }\n\n if (group === 'default') {\n const defaultSpecifier = declaration.specifiers.find(\n s => s.type === 'ImportDefaultSpecifier',\n )\n return defaultSpecifier?.local.name ?? ''\n }\n\n const specifier = declaration.specifiers[0]\n return specifier.local.name\n}\n","import {categorizeImport} from './categorizeImport'\nimport {getSortKey} from './getSortKey'\nimport type {CategorizedImport} from './CategorizedImport'\nimport type {TSESTree} from '@typescript-eslint/types'\n\nexport function categorizeImports(declarations: TSESTree.ImportDeclaration[]): CategorizedImport[] {\n return declarations.map(declaration => ({\n declaration,\n group: categorizeImport(declaration),\n sortKey: getSortKey(declaration),\n }))\n}\n","export function compare(a: string, b: string): number {\n return a.localeCompare(b, 'en', {sensitivity: 'case'})\n}\n","import type {ImportGroup} from './ImportGroup'\n\nexport const importGroupOrder: ImportGroup[] = [\n 'side-effect',\n 'namespace',\n 'default',\n 'named',\n 'type',\n]\n","import {compare} from '@lib/compare'\nimport {importGroupOrder} from './ImportGroupOrder'\nimport type {CategorizedImport} from './CategorizedImport'\nimport type {ImportError} from './ImportError'\n\nexport function checkAlphabeticalSorting(categorized: CategorizedImport[]): ImportError[] {\n const errors: ImportError[] = []\n\n for (const group of importGroupOrder) {\n const groupImports = categorized.filter(c => c.group === group)\n const sorted = [...groupImports].sort((a, b) => compare(a.sortKey, b.sortKey))\n for (let i = 0; i < groupImports.length; i++) {\n if (groupImports[i] !== sorted[i]) {\n errors.push({\n node: groupImports[i].declaration,\n messageId: 'sortedImports',\n })\n }\n }\n }\n\n return errors\n}\n","import {importGroupOrder} from './ImportGroupOrder'\nimport type {CategorizedImport} from './CategorizedImport'\nimport type {ImportError} from './ImportError'\n\nexport function checkGroupOrdering(categorized: CategorizedImport[]): ImportError[] {\n const errors: ImportError[] = []\n\n let currentGroupIndex = -1\n for (const {declaration, group} of categorized) {\n const groupIndex = importGroupOrder.indexOf(group)\n if (groupIndex < currentGroupIndex) {\n errors.push({\n node: declaration,\n messageId: 'wrongGroup',\n })\n } else\n currentGroupIndex = groupIndex\n }\n\n return errors\n}\n","import type {TSESTree} from '@typescript-eslint/types'\n\nexport function getSpecifierName(specifier: TSESTree.ImportSpecifier): string {\n return specifier.imported.type === 'Identifier'\n ? specifier.imported.name\n : String(specifier.imported.value)\n}\n","import {compare} from '@lib/compare'\nimport {getSpecifierName} from './getSpecifierName'\nimport type {TSESTree} from '@typescript-eslint/types'\n\nexport function areSpecifiersSorted(specifiers: TSESTree.ImportSpecifier[]): boolean {\n const names = specifiers.map(s => getSpecifierName(s))\n const sorted = [...names].sort((a, b) => compare(a, b))\n return names.every((name, i) => name === sorted[i])\n}\n","import type {TSESTree} from '@typescript-eslint/types'\n\nexport function getNamedSpecifiers(declaration: TSESTree.ImportDeclaration): TSESTree.ImportSpecifier[] {\n return declaration.specifiers.filter(\n (s): s is TSESTree.ImportSpecifier => s.type === 'ImportSpecifier',\n )\n}\n","import {areSpecifiersSorted} from './areSpecifiersSorted'\nimport {getNamedSpecifiers} from './getNamedSpecifiers'\nimport type {CategorizedImport} from './CategorizedImport'\nimport type {ImportError} from './ImportError'\n\nexport function checkSpecifiersSorting(categorized: CategorizedImport[]): ImportError[] {\n const errors: ImportError[] = []\n const namedImports = categorized.filter(c => c.group === 'named')\n\n for (const {declaration} of namedImports) {\n const specifiers = getNamedSpecifiers(declaration)\n if (specifiers.length > 1 && !areSpecifiersSorted(specifiers)) {\n errors.push({\n node: declaration,\n messageId: 'sortedNames',\n })\n }\n }\n\n return errors\n}\n","import {compare} from '@lib/compare'\nimport {getSpecifierName} from './getSpecifierName'\nimport type {TSESLint} from '@typescript-eslint/utils'\nimport type {TSESTree} from '@typescript-eslint/utils'\n\nexport function sortSpecifiersText(\n specifiers: TSESTree.ImportSpecifier[],\n sourceCode: TSESLint.SourceCode,\n): string {\n const sorted = [...specifiers].sort((a, b) => {\n const nameA = getSpecifierName(a)\n const nameB = getSpecifierName(b)\n return compare(nameA, nameB)\n })\n return sorted.map(s => sourceCode.getText(s)).join(', ')\n}\n","import {areSpecifiersSorted} from '../areSpecifiersSorted'\nimport {getNamedSpecifiers} from '../getNamedSpecifiers'\nimport {sortSpecifiersText} from '../sortSpecifiersText'\nimport type {TSESLint} from '@typescript-eslint/utils'\nimport type {TSESTree} from '@typescript-eslint/utils'\n\nexport function formatNamedImport(\n declaration: TSESTree.ImportDeclaration,\n sourceCode: TSESLint.SourceCode,\n): string {\n const specifiers = getNamedSpecifiers(declaration)\n\n if (specifiers.length > 1 && !areSpecifiersSorted(specifiers)) {\n const sortedSpecifiers = sortSpecifiersText(specifiers, sourceCode)\n const source = declaration.source.value\n const prefix = declaration.importKind === 'type' ? 'import type ' : 'import '\n return `${prefix}{${sortedSpecifiers}} from '${source}'`\n }\n\n return sourceCode.getText(declaration)\n}\n","import {formatNamedImport} from './formatNamedImport'\nimport {importGroupOrder} from '../ImportGroupOrder'\nimport type {CategorizedImport} from '../CategorizedImport'\nimport type {ImportGroup} from '../ImportGroup'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\nexport function buildSortedCode(\n grouped: Record<ImportGroup, CategorizedImport[]>,\n sourceCode: TSESLint.SourceCode,\n): string[] {\n const sortedCode: string[] = []\n\n for (const group of importGroupOrder) {\n for (const {declaration} of grouped[group]) {\n if (group === 'named' || group === 'type')\n sortedCode.push(formatNamedImport(declaration, sourceCode))\n else\n sortedCode.push(sourceCode.getText(declaration))\n }\n }\n\n return sortedCode\n}\n","import type {CategorizedImport} from '../CategorizedImport'\nimport type {ImportGroup} from '../ImportGroup'\n\nexport function groupImportsByType(\n categorized: CategorizedImport[],\n): Record<ImportGroup, CategorizedImport[]> {\n const grouped: Record<ImportGroup, CategorizedImport[]> = {\n 'side-effect': [],\n namespace: [],\n default: [],\n named: [],\n type: [],\n }\n\n for (const item of categorized)\n grouped[item.group].push(item)\n\n return grouped\n}\n","import {compare} from '@lib/compare'\nimport type {CategorizedImport} from '../CategorizedImport'\nimport type {ImportGroup} from '../ImportGroup'\n\nexport function sortImportGroups(\n grouped: Record<ImportGroup, CategorizedImport[]>,\n): void {\n grouped['side-effect'].sort((a, b) => compare(a.sortKey, b.sortKey))\n grouped['namespace'].sort((a, b) => compare(a.sortKey, b.sortKey))\n grouped['default'].sort((a, b) => compare(a.sortKey, b.sortKey))\n grouped['named'].sort((a, b) => compare(a.sortKey, b.sortKey))\n grouped['type'].sort((a, b) => compare(a.sortKey, b.sortKey))\n}\n","import {buildSortedCode} from './buildSortedCode'\nimport {categorizeImports} from '../categorizeImports'\nimport {groupImportsByType} from './groupImportsByType'\nimport {sortImportGroups} from './sortImportGroups'\nimport type {TSESLint} from '@typescript-eslint/utils'\nimport type {TSESTree} from '@typescript-eslint/utils'\n\nfunction createFixForGroup(\n fixer: TSESLint.RuleFixer,\n importDeclarations: TSESTree.ImportDeclaration[],\n sourceCode: TSESLint.SourceCode,\n) {\n if (importDeclarations.length === 0)\n return null\n\n const categorized = categorizeImports(importDeclarations)\n const grouped = groupImportsByType(categorized)\n\n sortImportGroups(grouped)\n\n const sortedCode = buildSortedCode(grouped, sourceCode)\n .join('\\n')\n\n const firstImport = importDeclarations[0]\n const lastImport = importDeclarations[importDeclarations.length - 1]\n\n return fixer.replaceTextRange(\n [firstImport.range![0], lastImport.range![1]],\n sortedCode,\n )\n}\n\nexport function createFix(\n fixer: TSESLint.RuleFixer,\n importGroups: TSESTree.ImportDeclaration[][],\n sourceCode: TSESLint.SourceCode,\n): TSESLint.RuleFix[] {\n const fixes: TSESLint.RuleFix[] = []\n\n for (const group of importGroups) {\n const fix = createFixForGroup(fixer, group, sourceCode)\n if (fix)\n fixes.push(fix)\n }\n\n return fixes\n}\n","import type {TSESTree} from '@typescript-eslint/types'\n\nexport function getImportGroups(programBody: TSESTree.ProgramStatement[]): TSESTree.ImportDeclaration[][] {\n const groups: TSESTree.ImportDeclaration[][] = []\n let currentGroup: TSESTree.ImportDeclaration[] = []\n\n for (const statement of programBody) {\n if (statement.type === 'ImportDeclaration') {\n currentGroup.push(statement)\n continue\n }\n\n if (currentGroup.length > 0) {\n groups.push(currentGroup)\n currentGroup = []\n }\n }\n\n if (currentGroup.length > 0)\n groups.push(currentGroup)\n\n return groups\n}\n","import {categorizeImports} from './categorizeImports'\nimport {checkAlphabeticalSorting} from './checkAlphabeticalSorting'\nimport {checkGroupOrdering} from './checkGroupOrdering'\nimport {checkSpecifiersSorting} from './checkSpecifiersSorting'\nimport {createFix} from './createFix'\nimport {getImportGroups} from './getImportGroups'\nimport type {ImportError} from './ImportError'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\ntype MessageIds =\n | 'sortedImports'\n | 'sortedNames'\n | 'wrongGroup'\n\nexport const sortedImports: TSESLint.RuleModule<MessageIds, []> = {\n meta: {\n docs: {\n description: 'Enforce sorted imports alphabetically',\n },\n fixable: 'code',\n messages: {\n sortedImports: 'Imports should be sorted alphabetically',\n sortedNames: 'Named imports should be sorted alphabetically',\n wrongGroup: 'Import is in wrong group',\n },\n schema: [],\n type: 'suggestion',\n },\n create(context) {\n return {\n Program(node) {\n const body = node.body\n const importGroups = getImportGroups(body)\n if (importGroups.length === 0)\n return\n\n const allErrors: ImportError[] = []\n\n // Check each import group independently\n for (const group of importGroups) {\n const categorized = categorizeImports(group)\n const errors: ImportError[] = [\n ...checkGroupOrdering(categorized),\n ...checkAlphabeticalSorting(categorized),\n ...checkSpecifiersSorting(categorized),\n ]\n allErrors.push(...errors)\n }\n\n for (const error of allErrors) {\n context.report({\n node: error.node,\n messageId: error.messageId,\n fix(fixer) {\n const sourceCode = context.sourceCode\n return createFix(fixer, importGroups, sourceCode)\n },\n })\n }\n },\n }\n },\n}\n","import type {ReExportDeclaration} from '@lib/ReExportDeclaration'\nimport type {ReExportGroup} from './ReExportGroup'\n\nexport function categorizeReExport(\n declaration: ReExportDeclaration,\n): ReExportGroup {\n // Example: export * from 'module' or export * as ns from 'module'\n if (declaration.type === 'ExportAllDeclaration') {\n // Export * as ns from 'module' has an 'exported' property\n if (declaration.exported)\n return 're-export-namespace'\n return 're-export-all'\n }\n\n // Example: export type {Type} from 'module'\n if (declaration.exportKind === 'type')\n return 're-export-type'\n\n // Example: export {value} from 'module'\n return 're-export-named'\n}\n","import {categorizeReExport} from './categorizeReExport'\nimport type {ReExportDeclaration} from '@lib/ReExportDeclaration'\n\nexport function getSortKey(declaration: ReExportDeclaration): string {\n const group = categorizeReExport(declaration)\n\n if (declaration.type === 'ExportAllDeclaration') {\n if (group === 're-export-namespace') {\n if (declaration.exported?.type === 'Identifier')\n return `*${declaration.exported.name}`\n }\n return declaration.source.value\n }\n\n const specifier = declaration.specifiers[0]\n if (!specifier)\n return ''\n\n return specifier.local.type === 'Identifier'\n ? specifier.local.name\n : specifier.local.value\n}\n","import {categorizeReExport} from './categorizeReExport'\nimport {getSortKey} from './getSortKey'\nimport type {CategorizedReExport} from './CategorizedReExport'\nimport type {ReExportDeclaration} from '@lib/ReExportDeclaration'\n\nexport function categorizeReExports(declarations: ReExportDeclaration[]): CategorizedReExport[] {\n return declarations.map(declaration => {\n return {\n declaration,\n group: categorizeReExport(declaration),\n sortKey: getSortKey(declaration),\n } as CategorizedReExport\n })\n}\n","import type {ReExportGroup} from './ReExportGroup'\n\nexport const reExportGroupOrder: ReExportGroup[] = [\n 're-export-all',\n 're-export-namespace',\n 're-export-named',\n 're-export-type',\n]\n","import {compare} from '@lib/compare'\nimport {reExportGroupOrder} from './ReExportGroupOrder'\nimport type {CategorizedReExport} from './CategorizedReExport'\nimport type {ReExportError} from './ReExportError'\n\nexport function checkAlphabeticalSorting(categorized: CategorizedReExport[]): ReExportError[] {\n const errors: ReExportError[] = []\n\n for (const group of reExportGroupOrder) {\n const groupReExports = categorized.filter(c => c.group === group)\n const sorted = [...groupReExports].sort((a, b) =>\n compare(a.sortKey, b.sortKey),\n )\n for (let i = 0; i < groupReExports.length; i++) {\n if (groupReExports[i] !== sorted[i]) {\n errors.push({\n node: groupReExports[i].declaration,\n messageId: 'sortedReExports',\n })\n }\n }\n }\n\n return errors\n}\n","import {reExportGroupOrder} from './ReExportGroupOrder'\nimport type {CategorizedReExport} from './CategorizedReExport'\nimport type {ReExportError} from './ReExportError'\n\nexport function checkGroupOrdering(categorized: CategorizedReExport[]): ReExportError[] {\n const errors: ReExportError[] = []\n\n let currentGroupIndex = -1\n for (const {declaration, group} of categorized) {\n const groupIndex = reExportGroupOrder.indexOf(group)\n if (groupIndex < currentGroupIndex) {\n errors.push({\n node: declaration,\n messageId: 'wrongGroup',\n })\n } else\n currentGroupIndex = groupIndex\n }\n\n return errors\n}\n","import type {TSESTree} from '@typescript-eslint/types'\n\nexport function getSpecifierName(specifier: TSESTree.ExportSpecifier): string {\n return specifier.local.type === 'Identifier'\n ? specifier.local.name\n : String(specifier.local.value)\n}\n","import {compare} from '@lib/compare'\nimport {getSpecifierName} from './getSpecifierName'\nimport type {TSESTree} from '@typescript-eslint/types'\n\nexport function areSpecifiersSorted(specifiers: TSESTree.ExportSpecifier[]): boolean {\n const names = specifiers.map(s => getSpecifierName(s))\n const sorted = [...names].sort((a, b) => compare(a, b))\n return names.every((name, i) => name === sorted[i])\n}\n","import type {TSESTree} from '@typescript-eslint/types'\n\nexport function getNamedSpecifiers(\n declaration: TSESTree.ExportNamedDeclaration,\n): TSESTree.ExportSpecifier[] {\n return declaration.specifiers.filter(\n s => s.type === 'ExportSpecifier' && s.local.type === 'Identifier',\n )\n}\n","import type {CategorizedNamedReExport} from './CategorizedNamedReExport'\nimport type {CategorizedReExport} from './CategorizedReExport'\n\nexport function isNamedReExport(x: CategorizedReExport): x is CategorizedNamedReExport {\n return x.group !== 're-export-all' && x.group !== 're-export-namespace'\n}\n","import {areSpecifiersSorted} from './areSpecifiersSorted'\nimport {getNamedSpecifiers} from './getNamedSpecifiers'\nimport {isNamedReExport} from './isNamedReExport'\nimport type {CategorizedReExport} from './CategorizedReExport'\nimport type {ReExportError} from './ReExportError'\n\nexport function checkSpecifiersSorting(categorized: CategorizedReExport[]): ReExportError[] {\n const errors: ReExportError[] = []\n const namedReExports = categorized.filter(isNamedReExport)\n\n for (const {declaration} of namedReExports) {\n const specifiers = getNamedSpecifiers(declaration)\n const isSorted = areSpecifiersSorted(specifiers)\n if (specifiers.length > 1 && !isSorted) {\n errors.push({\n node: declaration,\n messageId: 'sortedNames',\n })\n }\n }\n\n return errors\n}\n","import {compare} from '@lib/compare'\nimport {getSpecifierName} from './getSpecifierName'\nimport type {TSESLint} from '@typescript-eslint/utils'\nimport type {TSESTree} from '@typescript-eslint/utils'\n\nexport function sortSpecifiersText(\n specifiers: TSESTree.ExportSpecifier[],\n sourceCode: TSESLint.SourceCode,\n): string {\n const sorted = [...specifiers].sort((a, b) => {\n const nameA = getSpecifierName(a)\n const nameB = getSpecifierName(b)\n return compare(nameA, nameB)\n })\n return sorted.map(s => sourceCode.getText(s)).join(', ')\n}\n","import {areSpecifiersSorted} from '../areSpecifiersSorted'\nimport {getNamedSpecifiers} from '../getNamedSpecifiers'\nimport {sortSpecifiersText} from '../sortSpecifiersText'\nimport type {TSESLint} from '@typescript-eslint/utils'\nimport type {TSESTree} from '@typescript-eslint/utils'\n\nexport function formatNamedReExport(\n declaration: TSESTree.ExportNamedDeclaration,\n sourceCode: TSESLint.SourceCode,\n): string {\n const specifiers = getNamedSpecifiers(declaration)\n\n if (specifiers.length > 1 && !areSpecifiersSorted(specifiers)) {\n const sortedSpecifiers = sortSpecifiersText(specifiers, sourceCode)\n const source = declaration.source!.value\n const prefix = declaration.exportKind === 'type' ? 'export type ' : 'export '\n return `${prefix}{${sortedSpecifiers}} from '${source}'`\n }\n\n return sourceCode.getText(declaration)\n}\n","import {formatNamedReExport} from './formatNamedReExport'\nimport {isNamedReExport} from '../isNamedReExport'\nimport {reExportGroupOrder} from '../ReExportGroupOrder'\nimport type {CategorizedReExport} from '../CategorizedReExport'\nimport type {ReExportGroup} from '../ReExportGroup'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\nexport function buildSortedCode(\n grouped: Record<ReExportGroup, CategorizedReExport[]>,\n sourceCode: TSESLint.SourceCode,\n): string[] {\n const sortedCode: string[] = []\n\n for (const group of reExportGroupOrder) {\n for (const item of grouped[group]) {\n if (isNamedReExport(item)) {\n sortedCode.push(\n formatNamedReExport(\n item.declaration,\n sourceCode,\n ),\n )\n } else\n sortedCode.push(sourceCode.getText(item.declaration))\n }\n }\n\n return sortedCode\n}\n","import type {CategorizedReExport} from '../CategorizedReExport'\nimport type {ReExportGroup} from '../ReExportGroup'\n\nexport function groupReExportsByType(\n categorized: CategorizedReExport[],\n): Record<ReExportGroup, CategorizedReExport[]> {\n const grouped: Record<ReExportGroup, CategorizedReExport[]> = {\n 're-export-all': [],\n 're-export-namespace': [],\n 're-export-named': [],\n 're-export-type': [],\n }\n\n for (const item of categorized)\n grouped[item.group].push(item)\n\n return grouped\n}\n","import {compare} from '@lib/compare'\nimport type {CategorizedReExport} from '../CategorizedReExport'\nimport type {ReExportGroup} from '../ReExportGroup'\n\nexport function sortExportGroups(\n grouped: Record<ReExportGroup, CategorizedReExport[]>,\n): void {\n grouped['re-export-all'].sort((a, b) => compare(a.sortKey, b.sortKey))\n grouped['re-export-namespace'].sort((a, b) => compare(a.sortKey, b.sortKey))\n grouped['re-export-named'].sort((a, b) => compare(a.sortKey, b.sortKey))\n grouped['re-export-type'].sort((a, b) => compare(a.sortKey, b.sortKey))\n}\n","import {buildSortedCode} from './buildSortedCode'\nimport {categorizeReExports} from '../categorizeReExports'\nimport {groupReExportsByType} from './groupReExportsByType'\nimport {sortExportGroups} from './sortExportGroups'\nimport type {ReExportDeclaration} from '@lib/ReExportDeclaration'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\nfunction createFixForGroup(\n fixer: TSESLint.RuleFixer,\n reExportDeclarations: ReExportDeclaration[],\n sourceCode: TSESLint.SourceCode,\n) {\n if (reExportDeclarations.length === 0)\n return null\n\n const categorized = categorizeReExports(reExportDeclarations)\n const grouped = groupReExportsByType(categorized)\n\n sortExportGroups(grouped)\n\n const sortedCode = buildSortedCode(grouped, sourceCode)\n .join('\\n')\n\n const firstReExport = reExportDeclarations[0]\n const lastReExport = reExportDeclarations[reExportDeclarations.length - 1]\n\n return fixer.replaceTextRange(\n [firstReExport.range![0], lastReExport.range![1]],\n sortedCode,\n )\n}\n\nexport function createFix(\n fixer: TSESLint.RuleFixer,\n reExportGroups: ReExportDeclaration[][],\n sourceCode: TSESLint.SourceCode,\n): TSESLint.RuleFix[] {\n const fixes: TSESLint.RuleFix[] = []\n\n for (const group of reExportGroups) {\n const fix = createFixForGroup(fixer, group, sourceCode)\n if (fix)\n fixes.push(fix)\n }\n\n return fixes\n}\n","import type {ReExportDeclaration} from '@lib/ReExportDeclaration'\nimport type {TSESTree} from '@typescript-eslint/types'\n\nfunction isReExportDeclaration(\n statement: TSESTree.ProgramStatement,\n): statement is ReExportDeclaration {\n return (statement.type === 'ExportNamedDeclaration' && statement.source !== null)\n || statement.type === 'ExportAllDeclaration'\n}\n\nexport function getReExportGroups(\n programBody: TSESTree.ProgramStatement[],\n): ReExportDeclaration[][] {\n const groups: ReExportDeclaration[][] = []\n let currentGroup: ReExportDeclaration[] = []\n\n for (const statement of programBody) {\n if (isReExportDeclaration(statement)) {\n currentGroup.push(statement)\n continue\n }\n\n if (currentGroup.length > 0) {\n groups.push(currentGroup)\n currentGroup = []\n }\n }\n\n if (currentGroup.length > 0)\n groups.push(currentGroup)\n\n return groups\n}\n","import {categorizeReExports} from './categorizeReExports'\nimport {checkAlphabeticalSorting} from './checkAlphabeticalSorting'\nimport {checkGroupOrdering} from './checkGroupOrdering'\nimport {checkSpecifiersSorting} from './checkSpecifiersSorting'\nimport {createFix} from './createFix'\nimport {getReExportGroups} from './getReExportGroups'\nimport type {ReExportError} from './ReExportError'\nimport type {TSESLint} from '@typescript-eslint/utils'\n\ntype MessageIds =\n | 'sortedReExports'\n | 'sortedNames'\n | 'wrongGroup'\n\nexport const sortedReExports: TSESLint.RuleModule<MessageIds, []> = {\n meta: {\n docs: {\n description: 'Enforce sorted exports alphabetically',\n },\n fixable: 'code',\n messages: {\n sortedReExports: 'Exports should be sorted alphabetically',\n sortedNames: 'Named exports should be sorted alphabetically',\n wrongGroup: 'Export is in wrong group',\n },\n schema: [],\n type: 'suggestion',\n },\n create(context) {\n return {\n Program(node) {\n const body = node.body\n const reExportGroups = getReExportGroups(body)\n if (reExportGroups.length === 0)\n return\n\n const allErrors: ReExportError[] = []\n\n // Check each re-export group independently\n for (const group of reExportGroups) {\n const categorized = categorizeReExports(group)\n const errors: ReExportError[] = [\n ...checkGroupOrdering(categorized),\n ...checkAlphabeticalSorting(categorized),\n ...checkSpecifiersSorting(categorized),\n ]\n allErrors.push(...errors)\n }\n\n for (const error of allErrors) {\n context.report({\n node: error.node,\n messageId: error.messageId,\n fix(fixer) {\n const sourceCode = context.sourceCode\n return createFix(fixer, reExportGroups, sourceCode)\n },\n })\n }\n },\n }\n },\n}\n"],"mappings":";AAAA,OAAO,YAAY;AACnB,OAAO,WAAW;AAClB,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,gBAAgB;;;ACDhB,SAAS,iBAAiB,WAA8C;AAC7E,MAAI,UAAU,SAAS;AAC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A,QACA,EAAC,YAAY,KAAI;AAAA,MACnB;AAAA,MACA,mCAAmC;AAAA,QACjC;AAAA,QACA;AAAA,MACF;AAAA,MACA,iCAAiC;AAAA,QAC/B;AAAA,QACA;AAAA,QACA,EAAC,WAAW,EAAC,KAAK,QAAO,EAAC;AAAA,MAC5B;AAAA,MACA,qBAAqB;AAAA,QACnB;AAAA,QACA;AAAA,QACA,EAAC,aAAa,KAAI;AAAA,MACpB;AAAA,MACA,0BAA0B;AAAA,QACxB;AAAA,QACA;AAAA,MACF;AAAA,MACA,mBAAmB;AAAA,QACjB;AAAA,QACA;AAAA,QACA,EAAC,kCAAkC,SAAQ;AAAA,MAC7C;AAAA,MACA,wCAAwC;AAAA,MACxC,sDAAsD;AAAA,MACtD,8CAA8C;AAAA,QAC5C;AAAA,QACA,EAAC,UAAU,wBAAuB;AAAA,MACpC;AAAA,IACF;AAAA,EACF;AACF;","names":["createFix","result","isMultiline","isMultiline","createFix","createFix","attributes","result","isMultiline","isMultiline","createFix","createFix","createFix","getSortKey","getSortKey","checkAlphabeticalSorting","checkGroupOrdering","getSpecifierName","areSpecifiersSorted","getSpecifierName","getNamedSpecifiers","checkSpecifiersSorting","getNamedSpecifiers","areSpecifiersSorted","sortSpecifiersText","getSpecifierName","getNamedSpecifiers","areSpecifiersSorted","sortSpecifiersText","buildSortedCode","createFixForGroup","buildSortedCode","createFix","checkGroupOrdering","checkAlphabeticalSorting","checkSpecifiersSorting","createFix"]}
|