@chris.araneo/eslint-config 0.0.113 → 0.0.114
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 +1 -1
- package/dist/src/typescript/eslint.js +31 -32
- package/dist/src/typescript/eslint.js.map +1 -1
- package/dist/src/typescript/index.js +1 -1
- package/dist/src/typescript/index.js.map +1 -1
- package/dist/src/typescript/stylistic.js +110 -111
- package/dist/src/typescript/stylistic.js.map +1 -1
- package/dist/src/typescript/typescript-eslint.js +204 -203
- package/dist/src/typescript/typescript-eslint.js.map +1 -1
- package/dist/src/typescript/unicorn.d.ts +1 -1
- package/dist/src/typescript/unicorn.js +8 -4
- package/dist/src/typescript/unicorn.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<img src="https://avatars.githubusercontent.com/u/6019716" alt="Official @eslint GitHub user avatar" width="256px" height="256px"/>
|
|
5
5
|
<br>
|
|
6
|
-
<a href="https://github.com/ChrisAraneo/eslint-config/blob/master/package.json"><img src="https://img.shields.io/badge/version-v0.0.
|
|
6
|
+
<a href="https://github.com/ChrisAraneo/eslint-config/blob/master/package.json"><img src="https://img.shields.io/badge/version-v0.0.113-blue" alt="version"></a>
|
|
7
7
|
<a href="https://github.com/ChrisAraneo/eslint-config/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="@chris.araneo/eslint-config is released under the MIT license."></a>
|
|
8
8
|
<a href="https://github.com/ChrisAraneo/eslint-config/actions/workflows/ci.yml"><img alt="GitHub CI Status" src="https://img.shields.io/github/actions/workflow/status/ChrisAraneo/eslint-config/ci.yml?label=CI&logo=GitHub"></a>
|
|
9
9
|
<br>
|
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import eslint from '@eslint/js';
|
|
2
|
-
import { isEmpty } from 'lodash-es';
|
|
3
|
-
export const getEslintConfigs = (sources, isTests) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
?
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
rules
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
'sort-vars': 'off',
|
|
31
|
-
},
|
|
2
|
+
import { chain, isEmpty } from 'lodash-es';
|
|
3
|
+
export const getEslintConfigs = (sources, isTests) => isEmpty(sources)
|
|
4
|
+
? []
|
|
5
|
+
: [
|
|
6
|
+
chain({ errorWhenNotTests: !isTests ? 'error' : 'off' })
|
|
7
|
+
.thru(({ errorWhenNotTests }) => ({
|
|
8
|
+
files: sources,
|
|
9
|
+
rules: {
|
|
10
|
+
...eslint.configs.all.rules,
|
|
11
|
+
'id-length': 'off',
|
|
12
|
+
'init-declarations': errorWhenNotTests,
|
|
13
|
+
'max-lines-per-function': errorWhenNotTests,
|
|
14
|
+
'max-params': ['error', 6],
|
|
15
|
+
'max-statements': isTests ? 'off' : ['error', 15],
|
|
16
|
+
'new-cap': 'off',
|
|
17
|
+
'no-await-in-loop': 'off',
|
|
18
|
+
'no-duplicate-imports': 'off',
|
|
19
|
+
'no-magic-numbers': 'off',
|
|
20
|
+
'no-plusplus': 'off',
|
|
21
|
+
'no-ternary': 'off',
|
|
22
|
+
'no-underscore-dangle': 'off',
|
|
23
|
+
'no-unused-vars': 'off',
|
|
24
|
+
'no-void': 'off',
|
|
25
|
+
'no-warning-comments': 'off',
|
|
26
|
+
'one-var': 'off',
|
|
27
|
+
'sort-imports': 'off',
|
|
28
|
+
'sort-keys': 'off',
|
|
29
|
+
'sort-vars': 'off',
|
|
32
30
|
},
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
}))
|
|
32
|
+
.value(),
|
|
33
|
+
];
|
|
35
34
|
//# sourceMappingURL=eslint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.js","sourceRoot":"/","sources":["src/typescript/eslint.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"eslint.js","sourceRoot":"/","sources":["src/typescript/eslint.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,OAAkB,EAClB,OAAiB,EACA,EAAE,CACnB,OAAO,CAAC,OAAO,CAAC;IACd,CAAC,CAAC,EAAE;IACJ,CAAC,CAAC;QACE,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;aACrD,IAAI,CAAC,CAAC,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC,CAAC;YAChC,KAAK,EAAE,OAAO;YACd,KAAK,EAAE;gBACL,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK;gBAC3B,WAAW,EAAE,KAAK;gBAClB,mBAAmB,EAAE,iBAAiB;gBACtC,wBAAwB,EAAE,iBAAiB;gBAC3C,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC1B,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;gBACjD,SAAS,EAAE,KAAK;gBAChB,kBAAkB,EAAE,KAAK;gBACzB,sBAAsB,EAAE,KAAK;gBAC7B,kBAAkB,EAAE,KAAK;gBACzB,aAAa,EAAE,KAAK;gBACpB,YAAY,EAAE,KAAK;gBACnB,sBAAsB,EAAE,KAAK;gBAC7B,gBAAgB,EAAE,KAAK;gBACvB,SAAS,EAAE,KAAK;gBAChB,qBAAqB,EAAE,KAAK;gBAC5B,SAAS,EAAE,KAAK;gBAChB,cAAc,EAAE,KAAK;gBACrB,WAAW,EAAE,KAAK;gBAClB,WAAW,EAAE,KAAK;aACnB;SACF,CAAC,CAAC;aACF,KAAK,EAA8B;KACvC,CAAC"}
|
|
@@ -19,7 +19,7 @@ const createConfigs = (sources = [], isTests = false, tsconfigRootDir, shouldRes
|
|
|
19
19
|
? { tsconfigRootDir: getAppRootDir() }
|
|
20
20
|
: {}),
|
|
21
21
|
}, isTests),
|
|
22
|
-
...getUnicornConfigs(sources),
|
|
22
|
+
...getUnicornConfigs(sources, isTests),
|
|
23
23
|
...getSimpleImportSortConfigs(sources),
|
|
24
24
|
...getStylisticConfigs(sources, isTests),
|
|
25
25
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["src/typescript/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAe,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,aAAa,GAAG,CACpB,UAAoB,EAAE,EACtB,OAAO,GAAG,KAAK,EACf,e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AC;QACX,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC;QACrC,GAAG,0BAA0B,CAC3B,OAAO,EACP;YACE,GAAG,CAAC,eAAe,IAAI,CAAC,uBAAuB;gBAC7C,CAAC,CAAC,EAAE,eAAe,EAAE;gBACrB,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,uBAAuB;gBACzB,CAAC,CAAC,EAAE,eAAe,EAAE,aAAa,EAAE,EAAE;gBACtC,CAAC,CAAC,EAAE,CAAC;SACR,EACD,OAAO,CACR;QACD,GAAG,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC;QACtC,GAAG,0BAA0B,CAAC,OAAO,CAAC;QACtC,GAAG,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC;KACzC,CAAC,CAAC;AAET,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,UAAoB,EAAE,EACtB,eAAwB,EACxB,uBAAiC,EACpB,EAAE,CAAC,CAAC;IACjB,CAAC,OAAO,CAAC,EAAE,aAAa,CACtB,OAAO,EACP,KAAK,EACL,eAAe,EACf,uBAAuB,CACxB;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,KAAgB,EAChB,eAAwB,EACX,EAAE,CAAC,CAAC;IACjB,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,eAAe,CAAC;CACrD,CAAC,CAAC"}
|
|
@@ -1,114 +1,113 @@
|
|
|
1
1
|
import stylistic from '@stylistic/eslint-plugin';
|
|
2
|
-
import { isEmpty } from 'lodash-es';
|
|
3
|
-
export const getStylisticConfigs = (sources, isTests) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
?
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
rules
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
'@stylistic/yield-star-spacing': 'off',
|
|
110
|
-
},
|
|
2
|
+
import { chain, isEmpty } from 'lodash-es';
|
|
3
|
+
export const getStylisticConfigs = (sources, isTests) => isEmpty(sources)
|
|
4
|
+
? []
|
|
5
|
+
: [
|
|
6
|
+
chain({ errorWhenNotTests: !isTests ? 'error' : 'off' })
|
|
7
|
+
.thru(({ errorWhenNotTests }) => ({
|
|
8
|
+
...stylistic.configs['all'],
|
|
9
|
+
files: sources,
|
|
10
|
+
rules: {
|
|
11
|
+
...stylistic.configs['all'].rules,
|
|
12
|
+
'@stylistic/array-bracket-newline': 'off',
|
|
13
|
+
'@stylistic/array-bracket-spacing': errorWhenNotTests,
|
|
14
|
+
'@stylistic/array-element-newline': 'off',
|
|
15
|
+
'@stylistic/arrow-parens': 'error',
|
|
16
|
+
'@stylistic/arrow-spacing': 'off',
|
|
17
|
+
'@stylistic/block-spacing': 'off',
|
|
18
|
+
'@stylistic/brace-style': 'error',
|
|
19
|
+
'@stylistic/comma-dangle': 'off',
|
|
20
|
+
'@stylistic/comma-spacing': 'error',
|
|
21
|
+
'@stylistic/comma-style': 'off',
|
|
22
|
+
'@stylistic/computed-property-spacing': ['error', 'never'],
|
|
23
|
+
'@stylistic/curly-newline': ['error', 'always'],
|
|
24
|
+
'@stylistic/dot-location': 'off',
|
|
25
|
+
'@stylistic/eol-last': ['error', 'always'],
|
|
26
|
+
'@stylistic/function-call-argument-newline': 'off',
|
|
27
|
+
'@stylistic/function-call-spacing': ['error', 'never'],
|
|
28
|
+
'@stylistic/function-paren-newline': 'off',
|
|
29
|
+
'@stylistic/generator-star-spacing': 'off',
|
|
30
|
+
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
31
|
+
'@stylistic/indent': 'off',
|
|
32
|
+
'@stylistic/indent-binary-ops': 'off',
|
|
33
|
+
'@stylistic/jsx-child-element-spacing': 'off',
|
|
34
|
+
'@stylistic/jsx-closing-bracket-location': 'off',
|
|
35
|
+
'@stylistic/jsx-closing-tag-location': 'off',
|
|
36
|
+
'@stylistic/jsx-curly-brace-presence': 'off',
|
|
37
|
+
'@stylistic/jsx-curly-newline': 'off',
|
|
38
|
+
'@stylistic/jsx-curly-spacing': 'off',
|
|
39
|
+
'@stylistic/jsx-equals-spacing': 'off',
|
|
40
|
+
'@stylistic/jsx-first-prop-new-line': 'off',
|
|
41
|
+
'@stylistic/jsx-function-call-newline': 'off',
|
|
42
|
+
'@stylistic/jsx-indent': 'off',
|
|
43
|
+
'@stylistic/jsx-indent-props': 'off',
|
|
44
|
+
'@stylistic/jsx-max-props-per-line': 'off',
|
|
45
|
+
'@stylistic/jsx-newline': 'off',
|
|
46
|
+
'@stylistic/jsx-one-expression-per-line': 'off',
|
|
47
|
+
'@stylistic/jsx-pascal-case': 'off',
|
|
48
|
+
'@stylistic/jsx-props-no-multi-spaces': 'off',
|
|
49
|
+
'@stylistic/jsx-props-style': 'off',
|
|
50
|
+
'@stylistic/jsx-quotes': 'off',
|
|
51
|
+
'@stylistic/jsx-self-closing-comp': 'off',
|
|
52
|
+
'@stylistic/jsx-sort-props': 'off',
|
|
53
|
+
'@stylistic/jsx-tag-spacing': 'off',
|
|
54
|
+
'@stylistic/jsx-wrap-multilines': 'off',
|
|
55
|
+
'@stylistic/key-spacing': ['error', { beforeColon: false }],
|
|
56
|
+
'@stylistic/keyword-spacing': ['error', { before: true }],
|
|
57
|
+
'@stylistic/line-comment-position': 'off',
|
|
58
|
+
'@stylistic/linebreak-style': 'off',
|
|
59
|
+
'@stylistic/lines-around-comment': 'off',
|
|
60
|
+
'@stylistic/lines-between-class-members': ['error', 'always'],
|
|
61
|
+
'@stylistic/list-style': 'off',
|
|
62
|
+
'@stylistic/max-len': 'off',
|
|
63
|
+
'@stylistic/max-statements-per-line': 'off',
|
|
64
|
+
'@stylistic/member-delimiter-style': 'off',
|
|
65
|
+
'@stylistic/multiline-comment-style': 'off',
|
|
66
|
+
'@stylistic/multiline-ternary': 'off',
|
|
67
|
+
'@stylistic/new-parens': 'off',
|
|
68
|
+
'@stylistic/newline-per-chained-call': 'off',
|
|
69
|
+
'@stylistic/no-confusing-arrow': 'error',
|
|
70
|
+
'@stylistic/no-extra-parens': 'off',
|
|
71
|
+
'@stylistic/no-extra-semi': 'error',
|
|
72
|
+
'@stylistic/no-floating-decimal': 'error',
|
|
73
|
+
'@stylistic/no-mixed-operators': 'off',
|
|
74
|
+
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
75
|
+
'@stylistic/no-multi-spaces': 'error',
|
|
76
|
+
'@stylistic/no-multiple-empty-lines': 'off',
|
|
77
|
+
'@stylistic/no-tabs': 'off',
|
|
78
|
+
'@stylistic/no-trailing-spaces': 'error',
|
|
79
|
+
'@stylistic/no-whitespace-before-property': 'off',
|
|
80
|
+
'@stylistic/nonblock-statement-body-position': 'off',
|
|
81
|
+
'@stylistic/object-curly-newline': 'off',
|
|
82
|
+
'@stylistic/object-curly-spacing': 'off',
|
|
83
|
+
'@stylistic/object-property-newline': 'off',
|
|
84
|
+
'@stylistic/one-var-declaration-per-line': 'off',
|
|
85
|
+
'@stylistic/operator-linebreak': 'off',
|
|
86
|
+
'@stylistic/padded-blocks': 'off',
|
|
87
|
+
'@stylistic/padding-line-between-statements': 'off',
|
|
88
|
+
'@stylistic/quote-props': 'off',
|
|
89
|
+
'@stylistic/quotes': 'off',
|
|
90
|
+
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
91
|
+
'@stylistic/semi': 'off',
|
|
92
|
+
'@stylistic/semi-spacing': 'off',
|
|
93
|
+
'@stylistic/semi-style': 'off',
|
|
94
|
+
'@stylistic/space-before-blocks': 'error',
|
|
95
|
+
'@stylistic/space-before-function-paren': 'off',
|
|
96
|
+
'@stylistic/space-in-parens': 'off',
|
|
97
|
+
'@stylistic/space-infix-ops': 'off',
|
|
98
|
+
'@stylistic/space-unary-ops': 'off',
|
|
99
|
+
'@stylistic/spaced-comment': 'off',
|
|
100
|
+
'@stylistic/switch-colon-spacing': 'off',
|
|
101
|
+
'@stylistic/template-curly-spacing': 'error',
|
|
102
|
+
'@stylistic/template-tag-spacing': 'off',
|
|
103
|
+
'@stylistic/type-annotation-spacing': 'error',
|
|
104
|
+
'@stylistic/type-generic-spacing': 'off',
|
|
105
|
+
'@stylistic/type-named-tuple-spacing': 'off',
|
|
106
|
+
'@stylistic/wrap-iife': 'off',
|
|
107
|
+
'@stylistic/wrap-regex': 'off',
|
|
108
|
+
'@stylistic/yield-star-spacing': 'off',
|
|
111
109
|
},
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
}))
|
|
111
|
+
.value(),
|
|
112
|
+
];
|
|
114
113
|
//# sourceMappingURL=stylistic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stylistic.js","sourceRoot":"/","sources":["src/typescript/stylistic.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"stylistic.js","sourceRoot":"/","sources":["src/typescript/stylistic.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,OAAkB,EAClB,OAAiB,EACA,EAAE,CACnB,OAAO,CAAC,OAAO,CAAC;IACd,CAAC,CAAC,EAAE;IACJ,CAAC,CAAC;QACE,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;aACrD,IAAI,CAAC,CAAC,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC,CAAC;YAChC,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;YAC3B,KAAK,EAAE,OAAO;YACd,KAAK,EAAE;gBACL,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK;gBACjC,kCAAkC,EAAE,KAAK;gBACzC,kCAAkC,EAAE,iBAAiB;gBACrD,kCAAkC,EAAE,KAAK;gBACzC,yBAAyB,EAAE,OAAO;gB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K;gBAC9B,gCAAgC,EAAE,OAAO;gBACzC,wCAAwC,EAAE,KAAK;gBAC/C,4BAA4B,EAAE,KAAK;gBACnC,4BAA4B,EAAE,KAAK;gBACnC,4BAA4B,EAAE,KAAK;gBACnC,2BAA2B,EAAE,KAAK;gBAClC,iCAAiC,EAAE,KAAK;gBACxC,mCAAmC,EAAE,OAAO;gBAC5C,iCAAiC,EAAE,KAAK;gBACxC,oCAAoC,EAAE,OAAO;gBAC7C,iCAAiC,EAAE,KAAK;gBACxC,qCAAqC,EAAE,KAAK;gBAC5C,sBAAsB,EAAE,KAAK;gBAC7B,uBAAuB,EAAE,KAAK;gBAC9B,+BAA+B,EAAE,KAAK;aACvC;SACF,CAAC,CAAC;aACF,KAAK,EAA8B;KACvC,CAAC"}
|
|
@@ -1,217 +1,218 @@
|
|
|
1
|
-
import { isEmpty } from 'lodash-es';
|
|
1
|
+
import { chain, isEmpty } from 'lodash-es';
|
|
2
2
|
import tseslint from 'typescript-eslint';
|
|
3
|
-
export const getTypescriptEslintConfigs = (sources, parserOptions, isTests) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
plugins: {
|
|
20
|
-
'@typescript-eslint': tseslint.plugin,
|
|
3
|
+
export const getTypescriptEslintConfigs = (sources, parserOptions, isTests) => isEmpty(sources)
|
|
4
|
+
? []
|
|
5
|
+
: [
|
|
6
|
+
chain({
|
|
7
|
+
errorWhenNotTests: !isTests ? 'error' : 'off',
|
|
8
|
+
warnWhenNotTests: !isTests ? 'warn' : 'off',
|
|
9
|
+
})
|
|
10
|
+
.thru(({ errorWhenNotTests, warnWhenNotTests }) => ({
|
|
11
|
+
files: sources,
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parser: tseslint.parser,
|
|
14
|
+
parserOptions: {
|
|
15
|
+
...(parserOptions ?? {}),
|
|
16
|
+
allowAutomaticSingleRunInference: true,
|
|
17
|
+
projectService: true,
|
|
21
18
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
|
|
19
|
+
},
|
|
20
|
+
plugins: {
|
|
21
|
+
'@typescript-eslint': tseslint.plugin,
|
|
22
|
+
},
|
|
23
|
+
rules: {
|
|
24
|
+
...tseslint.configs.strictTypeChecked
|
|
25
|
+
.map((config) => config.rules)
|
|
26
|
+
.reduce((a, b) => ({ ...a, ...b }), {}),
|
|
27
|
+
'@typescript-eslint/class-methods-use-this': 'off',
|
|
28
|
+
'@typescript-eslint/consistent-type-imports': 'off',
|
|
29
|
+
'@typescript-eslint/explicit-member-accessibility': [
|
|
30
|
+
'error',
|
|
31
|
+
{ accessibility: 'no-public' },
|
|
32
|
+
],
|
|
33
|
+
'@typescript-eslint/init-declarations': 'off',
|
|
34
|
+
'@typescript-eslint/max-params': 'off',
|
|
35
|
+
'@typescript-eslint/member-ordering': [
|
|
36
|
+
'error',
|
|
37
|
+
{
|
|
38
|
+
default: {
|
|
39
|
+
memberTypes: [
|
|
40
|
+
'public-decorated-field',
|
|
41
|
+
'protected-decorated-field',
|
|
42
|
+
'private-decorated-field',
|
|
43
|
+
'public-static-field',
|
|
44
|
+
'protected-static-field',
|
|
45
|
+
'private-static-field',
|
|
46
|
+
'public-instance-field',
|
|
47
|
+
'protected-instance-field',
|
|
48
|
+
'private-instance-field',
|
|
49
|
+
'static-field',
|
|
50
|
+
'public-field',
|
|
51
|
+
'instance-field',
|
|
52
|
+
'protected-field',
|
|
53
|
+
'private-field',
|
|
54
|
+
'constructor',
|
|
55
|
+
'public-static-method',
|
|
56
|
+
'protected-static-method',
|
|
57
|
+
'private-static-method',
|
|
58
|
+
'public-method',
|
|
59
|
+
'protected-method',
|
|
60
|
+
'private-method',
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
'@typescript-eslint/naming-convention': isTests
|
|
66
|
+
? 'off'
|
|
67
|
+
: [
|
|
68
|
+
'warn',
|
|
69
|
+
{ format: ['strictCamelCase'], selector: 'default' },
|
|
36
70
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
'protected-decorated-field',
|
|
41
|
-
'private-decorated-field',
|
|
42
|
-
'public-static-field',
|
|
43
|
-
'protected-static-field',
|
|
44
|
-
'private-static-field',
|
|
45
|
-
'public-instance-field',
|
|
46
|
-
'protected-instance-field',
|
|
47
|
-
'private-instance-field',
|
|
48
|
-
'static-field',
|
|
49
|
-
'public-field',
|
|
50
|
-
'instance-field',
|
|
51
|
-
'protected-field',
|
|
52
|
-
'private-field',
|
|
53
|
-
'constructor',
|
|
54
|
-
'public-static-method',
|
|
55
|
-
'protected-static-method',
|
|
56
|
-
'private-static-method',
|
|
57
|
-
'public-method',
|
|
58
|
-
'protected-method',
|
|
59
|
-
'private-method',
|
|
60
|
-
],
|
|
71
|
+
filter: {
|
|
72
|
+
match: false,
|
|
73
|
+
regex: '^_+$',
|
|
61
74
|
},
|
|
75
|
+
format: ['strictCamelCase'],
|
|
76
|
+
leadingUnderscore: 'allow',
|
|
77
|
+
selector: 'parameter',
|
|
62
78
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'warn',
|
|
68
|
-
{ format: ['strictCamelCase'], selector: 'default' },
|
|
69
|
-
{
|
|
70
|
-
filter: {
|
|
71
|
-
match: false,
|
|
72
|
-
regex: '^_+$',
|
|
73
|
-
},
|
|
74
|
-
format: ['strictCamelCase'],
|
|
75
|
-
leadingUnderscore: 'allow',
|
|
76
|
-
selector: 'parameter',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
custom: {
|
|
80
|
-
match: true,
|
|
81
|
-
regex: '^_+$',
|
|
82
|
-
},
|
|
83
|
-
format: null,
|
|
84
|
-
selector: 'parameter',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
format: ['strictCamelCase', 'StrictPascalCase'],
|
|
88
|
-
selector: ['function', 'import'],
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
format: ['StrictPascalCase'],
|
|
92
|
-
selector: ['typeLike'],
|
|
93
|
-
},
|
|
94
|
-
{ format: ['PascalCase'], selector: 'enumMember' },
|
|
95
|
-
{
|
|
96
|
-
format: ['PascalCase'],
|
|
97
|
-
modifiers: ['static'],
|
|
98
|
-
selector: 'classProperty',
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
format: ['PascalCase'],
|
|
102
|
-
prefix: [
|
|
103
|
-
'is',
|
|
104
|
-
'has',
|
|
105
|
-
'are',
|
|
106
|
-
'can',
|
|
107
|
-
'should',
|
|
108
|
-
'did',
|
|
109
|
-
'will',
|
|
110
|
-
'with',
|
|
111
|
-
],
|
|
112
|
-
selector: ['variable', 'parameter', 'accessor'],
|
|
113
|
-
types: ['boolean'],
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
format: null,
|
|
117
|
-
modifiers: ['requiresQuotes'],
|
|
118
|
-
selector: ['objectLiteralProperty'],
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
filter: {
|
|
122
|
-
match: false,
|
|
123
|
-
regex: '^(allowfullscreen|allowFullScreen|async|autofocus|autoFocus|autoplay|autoPlay|checked|defaultChecked|contenteditable|contentEditable|controls|default|defer|disabled|draggable|formnovalidate|formNoValidate|hidden|inert|ismap|itemscope|itemScope|loop|multiple|muted|nomodule|noModule|novalidate|noValidate|open|playsinline|playsInline|readonly|readOnly|required|reversed|selected|spellcheck|spellCheck)$',
|
|
124
|
-
},
|
|
125
|
-
format: ['PascalCase'],
|
|
126
|
-
prefix: [
|
|
127
|
-
'is',
|
|
128
|
-
'has',
|
|
129
|
-
'are',
|
|
130
|
-
'can',
|
|
131
|
-
'should',
|
|
132
|
-
'did',
|
|
133
|
-
'will',
|
|
134
|
-
'with',
|
|
135
|
-
],
|
|
136
|
-
selector: ['property'],
|
|
137
|
-
types: ['boolean'],
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
format: ['UPPER_CASE'],
|
|
141
|
-
leadingUnderscore: 'allow',
|
|
142
|
-
modifiers: ['const', 'global'],
|
|
143
|
-
prefix: [
|
|
144
|
-
'IS_',
|
|
145
|
-
'HAS_',
|
|
146
|
-
'ARE_',
|
|
147
|
-
'CAN_',
|
|
148
|
-
'SHOULD_',
|
|
149
|
-
'DID_',
|
|
150
|
-
'WILL_',
|
|
151
|
-
'WITH_',
|
|
152
|
-
],
|
|
153
|
-
selector: 'variable',
|
|
154
|
-
types: ['boolean'],
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
format: ['UPPER_CASE'],
|
|
158
|
-
leadingUnderscore: 'allow',
|
|
159
|
-
modifiers: ['const', 'global'],
|
|
160
|
-
selector: 'variable',
|
|
161
|
-
types: ['string', 'number', 'array'],
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
format: ['UPPER_CASE'],
|
|
165
|
-
modifiers: ['const', 'global'],
|
|
166
|
-
selector: 'default',
|
|
79
|
+
{
|
|
80
|
+
custom: {
|
|
81
|
+
match: true,
|
|
82
|
+
regex: '^_+$',
|
|
167
83
|
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
84
|
+
format: null,
|
|
85
|
+
selector: 'parameter',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
format: ['strictCamelCase', 'StrictPascalCase'],
|
|
89
|
+
selector: ['function', 'import'],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
format: ['StrictPascalCase'],
|
|
93
|
+
selector: ['typeLike'],
|
|
94
|
+
},
|
|
95
|
+
{ format: ['PascalCase'], selector: 'enumMember' },
|
|
96
|
+
{
|
|
97
|
+
format: ['PascalCase'],
|
|
98
|
+
modifiers: ['static'],
|
|
99
|
+
selector: 'classProperty',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
format: ['PascalCase'],
|
|
103
|
+
prefix: [
|
|
104
|
+
'is',
|
|
105
|
+
'has',
|
|
106
|
+
'are',
|
|
107
|
+
'can',
|
|
108
|
+
'should',
|
|
109
|
+
'did',
|
|
110
|
+
'will',
|
|
111
|
+
'with',
|
|
112
|
+
],
|
|
113
|
+
selector: ['variable', 'parameter', 'accessor'],
|
|
114
|
+
types: ['boolean'],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
format: null,
|
|
118
|
+
modifiers: ['requiresQuotes'],
|
|
119
|
+
selector: ['objectLiteralProperty'],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
filter: {
|
|
123
|
+
match: false,
|
|
124
|
+
regex: '^(allowfullscreen|allowFullScreen|async|autofocus|autoFocus|autoplay|autoPlay|checked|defaultChecked|contenteditable|contentEditable|controls|default|defer|disabled|draggable|formnovalidate|formNoValidate|hidden|inert|ismap|itemscope|itemScope|loop|multiple|muted|nomodule|noModule|novalidate|noValidate|open|playsinline|playsInline|readonly|readOnly|required|reversed|selected|spellcheck|spellCheck)$',
|
|
173
125
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
126
|
+
format: ['PascalCase'],
|
|
127
|
+
prefix: [
|
|
128
|
+
'is',
|
|
129
|
+
'has',
|
|
130
|
+
'are',
|
|
131
|
+
'can',
|
|
132
|
+
'should',
|
|
133
|
+
'did',
|
|
134
|
+
'will',
|
|
135
|
+
'with',
|
|
136
|
+
],
|
|
137
|
+
selector: ['property'],
|
|
138
|
+
types: ['boolean'],
|
|
139
|
+
},
|
|
180
140
|
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
141
|
+
format: ['UPPER_CASE'],
|
|
142
|
+
leadingUnderscore: 'allow',
|
|
143
|
+
modifiers: ['const', 'global'],
|
|
144
|
+
prefix: [
|
|
145
|
+
'IS_',
|
|
146
|
+
'HAS_',
|
|
147
|
+
'ARE_',
|
|
148
|
+
'CAN_',
|
|
149
|
+
'SHOULD_',
|
|
150
|
+
'DID_',
|
|
151
|
+
'WILL_',
|
|
152
|
+
'WITH_',
|
|
153
|
+
],
|
|
154
|
+
selector: 'variable',
|
|
155
|
+
types: ['boolean'],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
format: ['UPPER_CASE'],
|
|
159
|
+
leadingUnderscore: 'allow',
|
|
160
|
+
modifiers: ['const', 'global'],
|
|
161
|
+
selector: 'variable',
|
|
162
|
+
types: ['string', 'number', 'array'],
|
|
185
163
|
},
|
|
186
|
-
],
|
|
187
|
-
'@typescript-eslint/no-non-null-assertion': errorWhenNotTests,
|
|
188
|
-
'@typescript-eslint/no-unsafe-argument': errorWhenNotTests,
|
|
189
|
-
'@typescript-eslint/no-unsafe-assignment': errorWhenNotTests,
|
|
190
|
-
'@typescript-eslint/no-unsafe-call': errorWhenNotTests,
|
|
191
|
-
'@typescript-eslint/no-unsafe-function-type': errorWhenNotTests,
|
|
192
|
-
'@typescript-eslint/no-unsafe-member-access': errorWhenNotTests,
|
|
193
|
-
'@typescript-eslint/no-unsafe-return': errorWhenNotTests,
|
|
194
|
-
'@typescript-eslint/no-unsafe-type-assertion': warnWhenNotTests,
|
|
195
|
-
'@typescript-eslint/no-unused-vars': [
|
|
196
|
-
'error',
|
|
197
164
|
{
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
165
|
+
format: ['UPPER_CASE'],
|
|
166
|
+
modifiers: ['const', 'global'],
|
|
167
|
+
selector: 'default',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
format: ['strictCamelCase'],
|
|
171
|
+
modifiers: ['const', 'global'],
|
|
172
|
+
selector: 'variable',
|
|
173
|
+
types: ['function'],
|
|
205
174
|
},
|
|
206
175
|
],
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
176
|
+
'@typescript-eslint/no-confusing-void-expression': 'off',
|
|
177
|
+
'@typescript-eslint/no-explicit-any': errorWhenNotTests,
|
|
178
|
+
'@typescript-eslint/no-extraneous-class': 'off',
|
|
179
|
+
'@typescript-eslint/no-magic-numbers': [
|
|
180
|
+
errorWhenNotTests,
|
|
181
|
+
{
|
|
182
|
+
ignoreEnums: true,
|
|
183
|
+
ignoreNumericLiteralTypes: true,
|
|
184
|
+
ignoreReadonlyClassProperties: true,
|
|
185
|
+
ignoreTypeIndexes: true,
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
'@typescript-eslint/no-non-null-assertion': errorWhenNotTests,
|
|
189
|
+
'@typescript-eslint/no-unsafe-argument': errorWhenNotTests,
|
|
190
|
+
'@typescript-eslint/no-unsafe-assignment': errorWhenNotTests,
|
|
191
|
+
'@typescript-eslint/no-unsafe-call': errorWhenNotTests,
|
|
192
|
+
'@typescript-eslint/no-unsafe-function-type': errorWhenNotTests,
|
|
193
|
+
'@typescript-eslint/no-unsafe-member-access': errorWhenNotTests,
|
|
194
|
+
'@typescript-eslint/no-unsafe-return': errorWhenNotTests,
|
|
195
|
+
'@typescript-eslint/no-unsafe-type-assertion': warnWhenNotTests,
|
|
196
|
+
'@typescript-eslint/no-unused-vars': [
|
|
197
|
+
'error',
|
|
198
|
+
{
|
|
199
|
+
args: 'all',
|
|
200
|
+
argsIgnorePattern: '^_',
|
|
201
|
+
caughtErrors: 'all',
|
|
202
|
+
caughtErrorsIgnorePattern: '^_',
|
|
203
|
+
destructuredArrayIgnorePattern: '^_',
|
|
204
|
+
ignoreRestSiblings: true,
|
|
205
|
+
varsIgnorePattern: '^_',
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
'@typescript-eslint/parameter-properties': 'off',
|
|
209
|
+
'@typescript-eslint/prefer-destructuring': errorWhenNotTests,
|
|
210
|
+
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
211
|
+
'@typescript-eslint/require-await': 'off',
|
|
212
|
+
'@typescript-eslint/strict-boolean-expressions': 'off',
|
|
213
|
+
'@typescript-eslint/unbound-method': errorWhenNotTests,
|
|
214
214
|
},
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
}))
|
|
216
|
+
.value(),
|
|
217
|
+
];
|
|
217
218
|
//# sourceMappingURL=typescript-eslint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-eslint.js","sourceRoot":"/","sources":["src/typescript/typescript-eslint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"typescript-eslint.js","sourceRoot":"/","sources":["src/typescript/typescript-eslint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAEzC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,OAAkB,EAClB,aAAuC,EACvC,OAAiB,EACA,EAAE,CACnB,OAAO,CAAC,OAAO,CAAC;IACd,CAAC,CAAC,EAAE;IACJ,CAAC,CAAC;QACE,KAAK,CAAC;YACJ,iBAAiB,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;YAC7C,gBAAgB,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK;SAC5C,CAAC;aACC,IAAI,CAAC,CAAC,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;YAClD,KAAK,EAAE,OAAO;YACd,eAAe,EAAE;gBACf,MAA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AAE,IAAI;wBAC/B,6BAA6B,EAAE,IAAI;wBACnC,iBAAiB,EAAE,IAAI;qBACxB;iBACF;gBACD,0CAA0C,EAAE,iBAAiB;gBAC7D,uCAAuC,EAAE,iBAAiB;gBAC1D,yCAAyC,EAAE,iBAAiB;gBAC5D,mCAAmC,EAAE,iBAAiB;gBACtD,4CAA4C,EAAE,iBAAiB;gBAC/D,4CAA4C,EAAE,iBAAiB;gBAC/D,qCAAqC,EAAE,iBAAiB;gBACxD,6CAA6C,EAAE,gBAAgB;gBAC/D,mCAAmC,EAAE;oBACnC,OAAO;oBACP;wBACE,IAAI,EAAE,KAAK;wBACX,iBAAiB,EAAE,IAAI;wBACvB,YAAY,EAAE,KAAK;wBACnB,yBAAyB,EAAE,IAAI;wBAC/B,8BAA8B,EAAE,IAAI;wBACpC,kBAAkB,EAAE,IAAI;wBACxB,iBAAiB,EAAE,IAAI;qBACxB;iBACF;gBACD,yCAAyC,EAAE,KAAK;gBAChD,yCAAyC,EAAE,iBAAiB;gBAC5D,oDAAoD,EAAE,KAAK;gBAC3D,kCAAkC,EAAE,KAAK;gBACzC,+CAA+C,EAAE,KAAK;gBACtD,mCAAmC,EAAE,iBAAiB;aACvD;SACF,CAAC,CAAC;aACF,KAAK,EAA8B;KACvC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
|
-
export declare const getUnicornConfigs: (sources?: string[]) => Linter.Config[];
|
|
2
|
+
export declare const getUnicornConfigs: (sources?: string[], isTests?: boolean) => Linter.Config[];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import unicorn from 'eslint-plugin-unicorn';
|
|
2
2
|
import globals from 'globals';
|
|
3
|
-
import { isEmpty } from 'lodash-es';
|
|
4
|
-
export const getUnicornConfigs = (sources) => isEmpty(sources)
|
|
3
|
+
import { chain, isEmpty } from 'lodash-es';
|
|
4
|
+
export const getUnicornConfigs = (sources, isTests) => isEmpty(sources)
|
|
5
5
|
? []
|
|
6
6
|
: [
|
|
7
|
-
{
|
|
7
|
+
chain({ errorWhenNotTests: !isTests ? 'error' : 'off' })
|
|
8
|
+
.thru(({ errorWhenNotTests }) => ({
|
|
8
9
|
...unicorn.configs.all,
|
|
9
10
|
files: sources,
|
|
10
11
|
languageOptions: {
|
|
@@ -13,6 +14,7 @@ export const getUnicornConfigs = (sources) => isEmpty(sources)
|
|
|
13
14
|
},
|
|
14
15
|
rules: {
|
|
15
16
|
...unicorn.configs.all.rules,
|
|
17
|
+
'unicorn/consistent-function-scoping': errorWhenNotTests,
|
|
16
18
|
'unicorn/import-style': 'off',
|
|
17
19
|
'unicorn/new-for-builtins': 'off',
|
|
18
20
|
'unicorn/no-array-for-each': 'off',
|
|
@@ -24,7 +26,9 @@ export const getUnicornConfigs = (sources) => isEmpty(sources)
|
|
|
24
26
|
'unicorn/prefer-ternary': 'off',
|
|
25
27
|
'unicorn/prevent-abbreviations': 'off',
|
|
26
28
|
'unicorn/template-indent': 'off',
|
|
29
|
+
'unicorn/text-encoding-identifier-case': 'off',
|
|
27
30
|
},
|
|
28
|
-
}
|
|
31
|
+
}))
|
|
32
|
+
.value(),
|
|
29
33
|
];
|
|
30
34
|
//# sourceMappingURL=unicorn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unicorn.js","sourceRoot":"/","sources":["src/typescript/unicorn.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"unicorn.js","sourceRoot":"/","sources":["src/typescript/unicorn.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,CAAC,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