@nitra/eslint-config 3.6.9 → 3.6.11
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 +10 -5
- package/package.json +10 -9
- package/types/graphql-eslint-anchor.d.ts +42 -0
- /package/{index.d.ts → types/index.d.ts} +0 -0
package/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import jsdocPlugin from 'eslint-plugin-jsdoc'
|
|
|
9
9
|
import { configs as jsoncConfigs } from 'eslint-plugin-jsonc'
|
|
10
10
|
import markdownPlugin from 'eslint-plugin-markdown'
|
|
11
11
|
import nodePlugin from 'eslint-plugin-n'
|
|
12
|
+
import noUnsanitized from 'eslint-plugin-no-unsanitized'
|
|
12
13
|
import oxlint from 'eslint-plugin-oxlint'
|
|
13
14
|
import securityPlugin from 'eslint-plugin-security'
|
|
14
15
|
import sonarjsPlugin from 'eslint-plugin-sonarjs'
|
|
@@ -62,7 +63,7 @@ const GRAPHQL_EXTRACTED_DOCUMENT_FILES = [
|
|
|
62
63
|
]
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
|
-
* Обгортає правило graphql-eslint і логує runtime-падіння visitor callbacks, не змінюючи поведінку (після логу помилка
|
|
66
|
+
* Обгортає правило graphql-eslint і логує runtime-падіння visitor callbacks, не змінюючи поведінку (після логу помилка знову викидається).
|
|
66
67
|
* @param {import('eslint').Rule.RuleModule} ruleImpl оригінальна імплементація правила
|
|
67
68
|
* @param {string} ruleName ім'я правила для debug payload
|
|
68
69
|
* @returns {import('eslint').Rule.RuleModule} обгорнуте правило з runtime-логуванням
|
|
@@ -91,7 +92,7 @@ function instrumentGraphqlRuleForDebug(ruleImpl, ruleName) {
|
|
|
91
92
|
ruleName === '@graphql-eslint/no-deprecated' &&
|
|
92
93
|
selector === 'ObjectValue' &&
|
|
93
94
|
error instanceof TypeError &&
|
|
94
|
-
error.message.includes(
|
|
95
|
+
error.message.includes('deprecationReason')
|
|
95
96
|
if (knownNoDeprecatedCrash) {
|
|
96
97
|
return
|
|
97
98
|
}
|
|
@@ -117,7 +118,7 @@ const graphqlEslintPluginWithDebug = {
|
|
|
117
118
|
|
|
118
119
|
/**
|
|
119
120
|
* `@graphql-eslint/naming-convention` з operations-recommended плюс сумісність із Hasura:
|
|
120
|
-
* аргументи на кшталт `_set`, `_eq`
|
|
121
|
+
* аргументи на кшталт `_set`, `_eq` починаються з символу підкреслення — без `allowLeadingUnderscore`
|
|
121
122
|
* правило глобально лає будь-який `Name`, що починається з `_` (не лише camelCase для змінних).
|
|
122
123
|
* @see https://the-guild.dev/graphql/eslint/rules/naming-convention
|
|
123
124
|
*/
|
|
@@ -235,7 +236,9 @@ const all = [
|
|
|
235
236
|
},
|
|
236
237
|
rules: {
|
|
237
238
|
...js.configs.recommended.rules,
|
|
238
|
-
'no-unused-vars': NO_UNUSED_VARS_RULE
|
|
239
|
+
'no-unused-vars': NO_UNUSED_VARS_RULE,
|
|
240
|
+
// `continue` дозволено як легітимний контроль потоку в циклах.
|
|
241
|
+
'no-continue': 'off'
|
|
239
242
|
}
|
|
240
243
|
},
|
|
241
244
|
// Unicorn правила (лише JS-подібні файли — узгоджено з блоком рекомендованих правил ESLint)
|
|
@@ -284,6 +287,8 @@ const all = [
|
|
|
284
287
|
'security/detect-unsafe-regex': 'off'
|
|
285
288
|
}
|
|
286
289
|
},
|
|
290
|
+
// eslint-plugin-no-unsanitized — innerHTML / insertAdjacentHTML тощо без санітизації (Mozilla; лише JS-подібні файли)
|
|
291
|
+
{ ...noUnsanitized.configs.recommended, files: UNICORN_FILES },
|
|
287
292
|
// eslint-plugin-sonarjs — recommended (bugs, complexity, duplicates; лише JS-подібні файли)
|
|
288
293
|
{ ...sonarjsPlugin.configs.recommended, files: UNICORN_FILES },
|
|
289
294
|
/**
|
|
@@ -336,7 +341,7 @@ const vueVite = [
|
|
|
336
341
|
]
|
|
337
342
|
|
|
338
343
|
/**
|
|
339
|
-
*
|
|
344
|
+
* Глобальні змінні для типового Vite + auto-import: Composition API, vue-router, Quasar, пакет vue-apollo-composable.
|
|
340
345
|
* У пакеті `globals` ключ `vue` містить лише макроси `<script setup>` (`defineProps` тощо), без `onMounted` /
|
|
341
346
|
* `createApp` / `useRouter` — без цього списку `no-undef` хибно спрацьовує у `.vue` і `.js` під директоріями Vue.
|
|
342
347
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitra/eslint-config",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.11",
|
|
4
4
|
"description": "An ESLint shareable config for projects using Vue and Node",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"graphql-eslint-anchor.js",
|
|
18
|
-
"index.
|
|
19
|
-
"
|
|
18
|
+
"index.js",
|
|
19
|
+
"types"
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
|
-
"types": "./index.d.ts",
|
|
22
|
+
"types": "./types/index.d.ts",
|
|
23
23
|
"exports": "./index.js",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@e18e/eslint-plugin": "^0.3.0",
|
|
26
26
|
"@eslint/compat": "^2.0.5",
|
|
27
27
|
"@eslint/js": "^10.0.1",
|
|
28
28
|
"@graphql-eslint/eslint-plugin": "^4.4.0",
|
|
29
|
-
"@graphql-tools/graphql-tag-pluck": "^8.3.
|
|
30
|
-
"@graphql-tools/utils": "^
|
|
29
|
+
"@graphql-tools/graphql-tag-pluck": "^8.3.30",
|
|
30
|
+
"@graphql-tools/utils": "^11.0.1",
|
|
31
31
|
"@microsoft/eslint-plugin-sdl": "^1.1.0",
|
|
32
32
|
"eslint": "^10.2.0",
|
|
33
33
|
"eslint-merge-processors": "^2.0.0",
|
|
@@ -36,15 +36,16 @@
|
|
|
36
36
|
"eslint-plugin-jsonc": "^3.1.2",
|
|
37
37
|
"eslint-plugin-markdown": "^5.1.0",
|
|
38
38
|
"eslint-plugin-n": "^17.24.0",
|
|
39
|
-
"eslint-plugin-
|
|
39
|
+
"eslint-plugin-no-unsanitized": "^4.1.5",
|
|
40
|
+
"eslint-plugin-oxlint": "^1.60.0",
|
|
40
41
|
"eslint-plugin-security": "^4.0.0",
|
|
41
|
-
"eslint-plugin-sonarjs": "^4.0.
|
|
42
|
+
"eslint-plugin-sonarjs": "^4.0.3",
|
|
42
43
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
43
44
|
"eslint-plugin-vue": "^10.8.0",
|
|
44
45
|
"eslint-plugin-yml": "^3.3.1",
|
|
45
46
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
46
47
|
"globals": "^17.5.0",
|
|
47
|
-
"graphql": "^16.
|
|
48
|
+
"graphql": "^16.13.2",
|
|
48
49
|
"vue-eslint-parser": "^10.4.0"
|
|
49
50
|
},
|
|
50
51
|
"engines": {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Шлях для graphql-config: для віртуальних блоків Vue — фізичний .vue, інакше той самий filePath.
|
|
3
|
+
* @param {string} filePath шлях файлу, який обробляє processor
|
|
4
|
+
* @returns {string} шлях для loadOnDiskGraphQLConfig та getProjectForFile
|
|
5
|
+
*/
|
|
6
|
+
export function graphQLConfigPathAnchor(filePath?: string): string
|
|
7
|
+
/**
|
|
8
|
+
* Парсер graphql-eslint: той самий anchor для filePath, щоб loadGraphQLConfig знаходив проєкт для віртуальних document.graphql з-під Vue.
|
|
9
|
+
* @param {string} code вміст GraphQL-документа
|
|
10
|
+
* @param {import('eslint').Linter.ParserOptions} options опції ESLint (filePath тощо)
|
|
11
|
+
* @returns {ReturnType<typeof baseParser.parseForESLint>} AST і parserServices для graphql-eslint
|
|
12
|
+
*/
|
|
13
|
+
export function graphqlParseForESLintWithAnchor(
|
|
14
|
+
code: string,
|
|
15
|
+
options?: import('eslint').Linter.ParserOptions
|
|
16
|
+
): ReturnType<typeof baseParser.parseForESLint>
|
|
17
|
+
export namespace graphqlCodefileProcessor {
|
|
18
|
+
namespace meta {
|
|
19
|
+
export let name: string
|
|
20
|
+
export { version }
|
|
21
|
+
}
|
|
22
|
+
let supportsAutofix: boolean
|
|
23
|
+
function preprocess(code: any, filePath: any): any[]
|
|
24
|
+
function postprocess(messages: any, filePath: any): any
|
|
25
|
+
}
|
|
26
|
+
export namespace graphqlParserWithConfigAnchor {
|
|
27
|
+
let meta_1: {
|
|
28
|
+
name: string
|
|
29
|
+
version: string | undefined
|
|
30
|
+
}
|
|
31
|
+
export { meta_1 as meta }
|
|
32
|
+
export { graphqlParseForESLintWithAnchor as parseForESLint }
|
|
33
|
+
}
|
|
34
|
+
declare const baseParser: {
|
|
35
|
+
parseForESLint: typeof import('@graphql-eslint/eslint-plugin').parseForESLint
|
|
36
|
+
meta: {
|
|
37
|
+
name: string
|
|
38
|
+
version: string | undefined
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
import { version } from '@graphql-eslint/eslint-plugin/meta'
|
|
42
|
+
export {}
|
|
File without changes
|