-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
107 lines (106 loc) · 3.57 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
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
41
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
module.exports = {
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
// This option interrupts the configuration hierarchy at this file
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
root: true,
parserOptions: {
parser: "@babel/eslint-parser",
ecmaVersion: 2018,
// Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
},
env: {
browser: true,
'cypress/globals': true
},
// Rules order is important, please avoid shuffling them
extends: [
"plugin:vue/vue3-essential",
"plugin:vue/vue3-strongly-recommended",
"plugin:vue/vue3-recommended",
"prettier",
"plugin:storybook/recommended",
"eslint:recommended",
"plugin:cypress/recommended",
'@vue/standard'
],
plugins: [
// https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-file
// required to lint *.vue files
"vue", // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674
"cypress"
// Prettier has not been included as plugin to avoid performance impact
// add it as an extension for your IDE
],
globals: {
ga: "readonly",
// Google Analytics
cordova: "readonly",
__statics: "readonly",
__QUASAR_SSR__: "readonly",
__QUASAR_SSR_SERVER__: "readonly",
__QUASAR_SSR_CLIENT__: "readonly",
__QUASAR_SSR_PWA__: "readonly",
process: true,
Capacitor: "readonly",
chrome: "readonly",
},
// add your custom rules here
rules: {
// allow async-await
// 'generator-star-spacing': 'off',
// allow paren-less arrow functions
'no-console': [1, { "allow": ["warn", "error"] }],
'arrow-parens': 'off',
'one-var': 'off',
'no-unused-vars': 'off',
// "vue/require-explicit-emits": 'off',
"vue/custom-event-name-casing": 'off',
"vue/component-tags-order": ["error", { "order": ["template", "script", "style"] }],
"vue/no-multi-spaces": [
"error",
{
ignoreProperties: false,
},
],
"indent": ["error", 2],
"semi": [2, "never"],
"no-else-return": 1,
"consistent-return": "off",
"space-before-blocks": [2, "always"],
"space-infix-ops": [2, { int32Hint: false }],
"arrow-spacing": [2, { before: true, after: true }],
"key-spacing": [2, { beforeColon: false, afterColon: true }],
"eqeqeq": [2, "smart"],
"comma-dangle": [2, "never"],
"no-trailing-spaces": [2, { skipBlankLines: false }],
"quotes": [2, "single", { avoidEscape: true }],
"keyword-spacing": [2, { before: true, after: true }],
"block-spacing": [2, "always"],
"brace-style": [1, "1tbs", { allowSingleLine: true }],
"space-before-function-paren": ["error", "always"],
// 'import/first': 'off',
// 'import/named': 'error',
// 'import/namespace': 'error',
// 'import/default': 'error',
// 'import/export': 'error',
// 'import/extensions': 'off',
// 'import/no-unresolved': 'off',
// 'import/no-extraneous-dependencies': 'off',
"prefer-promise-reject-errors": "off",
// allow debugger during development only
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
},
overrides: [
{
// or whatever matches stories specified in .storybook/main.js
files: ["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"],
rules: {
// example of overriding a rule
"storybook/hierarchy-separator": "error",
// example of disabling a rule
"storybook/default-exports": "off",
},
},
],
};