eslint-plugin-perfectionist 4.1.0 → 4.1.1
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
const utils = require('@typescript-eslint/utils')
|
|
3
|
+
const isSortable = require('utils/is-sortable')
|
|
3
4
|
const commonJsonSchemas = require('../utils/common-json-schemas.js')
|
|
4
5
|
const sortModules_types = require('./sort-modules.types.js')
|
|
5
6
|
const sortNodesByDependencies = require('../utils/sort-nodes-by-dependencies.js')
|
|
@@ -155,14 +156,17 @@ const sortModules = createEslintRule.createEslintRule({
|
|
|
155
156
|
sourceCode,
|
|
156
157
|
})
|
|
157
158
|
return {
|
|
158
|
-
Program: program =>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
Program: program => {
|
|
160
|
+
if (isSortable.isSortable(program.body)) {
|
|
161
|
+
return analyzeModule({
|
|
162
|
+
eslintDisabledLines,
|
|
163
|
+
sourceCode,
|
|
164
|
+
options,
|
|
165
|
+
program,
|
|
166
|
+
context,
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
},
|
|
166
170
|
}
|
|
167
171
|
},
|
|
168
172
|
defaultOptions: [defaultOptions],
|