@cabloy/lint 4.0.0
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/LICENSE.en-US +3 -0
- package/LICENSE.zh-CN +3 -0
- package/api/eslint.js +112 -0
- package/api/prettier.js +8 -0
- package/api/tsconfig.base.cjs.json +32 -0
- package/api/tsconfig.base.esm.json +4 -0
- package/front/eslint.js +124 -0
- package/front/prettier.js +8 -0
- package/front/tsconfig.base.cjs.json +4 -0
- package/front/tsconfig.base.esm.json +8 -0
- package/package.json +23 -0
package/LICENSE.en-US
ADDED
package/LICENSE.zh-CN
ADDED
package/api/eslint.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
const rules = {
|
|
2
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
3
|
+
'prefer-const': [
|
|
4
|
+
'error',
|
|
5
|
+
{
|
|
6
|
+
destructuring: 'all',
|
|
7
|
+
ignoreReadBeforeAssign: true,
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
11
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
12
|
+
'max-len': [
|
|
13
|
+
'error',
|
|
14
|
+
{
|
|
15
|
+
code: 120,
|
|
16
|
+
ignoreComments: true,
|
|
17
|
+
ignoreTrailingComments: true,
|
|
18
|
+
ignoreUrls: true,
|
|
19
|
+
ignoreStrings: true,
|
|
20
|
+
ignoreTemplateLiterals: true,
|
|
21
|
+
ignoreRegExpLiterals: true,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
'no-undef': [
|
|
25
|
+
'error',
|
|
26
|
+
{
|
|
27
|
+
typeof: false,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
'array-bracket-spacing': ['error', 'never'],
|
|
31
|
+
'no-empty': [
|
|
32
|
+
'error',
|
|
33
|
+
{
|
|
34
|
+
allowEmptyCatch: true,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
'no-empty-function': [
|
|
38
|
+
'error',
|
|
39
|
+
{
|
|
40
|
+
allow: [
|
|
41
|
+
'functions',
|
|
42
|
+
'arrowFunctions',
|
|
43
|
+
'generatorFunctions',
|
|
44
|
+
'methods',
|
|
45
|
+
'generatorMethods',
|
|
46
|
+
'getters',
|
|
47
|
+
'setters',
|
|
48
|
+
'constructors',
|
|
49
|
+
'asyncFunctions',
|
|
50
|
+
'asyncMethods',
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
'no-constant-condition': [
|
|
55
|
+
'error',
|
|
56
|
+
{
|
|
57
|
+
checkLoops: false,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
'one-var-declaration-per-line': [0],
|
|
61
|
+
'space-before-function-paren': [
|
|
62
|
+
'error',
|
|
63
|
+
{
|
|
64
|
+
anonymous: 'always',
|
|
65
|
+
named: 'never',
|
|
66
|
+
asyncArrow: 'always',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
'generator-star-spacing': [0],
|
|
70
|
+
'newline-per-chained-call': [0],
|
|
71
|
+
'vue/multi-word-component-names': [0],
|
|
72
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
73
|
+
'@typescript-eslint/no-unused-vars': [
|
|
74
|
+
'error',
|
|
75
|
+
{
|
|
76
|
+
argsIgnorePattern: '^_',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
'@typescript-eslint/no-this-alias': 'off',
|
|
80
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
|
|
81
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
82
|
+
'error',
|
|
83
|
+
{
|
|
84
|
+
'ts-expect-error': 'allow-with-description',
|
|
85
|
+
'ts-ignore': 'allow-with-description',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
module.exports = {
|
|
91
|
+
parser: '@typescript-eslint/parser',
|
|
92
|
+
extends: ['plugin:@typescript-eslint/recommended', 'prettier'],
|
|
93
|
+
plugins: ['@typescript-eslint'],
|
|
94
|
+
parserOptions: {},
|
|
95
|
+
rules,
|
|
96
|
+
env: {
|
|
97
|
+
browser: true,
|
|
98
|
+
es2021: true,
|
|
99
|
+
node: true,
|
|
100
|
+
},
|
|
101
|
+
globals: {
|
|
102
|
+
// $: true,
|
|
103
|
+
// util: true,
|
|
104
|
+
// env: true,
|
|
105
|
+
// App: true,
|
|
106
|
+
// getApp: true,
|
|
107
|
+
// Page: true,
|
|
108
|
+
// wx: true,
|
|
109
|
+
// define: true,
|
|
110
|
+
Proxy: true,
|
|
111
|
+
},
|
|
112
|
+
};
|
package/api/prettier.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"incremental": true,
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"declarationMap": true,
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"noEmit": false,
|
|
9
|
+
"noEmitOnError": true,
|
|
10
|
+
"target": "ES2020",
|
|
11
|
+
"module": "NodeNext",
|
|
12
|
+
"moduleResolution": "NodeNext",
|
|
13
|
+
"strict": true,
|
|
14
|
+
"noImplicitAny": false,
|
|
15
|
+
"noUnusedLocals": true,
|
|
16
|
+
"noUnusedParameters": true,
|
|
17
|
+
"strictPropertyInitialization": false,
|
|
18
|
+
"useDefineForClassFields": true,
|
|
19
|
+
"forceConsistentCasingInFileNames": true,
|
|
20
|
+
"resolvePackageJsonImports": true,
|
|
21
|
+
"resolveJsonModule": true,
|
|
22
|
+
"allowSyntheticDefaultImports": true,
|
|
23
|
+
"stripInternal": true,
|
|
24
|
+
"esModuleInterop": true,
|
|
25
|
+
"isolatedModules": true,
|
|
26
|
+
"experimentalDecorators": true,
|
|
27
|
+
"emitDecoratorMetadata": true,
|
|
28
|
+
"allowJs": false,
|
|
29
|
+
"checkJs": false,
|
|
30
|
+
"skipLibCheck": true,
|
|
31
|
+
}
|
|
32
|
+
}
|
package/front/eslint.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
const rules = {
|
|
2
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
3
|
+
'prefer-const': [
|
|
4
|
+
'error',
|
|
5
|
+
{
|
|
6
|
+
destructuring: 'all',
|
|
7
|
+
ignoreReadBeforeAssign: true,
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
11
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
12
|
+
'max-len': [
|
|
13
|
+
'error',
|
|
14
|
+
{
|
|
15
|
+
code: 120,
|
|
16
|
+
ignoreComments: true,
|
|
17
|
+
ignoreTrailingComments: true,
|
|
18
|
+
ignoreUrls: true,
|
|
19
|
+
ignoreStrings: true,
|
|
20
|
+
ignoreTemplateLiterals: true,
|
|
21
|
+
ignoreRegExpLiterals: true,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
'no-undef': [
|
|
25
|
+
'error',
|
|
26
|
+
{
|
|
27
|
+
typeof: false,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
'array-bracket-spacing': ['error', 'never'],
|
|
31
|
+
'no-empty': [
|
|
32
|
+
'error',
|
|
33
|
+
{
|
|
34
|
+
allowEmptyCatch: true,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
'no-empty-function': [
|
|
38
|
+
'error',
|
|
39
|
+
{
|
|
40
|
+
allow: [
|
|
41
|
+
'functions',
|
|
42
|
+
'arrowFunctions',
|
|
43
|
+
'generatorFunctions',
|
|
44
|
+
'methods',
|
|
45
|
+
'generatorMethods',
|
|
46
|
+
'getters',
|
|
47
|
+
'setters',
|
|
48
|
+
'constructors',
|
|
49
|
+
'asyncFunctions',
|
|
50
|
+
'asyncMethods',
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
'no-constant-condition': [
|
|
55
|
+
'error',
|
|
56
|
+
{
|
|
57
|
+
checkLoops: false,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
'one-var-declaration-per-line': [0],
|
|
61
|
+
'space-before-function-paren': [
|
|
62
|
+
'error',
|
|
63
|
+
{
|
|
64
|
+
anonymous: 'always',
|
|
65
|
+
named: 'never',
|
|
66
|
+
asyncArrow: 'always',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
'generator-star-spacing': [0],
|
|
70
|
+
'newline-per-chained-call': [0],
|
|
71
|
+
'vue/multi-word-component-names': [0],
|
|
72
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
73
|
+
'@typescript-eslint/no-unused-vars': [
|
|
74
|
+
'error',
|
|
75
|
+
{
|
|
76
|
+
argsIgnorePattern: '^_',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
'@typescript-eslint/no-this-alias': 'off',
|
|
80
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
|
|
81
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
82
|
+
'error',
|
|
83
|
+
{
|
|
84
|
+
'ts-expect-error': 'allow-with-description',
|
|
85
|
+
'ts-ignore': 'allow-with-description',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
module.exports = {
|
|
91
|
+
parser: '@typescript-eslint/parser',
|
|
92
|
+
extends: ['plugin:@typescript-eslint/recommended','plugin:vue/vue3-essential', 'prettier'],
|
|
93
|
+
plugins: ['@typescript-eslint','vue'],
|
|
94
|
+
parserOptions: {
|
|
95
|
+
extraFileExtensions: ['.vue'],
|
|
96
|
+
},
|
|
97
|
+
rules,
|
|
98
|
+
env: {
|
|
99
|
+
browser: true,
|
|
100
|
+
es2021: true,
|
|
101
|
+
node: true,
|
|
102
|
+
},
|
|
103
|
+
globals: {
|
|
104
|
+
ga: 'readonly', // Google Analytics
|
|
105
|
+
cordova: 'readonly',
|
|
106
|
+
__statics: 'readonly',
|
|
107
|
+
__QUASAR_SSR__: 'readonly',
|
|
108
|
+
__QUASAR_SSR_SERVER__: 'readonly',
|
|
109
|
+
__QUASAR_SSR_CLIENT__: 'readonly',
|
|
110
|
+
__QUASAR_SSR_PWA__: 'readonly',
|
|
111
|
+
process: 'readonly',
|
|
112
|
+
Capacitor: 'readonly',
|
|
113
|
+
chrome: 'readonly',
|
|
114
|
+
// $: true,
|
|
115
|
+
// util: true,
|
|
116
|
+
// env: true,
|
|
117
|
+
// App: true,
|
|
118
|
+
// getApp: true,
|
|
119
|
+
// Page: true,
|
|
120
|
+
// wx: true,
|
|
121
|
+
// define: true,
|
|
122
|
+
Proxy: true,
|
|
123
|
+
},
|
|
124
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cabloy/lint",
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Node Style Guide for EggBorn/Cabloy.",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"api",
|
|
10
|
+
"front"
|
|
11
|
+
],
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
14
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
15
|
+
"eslint": "^8.57.0",
|
|
16
|
+
"eslint-config-prettier": "^8.10.0",
|
|
17
|
+
"eslint-plugin-jsdoc": "^46.10.1",
|
|
18
|
+
"eslint-plugin-node": "^11.1.0",
|
|
19
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
20
|
+
"eslint-plugin-vue": "^9.24.1",
|
|
21
|
+
"prettier": "^3.2.5"
|
|
22
|
+
}
|
|
23
|
+
}
|