@nitra/eslint-config 3.6.0 → 3.6.1
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.
- package/index.js +23 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import securityPlugin from 'eslint-plugin-security'
|
|
|
14
14
|
import sonarjsPlugin from 'eslint-plugin-sonarjs'
|
|
15
15
|
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
16
16
|
import vuePlugin from 'eslint-plugin-vue'
|
|
17
|
+
import vueEslintParser from 'vue-eslint-parser'
|
|
17
18
|
import { configs as ymlConfigs } from 'eslint-plugin-yml'
|
|
18
19
|
import { mergeProcessors } from 'eslint-merge-processors'
|
|
19
20
|
import processorVueBlocks from 'eslint-processor-vue-blocks'
|
|
@@ -172,6 +173,22 @@ const all = [
|
|
|
172
173
|
},
|
|
173
174
|
// eslint-plugin-sonarjs — recommended (bugs, complexity, duplicates; лише JS-подібні файли)
|
|
174
175
|
{ ...sonarjsPlugin.configs.recommended, files: UNICORN_FILES },
|
|
176
|
+
/**
|
|
177
|
+
* Віртуальні файли з `eslint-processor-vue-blocks` (`…/Component.vue/…_script.js`) без `<template>` —
|
|
178
|
+
* для них немає `defineTemplateBodyVisitor`, тож `sonarjs/unused-import` хибно скаржиться на імпорти лише для шаблону.
|
|
179
|
+
*/
|
|
180
|
+
{
|
|
181
|
+
files: [
|
|
182
|
+
'**/*.vue/**/*.js',
|
|
183
|
+
'**/*.vue/**/*.mjs',
|
|
184
|
+
'**/*.vue/**/*.cjs',
|
|
185
|
+
'**/*.vue/**/*.ts',
|
|
186
|
+
'**/*.vue/**/*.tsx'
|
|
187
|
+
],
|
|
188
|
+
rules: {
|
|
189
|
+
'sonarjs/unused-import': 'off'
|
|
190
|
+
}
|
|
191
|
+
},
|
|
175
192
|
// @e18e/eslint-plugin — recommended (modernization + module replacements + performance)
|
|
176
193
|
{
|
|
177
194
|
files: UNICORN_FILES,
|
|
@@ -329,7 +346,12 @@ function pushVueConfigs(result, dirs, options = {}) {
|
|
|
329
346
|
|
|
330
347
|
const filesVue = dirs.map(name => `${name}/**/*.vue`)
|
|
331
348
|
const vueConfigs = [...vueAllVite, ...vue, ...extraVueConfigs]
|
|
332
|
-
result.push(...vueConfigs.map(configObject => ({ files: filesVue, ...configObject }))
|
|
349
|
+
result.push(...vueConfigs.map(configObject => ({ files: filesVue, ...configObject })), {
|
|
350
|
+
files: filesVue,
|
|
351
|
+
languageOptions: {
|
|
352
|
+
parser: vueEslintParser
|
|
353
|
+
}
|
|
354
|
+
})
|
|
333
355
|
|
|
334
356
|
const filesJS = dirs.map(name => `${name}/**/*.js`)
|
|
335
357
|
result.push(...vueAllVite.map(configObject => ({ files: filesJS, ...configObject })))
|