@cherepanov.pavel/shareable-config 1.0.2 → 1.0.4
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/.editorconfig +2 -3
- package/.editorconfig-get.js +3 -3
- package/.get-all.js +16 -12
- package/.gitattributes-get.js +3 -3
- package/.gitignore-get.js +33 -30
- package/.vscode/.code-snippets-get.js +34 -31
- package/.vscode/extensions.json +17 -17
- package/.vscode/extensions.json-get.js +25 -25
- package/.vscode/settings.json +36 -27
- package/.vscode/settings.json-get.js +25 -25
- package/README.md +13 -3
- package/env.json5.set.js +1 -1
- package/jsconfig.json +4 -7
- package/package.json +11 -1
- package/tools/eslint-config/configs/global.js +21 -18
- package/tools/eslint-config/configs/javascript.js +14 -14
- package/tools/eslint-config/configs/json.js +93 -0
- package/tools/eslint-config/configs/typescript.js +17 -17
- package/tools/eslint-config/configs/vue.js +22 -22
- package/tools/eslint-config/index.js +1 -0
- package/tools/eslint-config/rules/constants.js +10 -9
- package/tools/eslint-config/rules/javascript/index.js +2 -2
- package/tools/eslint-config/rules/javascript/possible-problems.js +76 -58
- package/tools/eslint-config/rules/javascript/suggestions.js +405 -249
- package/tools/eslint-config/rules/stylistic/jsFormatting.js +321 -167
- package/tools/eslint-config/rules/stylistic/tsFormatting.js +4 -4
- package/tools/eslint-config/rules/typescript/common.js +135 -126
- package/tools/eslint-config/rules/typescript/compatibility.js +20 -20
- package/tools/eslint-config/rules/typescript/extension.js +44 -44
- package/tools/eslint-config/rules/typescript/index.js +3 -3
- package/tools/eslint-config/rules/vue/base.js +2 -2
- package/tools/eslint-config/rules/vue/extension.js +47 -44
- package/tools/eslint-config/rules/vue/formatting.js +66 -36
- package/tools/eslint-config/rules/vue/index.js +5 -5
- package/tools/eslint-config/rules/vue/possibleProblems.js +182 -109
- package/tools/eslint-config/rules/vue/suggestions.js +82 -79
- package/tools/stylelint-config/config.js +18 -20
- package/tools/stylelint-config/rules/base.js +30 -24
- package/tools/stylelint-config/rules/conflicts.js +5 -5
- package/tools/stylelint-config/rules/order.js +38 -38
- package/tools/stylelint-config/rules/property-groups.js +392 -389
- package/tools/stylelint-config/rules/scss.js +9 -6
- package/tools/stylelint-config/rules/stylistic.js +110 -109
- package/utils/communication.js +26 -26
- package/utils/copy-with-override.js +35 -33
- package/utils/env.js +4 -4
- package/utils/file-header.js +9 -9
- package/utils/file.js +46 -46
- package/utils/merge.js +161 -155
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineConfig } from 'eslint/config';
|
|
2
|
+
import jsonc from 'eslint-plugin-jsonc';
|
|
3
|
+
import { ERROR } from '../rules/severity';
|
|
4
|
+
import { jsFormatting } from '../rules/stylistic/index.js';
|
|
5
|
+
|
|
6
|
+
const JSON_BUT_JSONC_FILES = [
|
|
7
|
+
'**/.vscode/*.json',
|
|
8
|
+
'**/tsconfig*.json',
|
|
9
|
+
];
|
|
10
|
+
const COMMON_RULES = {
|
|
11
|
+
'jsonc/no-bigint-literals': ERROR,
|
|
12
|
+
'jsonc/no-binary-expression': ERROR,
|
|
13
|
+
'jsonc/no-binary-numeric-literals': ERROR,
|
|
14
|
+
'jsonc/no-escape-sequence-in-identifier': ERROR,
|
|
15
|
+
'jsonc/no-hexadecimal-numeric-literals': ERROR,
|
|
16
|
+
'jsonc/no-nan': ERROR,
|
|
17
|
+
'jsonc/no-number-props': ERROR,
|
|
18
|
+
'jsonc/no-numeric-separators': ERROR,
|
|
19
|
+
'jsonc/no-octal-numeric-literals': ERROR,
|
|
20
|
+
'jsonc/no-parenthesized': ERROR,
|
|
21
|
+
'jsonc/no-plus-sign': ERROR,
|
|
22
|
+
'jsonc/no-regexp-literals': ERROR,
|
|
23
|
+
'jsonc/no-template-literals': ERROR,
|
|
24
|
+
'jsonc/no-undefined-value': ERROR,
|
|
25
|
+
'jsonc/no-unicode-codepoint-escapes': ERROR,
|
|
26
|
+
'jsonc/array-bracket-newline': jsFormatting['@stylistic/array-bracket-newline'],
|
|
27
|
+
'jsonc/array-bracket-spacing': jsFormatting['@stylistic/array-bracket-spacing'],
|
|
28
|
+
'jsonc/array-element-newline': jsFormatting['@stylistic/array-element-newline'],
|
|
29
|
+
'jsonc/indent': [
|
|
30
|
+
jsFormatting['@stylistic/indent'][0],
|
|
31
|
+
jsFormatting['@stylistic/indent'][1],
|
|
32
|
+
],
|
|
33
|
+
'jsonc/comma-dangle': jsFormatting['@stylistic/comma-dangle'],
|
|
34
|
+
};
|
|
35
|
+
const JSON_RULES = {
|
|
36
|
+
'jsonc/no-comments': ERROR,
|
|
37
|
+
'jsonc/comma-dangle': [
|
|
38
|
+
ERROR,
|
|
39
|
+
'never',
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
const JSON_JSONC_RULES = {
|
|
43
|
+
'jsonc/no-infinity': ERROR,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export default defineConfig([
|
|
48
|
+
{
|
|
49
|
+
plugins: {
|
|
50
|
+
jsonc,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
{
|
|
55
|
+
files: ['**/*.json'],
|
|
56
|
+
ignores: [
|
|
57
|
+
...JSON_BUT_JSONC_FILES,
|
|
58
|
+
'package-lock.json',
|
|
59
|
+
],
|
|
60
|
+
language: 'jsonc/json',
|
|
61
|
+
rules: {
|
|
62
|
+
...COMMON_RULES,
|
|
63
|
+
...JSON_JSONC_RULES,
|
|
64
|
+
...JSON_RULES,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
{
|
|
69
|
+
files: [
|
|
70
|
+
'**/*.jsonc',
|
|
71
|
+
...JSON_BUT_JSONC_FILES,
|
|
72
|
+
],
|
|
73
|
+
language: 'jsonc/jsonc',
|
|
74
|
+
rules: {
|
|
75
|
+
...COMMON_RULES,
|
|
76
|
+
...JSON_JSONC_RULES,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
{
|
|
81
|
+
files: ['**/*.json5'],
|
|
82
|
+
language: 'jsonc/json5',
|
|
83
|
+
rules: {
|
|
84
|
+
...COMMON_RULES,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
files: ['**/*.vue'],
|
|
89
|
+
rules: {
|
|
90
|
+
'jsonc/vue-custom-block/no-parsing-error': ERROR,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
]);
|
|
@@ -8,21 +8,21 @@ import tsParser from '@typescript-eslint/parser';
|
|
|
8
8
|
import { jsRules } from '../rules/javascript/index.js';
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
files: ['**/*.*ts'],
|
|
12
|
+
plugins: {
|
|
13
|
+
'@typescript-eslint': tsPlugin,
|
|
14
|
+
'@stylistic': stylisticPlugin,
|
|
15
|
+
},
|
|
16
|
+
languageOptions: {
|
|
17
|
+
parser: tsParser,
|
|
18
|
+
parserOptions: {
|
|
19
|
+
projectService: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
rules: {
|
|
23
|
+
...jsRules,
|
|
24
|
+
...jsFormatting,
|
|
25
|
+
...tsRules,
|
|
26
|
+
...tsFormatting,
|
|
27
|
+
},
|
|
28
28
|
};
|
|
@@ -14,30 +14,30 @@ import { getEnvs } from '../../../utils/env.js';
|
|
|
14
14
|
|
|
15
15
|
// https://github.com/sveltejs/eslint-plugin-svelte/issues/152#issuecomment-1150803175
|
|
16
16
|
const {
|
|
17
|
-
|
|
17
|
+
isRepositoryUseTypescript: isTs,
|
|
18
18
|
} = await getEnvs();
|
|
19
19
|
|
|
20
20
|
export default {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
files: ['**/*.vue'],
|
|
22
|
+
plugins: {
|
|
23
|
+
'vue': vuePlugin,
|
|
24
|
+
'@stylistic': stylisticPlugin,
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
...(isTs ? { '@typescript-eslint': tsPlugin } : {}),
|
|
27
|
+
},
|
|
28
|
+
languageOptions: {
|
|
29
|
+
parser: vueParser,
|
|
30
|
+
parserOptions: {
|
|
31
|
+
parser: isTs ? tsParser : 'espree',
|
|
32
|
+
...(isTs ? { projectService: true } : {}),
|
|
33
|
+
extraFileExtensions: ['.vue'],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
rules: {
|
|
37
|
+
...jsRules,
|
|
38
|
+
...jsFormatting,
|
|
39
|
+
...(isTs ? tsRules : {}),
|
|
40
|
+
...(isTs ? tsFormatting : {}),
|
|
41
|
+
...vueRules,
|
|
42
|
+
},
|
|
43
43
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as globalConfig } from './configs/global.js';
|
|
2
|
+
export { default as jsonConfig } from './configs/json.js';
|
|
2
3
|
export { default as vueConfig } from './configs/vue.js';
|
|
3
4
|
export { default as jsConfig } from './configs/javascript.js';
|
|
4
5
|
export { default as tsConfig } from './configs/typescript.js';
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
export const INDENT_SIZE =
|
|
1
|
+
export const INDENT_SIZE = 'tab';
|
|
2
|
+
export const TAB_WIDTH = 2;
|
|
2
3
|
export const STR_LENGTH = 100;
|
|
3
4
|
|
|
4
5
|
export const MAX_LEN = {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
code: STR_LENGTH,
|
|
7
|
+
tabWidth: TAB_WIDTH,
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
ignoreComments: false,
|
|
10
|
+
ignoreTrailingComments: false,
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
ignoreUrls: true,
|
|
13
|
+
ignoreStrings: true,
|
|
14
|
+
ignoreTemplateLiterals: true,
|
|
15
|
+
ignoreRegExpLiterals: true,
|
|
15
16
|
};
|
|
@@ -1,62 +1,80 @@
|
|
|
1
1
|
import { ERROR, WARN } from '../severity.js';
|
|
2
2
|
|
|
3
3
|
export const possibleProblemRules = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
4
|
+
'array-callback-return': [
|
|
5
|
+
WARN,
|
|
6
|
+
{ checkForEach: true },
|
|
7
|
+
],
|
|
8
|
+
'constructor-super': [ERROR],
|
|
9
|
+
'for-direction': [ERROR],
|
|
10
|
+
'getter-return': [
|
|
11
|
+
ERROR,
|
|
12
|
+
{ allowImplicit: true },
|
|
13
|
+
],
|
|
14
|
+
'no-async-promise-executor': [ERROR],
|
|
15
|
+
'no-await-in-loop': [ERROR],
|
|
16
|
+
'no-class-assign': [ERROR],
|
|
17
|
+
'no-compare-neg-zero': [ERROR],
|
|
18
|
+
'no-cond-assign': [
|
|
19
|
+
ERROR,
|
|
20
|
+
'always',
|
|
21
|
+
],
|
|
22
|
+
'no-const-assign': [ERROR],
|
|
23
|
+
'no-constant-binary-expression': [ERROR],
|
|
24
|
+
'no-constant-condition': [ERROR],
|
|
25
|
+
'no-constructor-return': [ERROR],
|
|
26
|
+
'no-control-regex': [ERROR],
|
|
27
|
+
'no-debugger': [ERROR],
|
|
28
|
+
'no-dupe-args': [ERROR],
|
|
29
|
+
'no-dupe-class-members': [ERROR],
|
|
30
|
+
'no-dupe-else-if': [ERROR],
|
|
31
|
+
'no-dupe-keys': [ERROR],
|
|
32
|
+
'no-duplicate-case': [ERROR],
|
|
33
|
+
'no-duplicate-imports': [ERROR],
|
|
34
|
+
'no-empty-character-class': [ERROR],
|
|
35
|
+
'no-empty-pattern': [ERROR],
|
|
36
|
+
'no-ex-assign': [ERROR],
|
|
37
|
+
'no-fallthrough': [ERROR],
|
|
38
|
+
'no-func-assign': [ERROR],
|
|
39
|
+
'no-import-assign': [ERROR],
|
|
40
|
+
'no-inner-declarations': [ERROR],
|
|
41
|
+
'no-invalid-regexp': [ERROR],
|
|
42
|
+
'no-irregular-whitespace': [ERROR],
|
|
43
|
+
'no-loss-of-precision': [ERROR],
|
|
44
|
+
'no-misleading-character-class': [ERROR],
|
|
45
|
+
'no-new-native-nonconstructor': [ERROR],
|
|
46
|
+
'no-new-symbol': [ERROR],
|
|
47
|
+
'no-obj-calls': [ERROR],
|
|
48
|
+
'no-promise-executor-return': [ERROR],
|
|
49
|
+
'no-prototype-builtins': [ERROR],
|
|
50
|
+
'no-self-assign': [ERROR],
|
|
51
|
+
'no-self-compare': [ERROR],
|
|
52
|
+
'no-setter-return': [ERROR],
|
|
53
|
+
'no-sparse-arrays': [ERROR],
|
|
54
|
+
'no-template-curly-in-string': [ERROR],
|
|
55
|
+
'no-this-before-super': [ERROR],
|
|
56
|
+
'no-undef': [ERROR],
|
|
57
|
+
'no-unexpected-multiline': [ERROR],
|
|
58
|
+
'no-unmodified-loop-condition': [ERROR],
|
|
59
|
+
'no-unreachable': [ERROR],
|
|
60
|
+
'no-unreachable-loop': [ERROR],
|
|
61
|
+
'no-unsafe-finally': [ERROR],
|
|
62
|
+
'no-unsafe-negation': [ERROR],
|
|
63
|
+
'no-unsafe-optional-chaining': [
|
|
64
|
+
ERROR,
|
|
65
|
+
{ disallowArithmeticOperators: true },
|
|
66
|
+
],
|
|
67
|
+
'no-unused-private-class-members': [ERROR],
|
|
68
|
+
'no-unused-vars': [WARN],
|
|
69
|
+
'no-use-before-define': [
|
|
70
|
+
ERROR,
|
|
71
|
+
{ classes: true, functions: false, variables: true },
|
|
72
|
+
],
|
|
73
|
+
'no-useless-backreference': [ERROR],
|
|
74
|
+
'require-atomic-updates': [ERROR],
|
|
75
|
+
'use-isnan': [ERROR],
|
|
76
|
+
'valid-typeof': [
|
|
77
|
+
ERROR,
|
|
78
|
+
{ requireStringLiterals: true },
|
|
79
|
+
],
|
|
62
80
|
};
|