@nitra/eslint-config 2.0.27 → 2.1.0

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.
Files changed (2) hide show
  1. package/index.js +34 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -153,12 +153,20 @@ const vue = [
153
153
  }
154
154
  ]
155
155
 
156
+ const vue2 = [
157
+ {
158
+ rules: {
159
+ 'vue/no-deprecated-v-bind-sync': 'off'
160
+ }
161
+ }
162
+ ]
163
+
156
164
  /**
157
165
  * Eslint правила
158
- * @param {{node?: Array, vue?: Array}} params список директорій до яких примінити Eslint правили
166
+ * @param {{node?: Array, vue?: Array, vue2?: Array}} params список директорій до яких примінити Eslint правили
159
167
  * @returns {Array} конфігурації eslint
160
168
  */
161
- export function getConfig(params = { node: [], vue: [] }) {
169
+ export function getConfig(params = { node: [], vue: [], vue2: [] }) {
162
170
  const result = all
163
171
 
164
172
  // якщо присутні nodejs проекти в monorepo
@@ -171,7 +179,7 @@ export function getConfig(params = { node: [], vue: [] }) {
171
179
  result.push(...nodeConfig)
172
180
  }
173
181
 
174
- // якщо присутні nodejs проекти в monorepo
182
+ // Правила для Vue3
175
183
  if (params.vue?.length) {
176
184
  // по певним файлам правили
177
185
  const filesVite = params.vue.map(name => `${name}/**/vite.config.js`)
@@ -188,6 +196,7 @@ export function getConfig(params = { node: [], vue: [] }) {
188
196
  files,
189
197
  ...configObject
190
198
  }))
199
+
191
200
  result.push(...vueConfig)
192
201
 
193
202
  // Для js файлів всередині Vue проектів правила
@@ -200,5 +209,27 @@ export function getConfig(params = { node: [], vue: [] }) {
200
209
  result.push(...vueJSConfig)
201
210
  }
202
211
 
212
+ // Правила для Vue2
213
+ if (params.vue2?.length) {
214
+ // по певним файлам правили
215
+ // Для Vue файлів правила
216
+ const files = params.vue2.map(name => `${name}/**/*.vue`)
217
+ const vueConfig = [...vueAllVite, ...vue, ...vue2].map(configObject => ({
218
+ files,
219
+ ...configObject
220
+ }))
221
+
222
+ result.push(...vueConfig)
223
+
224
+ // Для js файлів всередині Vue проектів правила
225
+ const filesJS = params.vue2.map(name => `${name}/**/*.js`)
226
+ const vueJSConfig = vueAllVite.map(configObject => ({
227
+ files: filesJS,
228
+ ...configObject
229
+ }))
230
+ // @ts-ignore
231
+ result.push(...vueJSConfig)
232
+ }
233
+
203
234
  return result
204
235
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitra/eslint-config",
3
- "version": "2.0.27",
3
+ "version": "2.1.0",
4
4
  "description": "A Eslint shareable config for projects using 'Vue' and 'Node'",
5
5
  "type": "module",
6
6
  "exports": "./index.js",