@nitra/eslint-config 3.5.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 +26 -1
- package/package.json +2 -1
package/index.js
CHANGED
|
@@ -11,8 +11,10 @@ import markdownPlugin from 'eslint-plugin-markdown'
|
|
|
11
11
|
import nodePlugin from 'eslint-plugin-n'
|
|
12
12
|
import oxlint from 'eslint-plugin-oxlint'
|
|
13
13
|
import securityPlugin from 'eslint-plugin-security'
|
|
14
|
+
import sonarjsPlugin from 'eslint-plugin-sonarjs'
|
|
14
15
|
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
15
16
|
import vuePlugin from 'eslint-plugin-vue'
|
|
17
|
+
import vueEslintParser from 'vue-eslint-parser'
|
|
16
18
|
import { configs as ymlConfigs } from 'eslint-plugin-yml'
|
|
17
19
|
import { mergeProcessors } from 'eslint-merge-processors'
|
|
18
20
|
import processorVueBlocks from 'eslint-processor-vue-blocks'
|
|
@@ -169,6 +171,24 @@ const all = [
|
|
|
169
171
|
'security/detect-unsafe-regex': 'off'
|
|
170
172
|
}
|
|
171
173
|
},
|
|
174
|
+
// eslint-plugin-sonarjs — recommended (bugs, complexity, duplicates; лише JS-подібні файли)
|
|
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
|
+
},
|
|
172
192
|
// @e18e/eslint-plugin — recommended (modernization + module replacements + performance)
|
|
173
193
|
{
|
|
174
194
|
files: UNICORN_FILES,
|
|
@@ -326,7 +346,12 @@ function pushVueConfigs(result, dirs, options = {}) {
|
|
|
326
346
|
|
|
327
347
|
const filesVue = dirs.map(name => `${name}/**/*.vue`)
|
|
328
348
|
const vueConfigs = [...vueAllVite, ...vue, ...extraVueConfigs]
|
|
329
|
-
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
|
+
})
|
|
330
355
|
|
|
331
356
|
const filesJS = dirs.map(name => `${name}/**/*.js`)
|
|
332
357
|
result.push(...vueAllVite.map(configObject => ({ files: filesJS, ...configObject })))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitra/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "An ESLint shareable config for projects using Vue and Node",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"eslint-plugin-n": "^17.24.0",
|
|
39
39
|
"eslint-plugin-oxlint": "^1.59.0",
|
|
40
40
|
"eslint-plugin-security": "^4.0.0",
|
|
41
|
+
"eslint-plugin-sonarjs": "^4.0.2",
|
|
41
42
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
42
43
|
"eslint-plugin-vue": "^10.8.0",
|
|
43
44
|
"eslint-plugin-yml": "^3.3.1",
|