@cabloy/lint 5.0.2 → 5.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/api/eslint.js +4 -0
- package/common/rules.js +3 -1
- package/front/eslint.js +20 -17
- package/package.json +1 -1
package/api/eslint.js
CHANGED
|
@@ -17,6 +17,10 @@ export default function eslintConfig(config, ...args) {
|
|
|
17
17
|
files: ['**/*.ts', '**/*.tsx'],
|
|
18
18
|
rules,
|
|
19
19
|
languageOptions: {
|
|
20
|
+
parserOptions: {
|
|
21
|
+
emitDecoratorMetadata: true,
|
|
22
|
+
experimentalDecorators: true,
|
|
23
|
+
},
|
|
20
24
|
globals: {
|
|
21
25
|
...globals.node,
|
|
22
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',
|
|
@@ -102,6 +103,7 @@ export const rules = {
|
|
|
102
103
|
],
|
|
103
104
|
'@typescript-eslint/no-empty-object-type': 'off',
|
|
104
105
|
'@typescript-eslint/no-unsafe-function-type': 'off',
|
|
106
|
+
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
|
|
105
107
|
'@stylistic/max-len': ['error', {
|
|
106
108
|
code: 130,
|
|
107
109
|
tabWidth: 2,
|
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: {
|
|
@@ -19,29 +34,17 @@ export default function eslintConfig(config, ...args) {
|
|
|
19
34
|
files: ['**/*.ts', '**/*.tsx'],
|
|
20
35
|
rules,
|
|
21
36
|
languageOptions: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
37
|
+
parserOptions: {
|
|
38
|
+
emitDecoratorMetadata: true,
|
|
39
|
+
experimentalDecorators: true,
|
|
25
40
|
},
|
|
41
|
+
globals: globalsMy,
|
|
26
42
|
},
|
|
27
43
|
}, {
|
|
28
44
|
files: ['**/*.vue'],
|
|
29
45
|
rules: Object.assign({}, rules, rulesVue),
|
|
30
46
|
languageOptions: {
|
|
31
|
-
globals:
|
|
32
|
-
...globals.browser,
|
|
33
|
-
...globals.jest,
|
|
34
|
-
ga: 'readonly', // Google Analytics
|
|
35
|
-
cordova: 'readonly',
|
|
36
|
-
__statics: 'readonly',
|
|
37
|
-
__QUASAR_SSR__: 'readonly',
|
|
38
|
-
__QUASAR_SSR_SERVER__: 'readonly',
|
|
39
|
-
__QUASAR_SSR_CLIENT__: 'readonly',
|
|
40
|
-
__QUASAR_SSR_PWA__: 'readonly',
|
|
41
|
-
process: 'readonly',
|
|
42
|
-
Capacitor: 'readonly',
|
|
43
|
-
chrome: 'readonly',
|
|
44
|
-
},
|
|
47
|
+
globals: globalsMy,
|
|
45
48
|
},
|
|
46
49
|
}, ...args);
|
|
47
50
|
}
|