@cabloy/lint 5.0.1 → 5.0.3
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/api/eslint.js +5 -0
- package/common/rules.js +2 -1
- package/common/rulesVue.js +1 -0
- package/front/eslint.js +21 -17
- package/package.json +1 -1
package/api/eslint.js
CHANGED
|
@@ -11,11 +11,16 @@ export default function eslintConfig(config, ...args) {
|
|
|
11
11
|
jsx: true,
|
|
12
12
|
},
|
|
13
13
|
typescript: true,
|
|
14
|
+
gitignore: false,
|
|
14
15
|
}, config);
|
|
15
16
|
return antfu(config, {
|
|
16
17
|
files: ['**/*.ts', '**/*.tsx'],
|
|
17
18
|
rules,
|
|
18
19
|
languageOptions: {
|
|
20
|
+
parserOptions: {
|
|
21
|
+
emitDecoratorMetadata: true,
|
|
22
|
+
experimentalDecorators: true,
|
|
23
|
+
},
|
|
19
24
|
globals: {
|
|
20
25
|
...globals.node,
|
|
21
26
|
...globals.jest,
|
package/common/rules.js
CHANGED
|
@@ -6,6 +6,7 @@ export const rules = {
|
|
|
6
6
|
'n/prefer-global/process': 'off',
|
|
7
7
|
'unicorn/error-message': 'off',
|
|
8
8
|
'antfu/if-newline': 'off',
|
|
9
|
+
'antfu/top-level-function': 'off',
|
|
9
10
|
'import/no-duplicates': 'off',
|
|
10
11
|
'eslint-comments/no-unlimited-disable': 'off',
|
|
11
12
|
'prefer-promise-reject-errors': 'off',
|
|
@@ -62,7 +63,7 @@ export const rules = {
|
|
|
62
63
|
// 'no-setter-return': 'off', // no effect for typescript check
|
|
63
64
|
'ts/method-signature-style': 'off',
|
|
64
65
|
'ts/no-redeclare': 'off',
|
|
65
|
-
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
|
|
66
|
+
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'separate-type-imports', prefer: 'type-imports' }],
|
|
66
67
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
67
68
|
'@typescript-eslint/no-namespace': 'off',
|
|
68
69
|
'@typescript-eslint/no-explicit-any': 'off',
|
package/common/rulesVue.js
CHANGED
package/front/eslint.js
CHANGED
|
@@ -3,6 +3,21 @@ import globals from 'globals';
|
|
|
3
3
|
import { rules } from '../common/rules.js';
|
|
4
4
|
import { rulesVue } from '../common/rulesVue.js';
|
|
5
5
|
|
|
6
|
+
const globalsMy = {
|
|
7
|
+
...globals.browser,
|
|
8
|
+
...globals.jest,
|
|
9
|
+
ga: 'readonly', // Google Analytics
|
|
10
|
+
cordova: 'readonly',
|
|
11
|
+
__statics: 'readonly',
|
|
12
|
+
__QUASAR_SSR__: 'readonly',
|
|
13
|
+
__QUASAR_SSR_SERVER__: 'readonly',
|
|
14
|
+
__QUASAR_SSR_CLIENT__: 'readonly',
|
|
15
|
+
__QUASAR_SSR_PWA__: 'readonly',
|
|
16
|
+
process: 'readonly',
|
|
17
|
+
Capacitor: 'readonly',
|
|
18
|
+
chrome: 'readonly',
|
|
19
|
+
};
|
|
20
|
+
|
|
6
21
|
export default function eslintConfig(config, ...args) {
|
|
7
22
|
config = Object.assign({
|
|
8
23
|
stylistic: {
|
|
@@ -13,34 +28,23 @@ export default function eslintConfig(config, ...args) {
|
|
|
13
28
|
},
|
|
14
29
|
typescript: true,
|
|
15
30
|
vue: true,
|
|
31
|
+
gitignore: false,
|
|
16
32
|
}, config);
|
|
17
33
|
return antfu(config, {
|
|
18
34
|
files: ['**/*.ts', '**/*.tsx'],
|
|
19
35
|
rules,
|
|
20
36
|
languageOptions: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
37
|
+
parserOptions: {
|
|
38
|
+
emitDecoratorMetadata: true,
|
|
39
|
+
experimentalDecorators: true,
|
|
24
40
|
},
|
|
41
|
+
globals: globalsMy,
|
|
25
42
|
},
|
|
26
43
|
}, {
|
|
27
44
|
files: ['**/*.vue'],
|
|
28
45
|
rules: Object.assign({}, rules, rulesVue),
|
|
29
46
|
languageOptions: {
|
|
30
|
-
globals:
|
|
31
|
-
...globals.browser,
|
|
32
|
-
...globals.jest,
|
|
33
|
-
ga: 'readonly', // Google Analytics
|
|
34
|
-
cordova: 'readonly',
|
|
35
|
-
__statics: 'readonly',
|
|
36
|
-
__QUASAR_SSR__: 'readonly',
|
|
37
|
-
__QUASAR_SSR_SERVER__: 'readonly',
|
|
38
|
-
__QUASAR_SSR_CLIENT__: 'readonly',
|
|
39
|
-
__QUASAR_SSR_PWA__: 'readonly',
|
|
40
|
-
process: 'readonly',
|
|
41
|
-
Capacitor: 'readonly',
|
|
42
|
-
chrome: 'readonly',
|
|
43
|
-
},
|
|
47
|
+
globals: globalsMy,
|
|
44
48
|
},
|
|
45
49
|
}, ...args);
|
|
46
50
|
}
|