@rife/config 0.0.5-beta.3 → 0.0.5-beta.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/.eslintrc.js +60 -60
- package/.prettierrc.js +20 -20
- package/.stylelintrc.js +34 -34
- package/package.json +1 -1
- package/tsconfig.json +28 -28
package/.eslintrc.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* rules : https://eslint.org/docs/latest/
|
|
3
|
-
* typescript-eslint : https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md
|
|
4
|
-
* eslint-plugin-import : https://github.com/benmosher/eslint-plugin-import
|
|
5
|
-
* eslint-config-prettier : https://github.com/prettier/eslint-config-prettier
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @type {any}
|
|
10
|
-
*/
|
|
11
|
-
module.exports = {
|
|
12
|
-
parser: '@typescript-eslint/parser',
|
|
13
|
-
plugins: ['@typescript-eslint', 'import'],
|
|
14
|
-
extends: ['prettier'],
|
|
15
|
-
rules: {
|
|
16
|
-
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
17
|
-
'object-shorthand': ['warn', 'always'],
|
|
18
|
-
'import/no-duplicates': ['warn'],
|
|
19
|
-
'import/newline-after-import': ['warn'], // import 语句后新增一行
|
|
20
|
-
'import/order': [
|
|
21
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
|
|
22
|
-
'warn',
|
|
23
|
-
{
|
|
24
|
-
groups: ['builtin', 'external', 'internal', ['parent', 'index', 'sibling'], 'object'],
|
|
25
|
-
pathGroups: [
|
|
26
|
-
{
|
|
27
|
-
pattern: '@rife/**',
|
|
28
|
-
group: 'external',
|
|
29
|
-
position: 'after',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
pattern: '@/**',
|
|
33
|
-
group: 'internal',
|
|
34
|
-
position: 'after',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
pattern: 'src/**',
|
|
38
|
-
group: 'internal',
|
|
39
|
-
position: 'after',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
// https://github.com/import-js/eslint-plugin-import/issues/1239#issuecomment-598064339
|
|
43
|
-
pattern: './*.less',
|
|
44
|
-
group: 'sibling',
|
|
45
|
-
position: 'after',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
// https://github.com/import-js/eslint-plugin-import/issues/1239#issuecomment-598064339
|
|
49
|
-
pattern: './*.scss',
|
|
50
|
-
group: 'sibling',
|
|
51
|
-
position: 'after',
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
pathGroupsExcludedImportTypes: [],
|
|
55
|
-
distinctGroup: false,
|
|
56
|
-
'newlines-between': 'always', // import 语句中间新增一行
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* rules : https://eslint.org/docs/latest/
|
|
3
|
+
* typescript-eslint : https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md
|
|
4
|
+
* eslint-plugin-import : https://github.com/benmosher/eslint-plugin-import
|
|
5
|
+
* eslint-config-prettier : https://github.com/prettier/eslint-config-prettier
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @type {any}
|
|
10
|
+
*/
|
|
11
|
+
module.exports = {
|
|
12
|
+
parser: '@typescript-eslint/parser',
|
|
13
|
+
plugins: ['@typescript-eslint', 'import'],
|
|
14
|
+
extends: ['prettier'],
|
|
15
|
+
rules: {
|
|
16
|
+
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
17
|
+
'object-shorthand': ['warn', 'always'],
|
|
18
|
+
'import/no-duplicates': ['warn'],
|
|
19
|
+
'import/newline-after-import': ['warn'], // import 语句后新增一行
|
|
20
|
+
'import/order': [
|
|
21
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
|
|
22
|
+
'warn',
|
|
23
|
+
{
|
|
24
|
+
groups: ['builtin', 'external', 'internal', ['parent', 'index', 'sibling'], 'object'],
|
|
25
|
+
pathGroups: [
|
|
26
|
+
{
|
|
27
|
+
pattern: '@rife/**',
|
|
28
|
+
group: 'external',
|
|
29
|
+
position: 'after',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
pattern: '@/**',
|
|
33
|
+
group: 'internal',
|
|
34
|
+
position: 'after',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
pattern: 'src/**',
|
|
38
|
+
group: 'internal',
|
|
39
|
+
position: 'after',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
// https://github.com/import-js/eslint-plugin-import/issues/1239#issuecomment-598064339
|
|
43
|
+
pattern: './*.less',
|
|
44
|
+
group: 'sibling',
|
|
45
|
+
position: 'after',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
// https://github.com/import-js/eslint-plugin-import/issues/1239#issuecomment-598064339
|
|
49
|
+
pattern: './*.scss',
|
|
50
|
+
group: 'sibling',
|
|
51
|
+
position: 'after',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
pathGroupsExcludedImportTypes: [],
|
|
55
|
+
distinctGroup: false,
|
|
56
|
+
'newlines-between': 'always', // import 语句中间新增一行
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
};
|
package/.prettierrc.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
// https://prettier.io/docs/en/options.html
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @type {any}
|
|
5
|
-
*/
|
|
6
|
-
module.exports = {
|
|
7
|
-
printWidth: 150,
|
|
8
|
-
useTabs: false, // 缩进使用空格
|
|
9
|
-
tabWidth: 4,
|
|
10
|
-
semi: true, // 强制加分号
|
|
11
|
-
singleQuote: true, // 强制单引号
|
|
12
|
-
quoteProps: 'as-needed',
|
|
13
|
-
jsxSingleQuote: false,
|
|
14
|
-
trailingComma: 'all',
|
|
15
|
-
jsxBracketSameLine: false, // jsx props结束符在新行
|
|
16
|
-
bracketSameLine: false, // jsx props结束符在新行
|
|
17
|
-
arrowParens: 'avoid',
|
|
18
|
-
endOfLine: 'lf',
|
|
19
|
-
bracketSpacing: true,
|
|
20
|
-
};
|
|
1
|
+
// https://prettier.io/docs/en/options.html
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @type {any}
|
|
5
|
+
*/
|
|
6
|
+
module.exports = {
|
|
7
|
+
printWidth: 150,
|
|
8
|
+
useTabs: false, // 缩进使用空格
|
|
9
|
+
tabWidth: 4,
|
|
10
|
+
semi: true, // 强制加分号
|
|
11
|
+
singleQuote: true, // 强制单引号
|
|
12
|
+
quoteProps: 'as-needed',
|
|
13
|
+
jsxSingleQuote: false,
|
|
14
|
+
trailingComma: 'all',
|
|
15
|
+
jsxBracketSameLine: false, // jsx props结束符在新行
|
|
16
|
+
bracketSameLine: false, // jsx props结束符在新行
|
|
17
|
+
arrowParens: 'avoid',
|
|
18
|
+
endOfLine: 'lf',
|
|
19
|
+
bracketSpacing: true,
|
|
20
|
+
};
|
package/.stylelintrc.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
// https://stylelint.io/user-guide/configure
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @type {any}
|
|
5
|
-
*/
|
|
6
|
-
module.exports = {
|
|
7
|
-
extends: ['stylelint-config-recess-order'], // 对属性自动排序
|
|
8
|
-
customSyntax: 'postcss-less', // postcss-less postcss-styled-syntax
|
|
9
|
-
overrides: [
|
|
10
|
-
{
|
|
11
|
-
files: ['**/*.less'],
|
|
12
|
-
customSyntax: 'postcss-less',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
files: ['**/*.ts', '**/*.tsx'],
|
|
16
|
-
customSyntax: 'postcss-styled-syntax',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
rules: {
|
|
20
|
-
// https://stylelint.io/user-guide/rules/list/at-rule-empty-line-before
|
|
21
|
-
'rule-empty-line-before': [
|
|
22
|
-
'always',
|
|
23
|
-
{
|
|
24
|
-
except: ['first-nested', 'after-single-line-comment'],
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
|
|
28
|
-
// https://stylelint.io/user-guide/rules/list/declaration-block-semicolon-newline-after
|
|
29
|
-
'declaration-block-semicolon-newline-after': ['always'],
|
|
30
|
-
|
|
31
|
-
'declaration-empty-line-before': ['never'],
|
|
32
|
-
},
|
|
33
|
-
ignoreFiles: ['node_modules'],
|
|
34
|
-
};
|
|
1
|
+
// https://stylelint.io/user-guide/configure
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @type {any}
|
|
5
|
+
*/
|
|
6
|
+
module.exports = {
|
|
7
|
+
extends: ['stylelint-config-recess-order'], // 对属性自动排序
|
|
8
|
+
customSyntax: 'postcss-less', // postcss-less postcss-styled-syntax
|
|
9
|
+
overrides: [
|
|
10
|
+
{
|
|
11
|
+
files: ['**/*.less'],
|
|
12
|
+
customSyntax: 'postcss-less',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
16
|
+
customSyntax: 'postcss-styled-syntax',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
rules: {
|
|
20
|
+
// https://stylelint.io/user-guide/rules/list/at-rule-empty-line-before
|
|
21
|
+
'rule-empty-line-before': [
|
|
22
|
+
'always',
|
|
23
|
+
{
|
|
24
|
+
except: ['first-nested', 'after-single-line-comment'],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
|
|
28
|
+
// https://stylelint.io/user-guide/rules/list/declaration-block-semicolon-newline-after
|
|
29
|
+
'declaration-block-semicolon-newline-after': ['always'],
|
|
30
|
+
|
|
31
|
+
'declaration-empty-line-before': ['never'],
|
|
32
|
+
},
|
|
33
|
+
ignoreFiles: ['node_modules'],
|
|
34
|
+
};
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "CommonJS",
|
|
5
|
-
"lib": ["ESNext", "DOM"],
|
|
6
|
-
"sourceMap": true,
|
|
7
|
-
"pretty": true,
|
|
8
|
-
"strict": true,
|
|
9
|
-
"strictPropertyInitialization": false,
|
|
10
|
-
"allowJs": true,
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"noImplicitAny": true,
|
|
13
|
-
"noUnusedLocals": false,
|
|
14
|
-
"noImplicitReturns": true,
|
|
15
|
-
"noFallthroughCasesInSwitch": true,
|
|
16
|
-
"moduleResolution": "node",
|
|
17
|
-
"resolveJsonModule": true,
|
|
18
|
-
"downlevelIteration": true,
|
|
19
|
-
"experimentalDecorators": true,
|
|
20
|
-
"esModuleInterop": true,
|
|
21
|
-
"skipLibCheck": true,
|
|
22
|
-
"importHelpers": true,
|
|
23
|
-
"jsx": "react",
|
|
24
|
-
"useUnknownInCatchVariables": false,
|
|
25
|
-
"forceConsistentCasingInFileNames": true
|
|
26
|
-
},
|
|
27
|
-
"include": ["./src/**/*"]
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"lib": ["ESNext", "DOM"],
|
|
6
|
+
"sourceMap": true,
|
|
7
|
+
"pretty": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"strictPropertyInitialization": false,
|
|
10
|
+
"allowJs": true,
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"noImplicitAny": true,
|
|
13
|
+
"noUnusedLocals": false,
|
|
14
|
+
"noImplicitReturns": true,
|
|
15
|
+
"noFallthroughCasesInSwitch": true,
|
|
16
|
+
"moduleResolution": "node",
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"downlevelIteration": true,
|
|
19
|
+
"experimentalDecorators": true,
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"skipLibCheck": true,
|
|
22
|
+
"importHelpers": true,
|
|
23
|
+
"jsx": "react",
|
|
24
|
+
"useUnknownInCatchVariables": false,
|
|
25
|
+
"forceConsistentCasingInFileNames": true
|
|
26
|
+
},
|
|
27
|
+
"include": ["./src/**/*"]
|
|
28
|
+
}
|