Skip to content

Commit

Permalink
Move old utilities into separate dir
Browse files Browse the repository at this point in the history
  • Loading branch information
stormwarning committed Aug 30, 2024
1 parent d4be854 commit 5c9f36b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/rules/order.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AST_NODE_TYPES, ESLintUtils, type TSESLint, type TSESTree } from '@typescript-eslint/utils'
import type { ImportDeclaration } from 'estree'

import { mutateRanksToAlphabetize } from '../utils/alphabetize-ranks.js'
import { makeNewlinesBetweenReport } from '../utils/make-newlines-between-report.js'
import { makeOutOfOrderReport } from '../utils/make-out-of-order-report.js'
import { resolveImportGroup } from '../utils/resolve-import-group.js'
import { mutateRanksToAlphabetize } from '../utils/old/alphabetize-ranks.js'
import { makeNewlinesBetweenReport } from '../utils/old/make-newlines-between-report.js'
import { makeOutOfOrderReport } from '../utils/old/make-out-of-order-report.js'
import { resolveImportGroup } from '../utils/old/resolve-import-group.js'

const IMPORT_GROUPS = [
'builtin',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import groupBy from 'object.groupby'

import type { ImportNodeObject } from '../rules/order.js'
import type { ImportNodeObject } from '../../rules/order.js'

type OrderDirection = 'asc' | 'desc'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TSESLint } from '@typescript-eslint/utils'

import type { ImportNode } from '../rules/order.js'
import type { ImportNode } from '../../rules/order.js'
import { takeTokensAfterWhile, takeTokensBeforeWhile } from './take-tokens.js'

export function findStartOfLineWithComments(sourceCode: TSESLint.SourceCode, node: ImportNode) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ImportNode } from '../rules/order.js'
import type { ImportNode } from '../../rules/order.js'

export function findRootNode(node: ImportNode) {
let parent = node
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TSESLint } from '@typescript-eslint/utils'
import type { AST } from 'eslint'

import type { ImportNodeObject } from '../rules/order.js'
import type { ImportNodeObject } from '../../rules/order.js'
import {
commentOnSameLineAs,
findEndOfLineWithComments,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AST_NODE_TYPES, type TSESLint } from '@typescript-eslint/utils'

import type { ImportNode, ImportNodeObject } from '../rules/order.js'
import type { ImportNode, ImportNodeObject } from '../../rules/order.js'
import { findEndOfLineWithComments, findStartOfLineWithComments } from './find-comment.js'
import { findRootNode } from './find-root-node.js'

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/utils/take-tokens.ts → src/utils/old/take-tokens.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TSESLint } from '@typescript-eslint/utils'
import type { AST } from 'eslint'

import type { ImportNode } from '../rules/order.js'
import type { ImportNode } from '../../rules/order.js'

function getTokensOrCommentsBefore(sourceCode: TSESLint.SourceCode, node: ImportNode, count = 100) {
let currentNodeOrToken = node
Expand Down

0 comments on commit 5c9f36b

Please sign in to comment.