-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
120 lines (115 loc) · 3.03 KB
/
.eslintrc.cjs
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
108
109
110
111
112
113
114
115
116
117
118
119
120
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')
const DENIED_PATH_GROUPS = [
'app/**',
'pages/*/**',
'features/*/**',
'entities/*/**',
'shared/*/*/**',
'../**/app',
'../**/pages',
'../**/features',
'../**/entities',
'../**/shared',
]
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
env: {
node: true,
'vue/setup-compiler-macros': true,
},
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
settings: {
'import/resolver': {
typescript: {},
},
},
plugins: ['tailwindcss'],
extends: [
'eslint:recommended',
'airbnb-base',
'plugin:vue/vue3-recommended',
'@vue/eslint-config-typescript/recommended',
'@vue/eslint-config-prettier',
'plugin:storybook/recommended',
'plugin:tailwindcss/recommended',
],
rules: {
// base rules
'no-console': 'warn',
'no-debugger': 'warn',
'arrow-spacing': 'error',
'no-duplicate-imports': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-const': 'error',
'prefer-template': 'error',
'no-unreachable': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'no-fallthrough': 'error',
'consistent-return': 'error',
'no-param-reassign': [
'warn',
{ props: true, ignorePropertyModificationsFor: ['draft'] },
],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
// import rules
'import/extensions': [
'error',
'ignorePackages',
{ js: 'never', jsx: 'never', ts: 'never', tsx: 'never', cjs: 'never' },
],
'import/prefer-default-export': 'off',
'import/order': [
'warn',
{ groups: ['builtin', 'external'], warnOnUnassignedImports: true },
],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'./.eslintrc.cjs',
'./vite.config.ts',
'**/*.stories.ts',
'**/*.test.ts',
'**/mock.ts',
'./.storybook/**/*',
],
},
],
'no-restricted-imports': [2, { patterns: DENIED_PATH_GROUPS }],
// vue rules
'vue/html-self-closing': ['error', { html: { void: 'always' } }],
'vue/component-name-in-template-casing': [
'error',
'PascalCase',
{ registeredComponentsOnly: false },
],
'vue/no-useless-v-bind': 'error',
'vue/block-lang': ['error', { script: { lang: 'ts' } }],
'vue/component-api-style': ['error', ['script-setup', 'composition']],
'vue/custom-event-name-casing': ['error'],
'vue/no-boolean-default': 'error',
'vue/no-child-content': 'error',
'vue/no-duplicate-attr-inheritance': 'error',
'vue/no-restricted-call-after-await': 'error',
// prettier
'prettier/prettier': [
'warn',
{
tabWidth: 2,
singleQuote: true,
semi: false,
trailingComma: 'es5',
},
],
},
}