@iqrf/eslint-config 0.0.9 → 0.0.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/dist/index.d.ts +60 -10
- package/dist/index.js +41 -1
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,24 @@ import { Linter } from 'eslint';
|
|
|
18
18
|
|
|
19
19
|
declare const comments: Linter.FlatConfig[];
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Copyright 2024 MICRORISC s.r.o.
|
|
23
|
+
*
|
|
24
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
25
|
+
* you may not use this file except in compliance with the License.
|
|
26
|
+
* You may obtain a copy of the License at
|
|
27
|
+
*
|
|
28
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
29
|
+
*
|
|
30
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
31
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
32
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
33
|
+
* See the License for the specific language governing permissions and
|
|
34
|
+
* limitations under the License.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
declare const cypress: Linter.FlatConfig[];
|
|
38
|
+
|
|
21
39
|
/**
|
|
22
40
|
* Copyright 2024 MICRORISC s.r.o.
|
|
23
41
|
*
|
|
@@ -58,6 +76,24 @@ declare const imports: (options: Options$2) => Linter.FlatConfig[];
|
|
|
58
76
|
|
|
59
77
|
declare const javascript: Linter.FlatConfig[];
|
|
60
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Copyright 2024 MICRORISC s.r.o.
|
|
81
|
+
*
|
|
82
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
83
|
+
* you may not use this file except in compliance with the License.
|
|
84
|
+
* You may obtain a copy of the License at
|
|
85
|
+
*
|
|
86
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
87
|
+
*
|
|
88
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
89
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
90
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
91
|
+
* See the License for the specific language governing permissions and
|
|
92
|
+
* limitations under the License.
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
declare const jsDoc: Linter.FlatConfig[];
|
|
96
|
+
|
|
61
97
|
/**
|
|
62
98
|
* Copyright 2024 MICRORISC s.r.o.
|
|
63
99
|
*
|
|
@@ -245,7 +281,7 @@ interface Options {
|
|
|
245
281
|
}
|
|
246
282
|
/**
|
|
247
283
|
* Retrieves the Vue version from the package.json file.
|
|
248
|
-
* @return number Vue version
|
|
284
|
+
* @return {number} Vue version
|
|
249
285
|
*/
|
|
250
286
|
declare function getVueVersion(): number;
|
|
251
287
|
declare const vue: (options: Options) => Linter.FlatConfig[];
|
|
@@ -269,35 +305,39 @@ declare const vue: (options: Options) => Linter.FlatConfig[];
|
|
|
269
305
|
declare const vueI18n: Linter.FlatConfig[];
|
|
270
306
|
|
|
271
307
|
/**
|
|
272
|
-
* @
|
|
308
|
+
* @const {boolean} isInEditor Is the code running in an editor?
|
|
273
309
|
*/
|
|
274
310
|
declare const isInEditor: boolean;
|
|
275
311
|
/**
|
|
276
|
-
* @
|
|
312
|
+
* @const {boolean} hasCypress Does the project have Cypress installed?
|
|
313
|
+
*/
|
|
314
|
+
declare const hasCypress: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* @const {boolean} hasPinia Does the project have Pinia installed?
|
|
277
317
|
*/
|
|
278
318
|
declare const hasPinia: boolean;
|
|
279
319
|
/**
|
|
280
|
-
* @
|
|
320
|
+
* @const {boolean} hasTypescript Does the project have TypeScript installed?
|
|
281
321
|
*/
|
|
282
322
|
declare const hasTypescript: boolean;
|
|
283
323
|
/**
|
|
284
|
-
* @
|
|
324
|
+
* @const {boolean} hasVitest Does the project have Vitest installed?
|
|
285
325
|
*/
|
|
286
326
|
declare const hasVitest: boolean;
|
|
287
327
|
/**
|
|
288
|
-
* @
|
|
328
|
+
* @const {boolean} hasVue Does the project have Vue installed?
|
|
289
329
|
*/
|
|
290
330
|
declare const hasVue: boolean;
|
|
291
331
|
/**
|
|
292
|
-
* @
|
|
332
|
+
* @const {boolean} hasVueI18n Does the project have vue-i18n installed?
|
|
293
333
|
*/
|
|
294
334
|
declare const hasVueI18n: boolean;
|
|
295
335
|
/**
|
|
296
|
-
* @
|
|
336
|
+
* @const {boolean} hasVuetify Does the project have Vuetify installed?
|
|
297
337
|
*/
|
|
298
338
|
declare const hasVuetify: boolean;
|
|
299
339
|
/**
|
|
300
|
-
* @
|
|
340
|
+
* @const {string | undefined} versionVue Vue version
|
|
301
341
|
*/
|
|
302
342
|
declare const versionVue: string | undefined;
|
|
303
343
|
|
|
@@ -317,10 +357,14 @@ declare const versionVue: string | undefined;
|
|
|
317
357
|
* limitations under the License.
|
|
318
358
|
*/
|
|
319
359
|
interface IqrfEslintOptions {
|
|
360
|
+
/** Cypress support - auto-enabled by default. */
|
|
361
|
+
cypress: boolean;
|
|
320
362
|
/** List of paths to ignore. */
|
|
321
363
|
ignores?: string[];
|
|
322
364
|
/** Import support - enabled by default. */
|
|
323
365
|
import: boolean;
|
|
366
|
+
/** JSDoc support - enabled by default. */
|
|
367
|
+
jsdoc: boolean;
|
|
324
368
|
/** Markdown support - enabled by default. */
|
|
325
369
|
markdown: boolean;
|
|
326
370
|
/** Pinia support - auto-enabled by default. */
|
|
@@ -357,6 +401,12 @@ interface IqrfEslintOptions {
|
|
|
357
401
|
* limitations under the License.
|
|
358
402
|
*/
|
|
359
403
|
|
|
404
|
+
/**
|
|
405
|
+
* Generate ESLint configuration.
|
|
406
|
+
* @param {Partial<IqrfEslintOptions>} options Configuration options.
|
|
407
|
+
* @param {Linter.FlatConfig | Linter.FlatConfig[]} config Additional ESLint configuration.
|
|
408
|
+
* @return {Linter.FlatConfig[]} Generated ESLint configuration.
|
|
409
|
+
*/
|
|
360
410
|
declare function iqrfEslint(options?: Partial<IqrfEslintOptions>, config?: Linter.FlatConfig | Linter.FlatConfig[]): Linter.FlatConfig[];
|
|
361
411
|
|
|
362
|
-
export { comments, getVueVersion, hasPinia, hasTypescript, hasVitest, hasVue, hasVueI18n, hasVuetify, imports, iqrfEslint, isInEditor, javascript, json, markdown, pinia, promise, regexp, stylistic, typescript, unicorn, versionVue, vitest, vue, vueI18n };
|
|
412
|
+
export { comments, cypress, getVueVersion, hasCypress, hasPinia, hasTypescript, hasVitest, hasVue, hasVueI18n, hasVuetify, imports, iqrfEslint, isInEditor, javascript, jsDoc, json, markdown, pinia, promise, regexp, stylistic, typescript, unicorn, versionVue, vitest, vue, vueI18n };
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,12 @@ var comments = [
|
|
|
18
18
|
}
|
|
19
19
|
];
|
|
20
20
|
|
|
21
|
+
// src/configs/cypress.ts
|
|
22
|
+
import pluginCypress from "eslint-plugin-cypress/flat";
|
|
23
|
+
var cypress = [
|
|
24
|
+
pluginCypress.configs.recommended
|
|
25
|
+
];
|
|
26
|
+
|
|
21
27
|
// src/configs/imports.ts
|
|
22
28
|
import path from "node:path";
|
|
23
29
|
import process2 from "node:process";
|
|
@@ -159,6 +165,24 @@ var javascript = [
|
|
|
159
165
|
}
|
|
160
166
|
];
|
|
161
167
|
|
|
168
|
+
// src/configs/jsdoc.ts
|
|
169
|
+
import pluginJsDoc from "eslint-plugin-jsdoc";
|
|
170
|
+
var jsDoc = [
|
|
171
|
+
pluginJsDoc.configs["flat/recommended"],
|
|
172
|
+
{
|
|
173
|
+
settings: {
|
|
174
|
+
jsdoc: {
|
|
175
|
+
tagNamePreference: {
|
|
176
|
+
constant: "const",
|
|
177
|
+
const: "const",
|
|
178
|
+
member: "var",
|
|
179
|
+
returns: "return"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
];
|
|
185
|
+
|
|
162
186
|
// src/configs/json.ts
|
|
163
187
|
import pluginJson from "eslint-plugin-jsonc";
|
|
164
188
|
var json = pluginJson.configs["flat/recommended-with-json"];
|
|
@@ -328,6 +352,7 @@ import tsEslint from "typescript-eslint";
|
|
|
328
352
|
import process3 from "node:process";
|
|
329
353
|
import { getPackageInfoSync, isPackageExists } from "local-pkg";
|
|
330
354
|
var isInEditor = !!(!process3.env.CI && (process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE || process3.env.VIM));
|
|
355
|
+
var hasCypress = isPackageExists("cypress");
|
|
331
356
|
var hasPinia = isPackageExists("pinia");
|
|
332
357
|
var hasTypescript = isPackageExists("typescript");
|
|
333
358
|
var hasVitest = isPackageExists("vitest");
|
|
@@ -575,8 +600,14 @@ var vueI18n = [
|
|
|
575
600
|
// src/index.ts
|
|
576
601
|
function iqrfEslint(options = {}, config = []) {
|
|
577
602
|
const {
|
|
578
|
-
|
|
603
|
+
cypress: enableCypress = hasCypress,
|
|
604
|
+
ignores = [
|
|
605
|
+
".pnpm-store/",
|
|
606
|
+
"coverage/",
|
|
607
|
+
"dist/"
|
|
608
|
+
],
|
|
579
609
|
import: enableImport = true,
|
|
610
|
+
jsdoc: enableJsDoc = true,
|
|
580
611
|
markdown: enableMarkdown = true,
|
|
581
612
|
pinia: enablePinia = hasPinia,
|
|
582
613
|
promise: enablePromise = true,
|
|
@@ -630,6 +661,12 @@ function iqrfEslint(options = {}, config = []) {
|
|
|
630
661
|
if (enableVitest) {
|
|
631
662
|
configs3.push(...vitest);
|
|
632
663
|
}
|
|
664
|
+
if (enableJsDoc) {
|
|
665
|
+
configs3.push(...jsDoc);
|
|
666
|
+
}
|
|
667
|
+
if (enableCypress) {
|
|
668
|
+
configs3.push(...cypress);
|
|
669
|
+
}
|
|
633
670
|
configs3.push(...json);
|
|
634
671
|
configs3.push(...stylistic);
|
|
635
672
|
configs3.push(...unicorn);
|
|
@@ -640,7 +677,9 @@ function iqrfEslint(options = {}, config = []) {
|
|
|
640
677
|
}
|
|
641
678
|
export {
|
|
642
679
|
comments,
|
|
680
|
+
cypress,
|
|
643
681
|
getVueVersion,
|
|
682
|
+
hasCypress,
|
|
644
683
|
hasPinia,
|
|
645
684
|
hasTypescript,
|
|
646
685
|
hasVitest,
|
|
@@ -651,6 +690,7 @@ export {
|
|
|
651
690
|
iqrfEslint,
|
|
652
691
|
isInEditor,
|
|
653
692
|
javascript,
|
|
693
|
+
jsDoc,
|
|
654
694
|
json,
|
|
655
695
|
markdown,
|
|
656
696
|
pinia,
|
package/package.json
CHANGED
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
"@eslint/js": "^9.6.0",
|
|
19
19
|
"@intlify/eslint-plugin-vue-i18n": "^3.0.0",
|
|
20
20
|
"@stylistic/eslint-plugin": "^2.3.0",
|
|
21
|
-
"eslint-config-flat-gitignore": "^0.1.
|
|
21
|
+
"eslint-config-flat-gitignore": "^0.1.7",
|
|
22
22
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
23
|
+
"eslint-plugin-cypress": "^3.3.0",
|
|
23
24
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
24
25
|
"eslint-plugin-import-x": "^0.5.3",
|
|
25
|
-
"eslint-plugin-jsdoc": "^48.
|
|
26
|
+
"eslint-plugin-jsdoc": "^48.6.0",
|
|
26
27
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
27
28
|
"eslint-plugin-markdown": "^5.0.0",
|
|
28
29
|
"eslint-plugin-math": "^0.6.0",
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"globals": "^15.8.0",
|
|
39
40
|
"jsonc-eslint-parser": "^2.4.0",
|
|
40
41
|
"local-pkg": "^0.5.0",
|
|
41
|
-
"typescript-eslint": "^7.
|
|
42
|
+
"typescript-eslint": "^7.16.0",
|
|
42
43
|
"vue-eslint-parser": "^9.4.3"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
@@ -81,7 +82,7 @@
|
|
|
81
82
|
},
|
|
82
83
|
"type": "module",
|
|
83
84
|
"types": "dist/index.d.ts",
|
|
84
|
-
"version": "0.0.
|
|
85
|
+
"version": "0.0.11",
|
|
85
86
|
"scripts": {
|
|
86
87
|
"build": "tsup",
|
|
87
88
|
"lint": "eslint .",
|