Skip to content

Commit 2b2179c

Browse files
Modified eslintrc.js to support storybook
1 parent b744c4f commit 2b2179c

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

.eslintrc.js

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ module.exports = {
1414
browser: true
1515
},
1616
// Rules order is important, please avoid shuffling them
17-
extends: ["plugin:vue/vue3-essential", "prettier", "plugin:storybook/recommended"],
17+
extends: [
18+
"plugin:vue/vue3-essential",
19+
"prettier",
20+
"plugin:storybook/recommended"
21+
],
1822
plugins: [// https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-file
1923
// required to lint *.vue files
2024
'vue' // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674
@@ -30,14 +34,41 @@ module.exports = {
3034
__QUASAR_SSR_SERVER__: 'readonly',
3135
__QUASAR_SSR_CLIENT__: 'readonly',
3236
__QUASAR_SSR_PWA__: 'readonly',
33-
process: 'readonly',
37+
process: true,
3438
Capacitor: 'readonly',
3539
chrome: 'readonly'
3640
},
3741
// add your custom rules here
3842
rules: {
43+
// allow async-await
44+
// 'generator-star-spacing': 'off',
45+
// allow paren-less arrow functions
46+
// 'arrow-parens': 'off',
47+
// 'one-var': 'off',
48+
49+
// 'import/first': 'off',
50+
// 'import/named': 'error',
51+
// 'import/namespace': 'error',
52+
// 'import/default': 'error',
53+
// 'import/export': 'error',
54+
// 'import/extensions': 'off',
55+
// 'import/no-unresolved': 'off',
56+
// 'import/no-extraneous-dependencies': 'off',
3957
'prefer-promise-reject-errors': 'off',
58+
// 'no-useless-escape': 'off',
4059
// allow debugger during development only
4160
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
42-
}
43-
};
61+
},
62+
"overrides": [
63+
{
64+
// or whatever matches stories specified in .storybook/main.js
65+
"files": ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],
66+
"rules": {
67+
// example of overriding a rule
68+
'storybook/hierarchy-separator': 'error',
69+
// example of disabling a rule
70+
'storybook/default-exports': 'off',
71+
}
72+
}
73+
]
74+
};

0 commit comments

Comments
 (0)