@dr.pogodin/eslint-configs 0.2.5 → 0.2.6
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/config/javascript.js +12 -3
- package/config/typescript.js +9 -15
- package/package.json +1 -1
package/config/javascript.js
CHANGED
|
@@ -11,7 +11,10 @@ import babelPlugin from '@babel/eslint-plugin';
|
|
|
11
11
|
import js from '@eslint/js';
|
|
12
12
|
import stylisticPlugin from '@stylistic/eslint-plugin';
|
|
13
13
|
|
|
14
|
-
export function newJsConfig({
|
|
14
|
+
export function newJsConfig({
|
|
15
|
+
noPerf,
|
|
16
|
+
perfectionistTsConfig,
|
|
17
|
+
} = {}) {
|
|
15
18
|
const extentions = [
|
|
16
19
|
'js/recommended',
|
|
17
20
|
'@stylistic/recommended',
|
|
@@ -296,7 +299,7 @@ export function newJsConfig({ noPerf } = {}) {
|
|
|
296
299
|
partitionByNewLine: true,
|
|
297
300
|
};
|
|
298
301
|
|
|
299
|
-
|
|
302
|
+
const sortImporsOptions = {
|
|
300
303
|
alphabet,
|
|
301
304
|
groups: [
|
|
302
305
|
'builtin',
|
|
@@ -312,7 +315,13 @@ export function newJsConfig({ noPerf } = {}) {
|
|
|
312
315
|
newlinesInside: 'ignore',
|
|
313
316
|
partitionByNewLine: false,
|
|
314
317
|
type: 'custom',
|
|
315
|
-
}
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
if (perfectionistTsConfig) {
|
|
321
|
+
sortImporsOptions.tsconfig = perfectionistTsConfig;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
rules['perfectionist/sort-imports'] = ['error', sortImporsOptions];
|
|
316
325
|
}
|
|
317
326
|
|
|
318
327
|
return defineConfig([{
|
package/config/typescript.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { defineConfig } from 'eslint/config';
|
|
2
2
|
import tsEsLint from 'typescript-eslint';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { newJsConfig } from './javascript.js';
|
|
5
5
|
|
|
6
6
|
function newConfig({ noPerf } = {}) {
|
|
7
|
-
const jsConfig = newJsConfig(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
rootDir: '.',
|
|
14
|
-
};
|
|
7
|
+
const jsConfig = newJsConfig({
|
|
8
|
+
noPerf,
|
|
9
|
+
perfectionistTsConfig: {
|
|
10
|
+
rootDir: '.',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
const extentions = [
|
|
17
15
|
jsConfig,
|
|
18
16
|
tsEsLint.configs.recommendedTypeChecked,
|
|
19
17
|
tsEsLint.configs.stylisticTypeChecked,
|
|
@@ -100,11 +98,7 @@ function newConfig({ noPerf } = {}) {
|
|
|
100
98
|
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
|
|
101
99
|
};
|
|
102
100
|
|
|
103
|
-
if (noPerf) {
|
|
104
|
-
extentions = [javascriptNoPerf, ...extentions];
|
|
105
|
-
} else {
|
|
106
|
-
extentions = [jsConfig, ...extentions];
|
|
107
|
-
|
|
101
|
+
if (!noPerf) {
|
|
108
102
|
rules['adjacent-overload-signatures'] = 'off';
|
|
109
103
|
}
|
|
110
104
|
|