1
+ import type { TSESLint } from '@typescript-eslint/utils'
2
+
1
3
import { TSESTree } from '@typescript-eslint/types'
2
4
3
5
import type { SortingNodeWithDependencies } from '../utils/sort-nodes-by-dependencies'
@@ -42,7 +44,6 @@ import { sortNodesByGroups } from '../utils/sort-nodes-by-groups'
42
44
import { createEslintRule } from '../utils/create-eslint-rule'
43
45
import { reportAllErrors } from '../utils/report-all-errors'
44
46
import { shouldPartition } from '../utils/should-partition'
45
- import { getSourceCode } from '../utils/get-source-code'
46
47
import { rangeToDiff } from '../utils/range-to-diff'
47
48
import { getSettings } from '../utils/get-settings'
48
49
import { isSortable } from '../utils/is-sortable'
@@ -87,7 +88,7 @@ let defaultOptions: Required<Options[0]> = {
87
88
export default createEslintRule < Options , MESSAGE_ID > ( {
88
89
create : context => {
89
90
let settings = getSettings ( context . settings )
90
- let sourceCode = getSourceCode ( context )
91
+ let { sourceCode, id } = context
91
92
92
93
let sortObject = (
93
94
nodeObject : TSESTree . ObjectExpression | TSESTree . ObjectPattern ,
@@ -181,7 +182,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
181
182
}
182
183
183
184
let eslintDisabledLines = getEslintDisabledLines ( {
184
- ruleName : context . id ,
185
+ ruleName : id ,
185
186
sourceCode,
186
187
} )
187
188
@@ -532,7 +533,7 @@ let getNodeName = ({
532
533
sourceCode,
533
534
property,
534
535
} : {
535
- sourceCode : ReturnType < typeof getSourceCode >
536
+ sourceCode : TSESLint . SourceCode
536
537
property : TSESTree . Property
537
538
} ) : string => {
538
539
if ( property . key . type === 'Identifier' ) {
@@ -547,7 +548,7 @@ let getNodeValue = ({
547
548
sourceCode,
548
549
property,
549
550
} : {
550
- sourceCode : ReturnType < typeof getSourceCode >
551
+ sourceCode : TSESLint . SourceCode
551
552
property : TSESTree . Property
552
553
} ) : string | null => {
553
554
if (
0 commit comments