forked from damianidczak/vue-render-inspector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
161 lines (147 loc) · 4.38 KB
/
eslint.config.js
File metadata and controls
161 lines (147 loc) · 4.38 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import js from '@eslint/js'
import pluginVue from 'eslint-plugin-vue'
import eslintConfigPrettier from 'eslint-config-prettier'
export default [
// Base JavaScript configuration
js.configs.recommended,
// Vue configuration
...pluginVue.configs['flat/essential'],
// Prettier configuration (disables conflicting rules)
eslintConfigPrettier,
// Global ignores
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/build/**',
'**/coverage/**',
'vite.config.js',
'vitest.config.js'
]
},
// Custom rules
{
files: ['**/*.{js,mjs,cjs,vue}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
// Browser
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
console: 'readonly',
performance: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
requestAnimationFrame: 'readonly',
cancelAnimationFrame: 'readonly',
// Node.js
process: 'readonly',
global: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
// Testing
describe: 'readonly',
it: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
vi: 'readonly',
// Vue Render Inspector globals
__VUE_RENDER_INSPECTOR__: 'writable',
// Vue 3 globals (commonly used in examples)
ref: 'readonly',
reactive: 'readonly',
computed: 'readonly',
watch: 'readonly',
watchEffect: 'readonly',
onMounted: 'readonly',
onUnmounted: 'readonly',
h: 'readonly',
// Common variables in examples and code documentation
items: 'readonly',
data: 'readonly',
props: 'readonly',
newItem: 'readonly',
item: 'readonly',
handler: 'readonly',
handler1: 'readonly',
handler2: 'readonly',
processData: 'readonly',
largeObject: 'readonly',
expensiveCalculation: 'readonly',
anotherObject: 'readonly',
fetch: 'readonly',
filteredItems: 'readonly',
handleChange: 'readonly',
initializeComponent1: 'readonly',
initializeComponent2: 'readonly',
initializeComponent3: 'readonly',
processComplexObject: 'readonly',
processedData: 'readonly',
sortedItems: 'readonly',
sourceData: 'readonly',
derivedValue: 'readonly',
complexObject: 'readonly',
rawData: 'readonly',
computeValue: 'readonly',
processedItems: 'readonly',
prop1: 'readonly',
prop2: 'readonly',
prop3: 'readonly',
prop4: 'readonly',
filteredData: 'readonly',
expensive: 'readonly',
filtered: 'readonly',
handleData: 'readonly',
handler3: 'readonly',
handler4: 'readonly',
init1: 'readonly',
init2: 'readonly',
init3: 'readonly',
mapped: 'readonly',
newData: 'readonly',
result: 'readonly',
sorted: 'readonly',
source: 'readonly',
sourceValue: 'readonly',
sortedData: 'readonly',
selectedItems: 'readonly',
handleComplexDataChange: 'readonly'
}
},
rules: {
// Vue specific rules
'vue/multi-word-component-names': 'off',
'vue/no-reserved-component-names': 'off',
// General JavaScript rules
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_'
}
],
// Best practices
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-var': 'error',
'prefer-const': 'error',
'prefer-arrow-callback': 'error',
'prefer-template': 'error',
// ES6+ features
'arrow-body-style': ['error', 'as-needed'],
'object-shorthand': ['error', 'always'],
'no-duplicate-imports': 'error',
// Allow certain patterns
'no-prototype-builtins': 'off',
'no-empty': ['error', { allowEmptyCatch: true }]
}
}
]