@rife/config 0.0.6-beta.5 → 0.0.6-beta.7
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/.prettierrc.js +27 -27
- package/eslint.mjs +114 -112
- package/package.json +5 -11
- package/tsconfig.json +32 -32
package/.prettierrc.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
// https://prettier.io/docs/en/options.html
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @type {any}
|
|
5
|
-
*/
|
|
6
|
-
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
1
|
+
// https://prettier.io/docs/en/options.html
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @type {any}
|
|
5
|
+
*/
|
|
6
|
+
module.exports = {
|
|
7
|
+
printWidth: 135,
|
|
8
|
+
useTabs: false, // 缩进使用空格
|
|
9
|
+
tabWidth: 4,
|
|
10
|
+
semi: true, // 强制加分号
|
|
11
|
+
singleQuote: true, // 强制单引号
|
|
12
|
+
quoteProps: 'as-needed',
|
|
13
|
+
jsxSingleQuote: false,
|
|
14
|
+
trailingComma: 'all',
|
|
15
|
+
bracketSameLine: true, // jsx props结束符在新行
|
|
16
|
+
arrowParens: 'avoid',
|
|
17
|
+
endOfLine: 'lf',
|
|
18
|
+
bracketSpacing: true,
|
|
19
|
+
overrides: [
|
|
20
|
+
{
|
|
21
|
+
files: ['*.wxml'],
|
|
22
|
+
options: {
|
|
23
|
+
parser: 'html',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
package/eslint.mjs
CHANGED
|
@@ -1,112 +1,114 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* rules : https://eslint.org/docs/latest/rules/
|
|
3
|
-
* typescript-eslint : https://typescript-eslint.io/getting-started/
|
|
4
|
-
* eslint-plugin-import : https://github.com/benmosher/eslint-plugin-import
|
|
5
|
-
* eslint-config-prettier : https://github.com/prettier/eslint-config-prettier
|
|
6
|
-
* @antfu/eslint-config : https://eslint-config.antfu.me/configs
|
|
7
|
-
*/
|
|
8
|
-
import parser from '@typescript-eslint/parser';
|
|
9
|
-
import prettier from 'eslint-config-prettier';
|
|
10
|
-
import importPlugin from 'eslint-plugin-import';
|
|
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
|
-
'import/
|
|
41
|
-
'import/no-
|
|
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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
1
|
+
/**
|
|
2
|
+
* rules : https://eslint.org/docs/latest/rules/
|
|
3
|
+
* typescript-eslint : https://typescript-eslint.io/getting-started/
|
|
4
|
+
* eslint-plugin-import : https://github.com/benmosher/eslint-plugin-import
|
|
5
|
+
* eslint-config-prettier : https://github.com/prettier/eslint-config-prettier
|
|
6
|
+
* @antfu/eslint-config : https://eslint-config.antfu.me/configs
|
|
7
|
+
*/
|
|
8
|
+
import parser from '@typescript-eslint/parser';
|
|
9
|
+
import prettier from 'eslint-config-prettier';
|
|
10
|
+
import importPlugin from 'eslint-plugin-import';
|
|
11
|
+
|
|
12
|
+
const ignores = ['*/node_modules/**/*', '*/dist/**/*'];
|
|
13
|
+
|
|
14
|
+
export function eslint() {
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
languageOptions: {
|
|
18
|
+
parser,
|
|
19
|
+
ecmaVersion: 'latest',
|
|
20
|
+
},
|
|
21
|
+
plugins: {
|
|
22
|
+
import: importPlugin,
|
|
23
|
+
},
|
|
24
|
+
files: ['**/*.{js,jsx,ts,tsx,mjs,cjs}'],
|
|
25
|
+
ignores,
|
|
26
|
+
rules: {
|
|
27
|
+
'unicode-bom': ['error', 'never'],
|
|
28
|
+
eqeqeq: ['warn', 'always'], // 使用三等号
|
|
29
|
+
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
30
|
+
'prefer-const': [
|
|
31
|
+
'error',
|
|
32
|
+
{
|
|
33
|
+
destructuring: 'any',
|
|
34
|
+
ignoreReadBeforeAssign: false,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
'no-useless-computed-key': 'error',
|
|
38
|
+
'object-shorthand': 'error',
|
|
39
|
+
'prefer-template': 'error',
|
|
40
|
+
'import/newline-after-import': ['warn'], // import 语句后新增一行
|
|
41
|
+
'import/no-empty-named-blocks': ['warn'], // 不能空导入
|
|
42
|
+
'import/no-duplicates': ['warn', { 'prefer-inline': true }], // 不能重复从一个文件导入
|
|
43
|
+
'import/no-useless-path-segments': [
|
|
44
|
+
'error',
|
|
45
|
+
{
|
|
46
|
+
noUselessIndex: true,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
'import/order': [
|
|
50
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
|
|
51
|
+
'warn',
|
|
52
|
+
{
|
|
53
|
+
groups: ['builtin', 'external', 'internal', ['parent', 'index', 'sibling'], 'object'],
|
|
54
|
+
pathGroups: [
|
|
55
|
+
{
|
|
56
|
+
pattern: '@rife/**',
|
|
57
|
+
group: 'external',
|
|
58
|
+
position: 'after',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
pattern: '@/**',
|
|
62
|
+
group: 'internal',
|
|
63
|
+
position: 'after',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
pattern: 'src/**',
|
|
67
|
+
group: 'internal',
|
|
68
|
+
position: 'after',
|
|
69
|
+
},
|
|
70
|
+
// https://github.com/import-js/eslint-plugin-import/issues/1239#issuecomment-598064339
|
|
71
|
+
{
|
|
72
|
+
pattern: '**/*.+(css|sass|less|scss|pcss|styl)',
|
|
73
|
+
patternOptions: { dot: true, nocomment: true },
|
|
74
|
+
group: 'unknown',
|
|
75
|
+
position: 'after',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
pattern: '{.,..}/**/*.+(css|sass|less|scss|pcss|styl)',
|
|
79
|
+
patternOptions: { dot: true, nocomment: true },
|
|
80
|
+
group: 'unknown',
|
|
81
|
+
position: 'after',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
pattern: '**/*.+(svg|png|gif|jpg|jpeg|webp|bmp|ico)',
|
|
85
|
+
patternOptions: { dot: true, nocomment: true },
|
|
86
|
+
group: 'unknown',
|
|
87
|
+
position: 'after',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
pattern: '{.,..}/**/*.+(svg|png|gif|jpg|jpeg|webp|bmp|ico)',
|
|
91
|
+
patternOptions: { dot: true, nocomment: true },
|
|
92
|
+
group: 'unknown',
|
|
93
|
+
position: 'after',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
pathGroupsExcludedImportTypes: [],
|
|
97
|
+
distinctGroup: false,
|
|
98
|
+
'newlines-between': 'always', // import 语句中间新增一行
|
|
99
|
+
named: {
|
|
100
|
+
// 导入名称按字母排序
|
|
101
|
+
enabled: true,
|
|
102
|
+
types: 'types-first',
|
|
103
|
+
},
|
|
104
|
+
alphabetize: {
|
|
105
|
+
// 导入名称按字母排序
|
|
106
|
+
order: 'asc',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
prettier,
|
|
113
|
+
];
|
|
114
|
+
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rife/config",
|
|
3
|
-
"version": "0.0.6-beta.
|
|
4
|
-
"description": "",
|
|
5
|
-
"author": "",
|
|
6
|
-
"license": "ISC",
|
|
7
|
-
"keywords": [],
|
|
8
|
-
"main": "index.js",
|
|
3
|
+
"version": "0.0.6-beta.7",
|
|
9
4
|
"files": [
|
|
10
5
|
"tsconfig.json",
|
|
11
6
|
".prettierrc.js",
|
|
12
7
|
"eslint.mjs"
|
|
13
8
|
],
|
|
14
9
|
"dependencies": {
|
|
15
|
-
"@typescript-eslint/parser": "^8.
|
|
16
|
-
"eslint": "^9.
|
|
17
|
-
"eslint-config-prettier": "^10.
|
|
10
|
+
"@typescript-eslint/parser": "^8.34.0",
|
|
11
|
+
"eslint": "^9.28.0",
|
|
12
|
+
"eslint-config-prettier": "^10.1.5",
|
|
18
13
|
"eslint-plugin-import": "^2.31.0",
|
|
19
|
-
"prettier": "^3.
|
|
14
|
+
"prettier": "^3.5.3"
|
|
20
15
|
},
|
|
21
16
|
"rife": {
|
|
22
17
|
"hostDependencies": {
|
|
@@ -24,7 +19,6 @@
|
|
|
24
19
|
}
|
|
25
20
|
},
|
|
26
21
|
"scripts": {
|
|
27
|
-
"lint": "eslint . --fix",
|
|
28
22
|
"release": "pnpm publish --registry https://registry.npmjs.org --no-git-checks"
|
|
29
23
|
}
|
|
30
24
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "
|
|
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
|
-
"noUnusedParameters": false,
|
|
15
|
-
"noImplicitReturns": true,
|
|
16
|
-
"noFallthroughCasesInSwitch": true,
|
|
17
|
-
"moduleResolution": "
|
|
18
|
-
"resolveJsonModule": true,
|
|
19
|
-
"downlevelIteration": true,
|
|
20
|
-
"experimentalDecorators": true,
|
|
21
|
-
"esModuleInterop": true,
|
|
22
|
-
"skipLibCheck": true,
|
|
23
|
-
"importHelpers": true,
|
|
24
|
-
"jsx": "react",
|
|
25
|
-
"useUnknownInCatchVariables": false,
|
|
26
|
-
"forceConsistentCasingInFileNames": true,
|
|
27
|
-
"incremental": true,
|
|
28
|
-
"noImplicitThis": true,
|
|
29
|
-
"alwaysStrict": true
|
|
30
|
-
},
|
|
31
|
-
"include": ["
|
|
32
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "esnext",
|
|
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
|
+
"noUnusedParameters": false,
|
|
15
|
+
"noImplicitReturns": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"moduleResolution": "bundler",
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"downlevelIteration": true,
|
|
20
|
+
"experimentalDecorators": true,
|
|
21
|
+
"esModuleInterop": true,
|
|
22
|
+
"skipLibCheck": true,
|
|
23
|
+
"importHelpers": true,
|
|
24
|
+
"jsx": "react",
|
|
25
|
+
"useUnknownInCatchVariables": false,
|
|
26
|
+
"forceConsistentCasingInFileNames": true,
|
|
27
|
+
"incremental": true,
|
|
28
|
+
"noImplicitThis": true,
|
|
29
|
+
"alwaysStrict": true
|
|
30
|
+
},
|
|
31
|
+
"include": ["package.json"]
|
|
32
|
+
}
|