@iqrf/eslint-config 0.1.0 → 0.1.2
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/README.md +29 -11
- package/dist/index.d.ts +9 -3
- package/dist/index.js +12 -9
- package/package.json +14 -13
package/README.md
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
# @iqrf/eslint-config
|
|
1
|
+
# @iqrf/eslint-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://gitlab.iqrf.org/open-source/iqrf-gateway-webapp-utils/eslint-config/-/commits/master)
|
|
4
|
+
[](https://www.npmjs.com/package/@iqrf/iqrf-repository-client)
|
|
5
|
+
[](https://www.npmjs.com/package/@iqrf/iqrf-repository-client)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
Flat ESLint configuration for JavaScript, TypeScript, Vue.js and Vuetify 3.
|
|
4
9
|
|
|
5
10
|
## Features
|
|
6
11
|
|
|
7
12
|
- [ESLint flat configuration](https://eslint.org/docs/latest/use/configure/configuration-files)
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
13
|
+
- Languages:
|
|
14
|
+
- JavaScript (with JSDoc)
|
|
15
|
+
- JSON
|
|
16
|
+
- Markdown
|
|
17
|
+
- TypeScript
|
|
18
|
+
- State managements:
|
|
19
|
+
- Pinia
|
|
20
|
+
- Testing frameworks:
|
|
21
|
+
- Cypress
|
|
22
|
+
- Vitest
|
|
23
|
+
- Vue.js 2 and 3
|
|
24
|
+
- vue-i18n
|
|
11
25
|
- Vuetify 3
|
|
12
|
-
- JSON
|
|
13
|
-
- Markdown
|
|
14
|
-
- Sort imports
|
|
15
|
-
-
|
|
16
26
|
|
|
17
27
|
## Installation
|
|
18
28
|
|
|
@@ -39,11 +49,19 @@ import { iqrfEslint } from '@iqrf/eslint-config';
|
|
|
39
49
|
|
|
40
50
|
export default iqrfEslint(
|
|
41
51
|
{
|
|
52
|
+
cypress: true,
|
|
53
|
+
ignores: ['dist/', 'node_modules/'],
|
|
54
|
+
import: true,
|
|
55
|
+
jsdoc: true,
|
|
56
|
+
markdown: true,
|
|
57
|
+
pinia: true,
|
|
58
|
+
promise: true,
|
|
59
|
+
regExp: true,
|
|
42
60
|
typescript: true,
|
|
61
|
+
vitest: true,
|
|
43
62
|
vue: true,
|
|
63
|
+
vueI18n: true,
|
|
44
64
|
vuetify: true,
|
|
45
|
-
json: true,
|
|
46
|
-
markdown: true,
|
|
47
65
|
},
|
|
48
66
|
[
|
|
49
67
|
// Add your custom rules here
|
package/dist/index.d.ts
CHANGED
|
@@ -52,11 +52,11 @@ declare const cypress: Linter.FlatConfig[];
|
|
|
52
52
|
* limitations under the License.
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
|
-
interface Options$
|
|
55
|
+
interface Options$3 {
|
|
56
56
|
typescript: boolean;
|
|
57
57
|
vue: boolean;
|
|
58
58
|
}
|
|
59
|
-
declare const imports: (options: Options$
|
|
59
|
+
declare const imports: (options: Options$3) => Linter.FlatConfig[];
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* Copyright 2024 MICRORISC s.r.o.
|
|
@@ -74,7 +74,13 @@ declare const imports: (options: Options$2) => Linter.FlatConfig[];
|
|
|
74
74
|
* limitations under the License.
|
|
75
75
|
*/
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
/**
|
|
78
|
+
* JavaScript config options
|
|
79
|
+
*/
|
|
80
|
+
interface Options$2 {
|
|
81
|
+
typescript: boolean;
|
|
82
|
+
}
|
|
83
|
+
declare const javascript: (options: Options$2) => Linter.FlatConfig[];
|
|
78
84
|
|
|
79
85
|
/**
|
|
80
86
|
* Copyright 2024 MICRORISC s.r.o.
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,13 @@ var commonRules = (options) => ({
|
|
|
33
33
|
"error",
|
|
34
34
|
"prefer-inline"
|
|
35
35
|
],
|
|
36
|
+
"import-x/no-named-as-default-member": "off",
|
|
37
|
+
"import-x/no-unresolved": [
|
|
38
|
+
"warn",
|
|
39
|
+
options.vue ? {
|
|
40
|
+
ignore: ["^virtual:"]
|
|
41
|
+
} : {}
|
|
42
|
+
],
|
|
36
43
|
"import-x/order": [
|
|
37
44
|
"error",
|
|
38
45
|
{
|
|
@@ -58,12 +65,6 @@ var commonRules = (options) => ({
|
|
|
58
65
|
],
|
|
59
66
|
"newlines-between": "always"
|
|
60
67
|
}
|
|
61
|
-
],
|
|
62
|
-
"import-x/no-unresolved": [
|
|
63
|
-
"warn",
|
|
64
|
-
options.vue ? {
|
|
65
|
-
ignore: ["^virtual:"]
|
|
66
|
-
} : {}
|
|
67
68
|
]
|
|
68
69
|
});
|
|
69
70
|
var imports = (options) => [
|
|
@@ -116,7 +117,7 @@ var imports = (options) => [
|
|
|
116
117
|
// src/configs/javascript.ts
|
|
117
118
|
import pluginEslint from "@eslint/js";
|
|
118
119
|
import globals from "globals";
|
|
119
|
-
var javascript = [
|
|
120
|
+
var javascript = (options) => [
|
|
120
121
|
{
|
|
121
122
|
languageOptions: {
|
|
122
123
|
ecmaVersion: 2022,
|
|
@@ -151,7 +152,7 @@ var javascript = [
|
|
|
151
152
|
"error",
|
|
152
153
|
"unix"
|
|
153
154
|
],
|
|
154
|
-
"no-unused-vars": "warn",
|
|
155
|
+
"no-unused-vars": options.typescript ? "off" : "warn",
|
|
155
156
|
"prefer-const": "error",
|
|
156
157
|
"quotes": [
|
|
157
158
|
"error",
|
|
@@ -661,7 +662,9 @@ function iqrfEslint(options = {}, config = []) {
|
|
|
661
662
|
if (ignoreFiles.length > 0) {
|
|
662
663
|
configs3.push(configGitignore({ files: ignoreFiles }));
|
|
663
664
|
}
|
|
664
|
-
configs3.push(...javascript
|
|
665
|
+
configs3.push(...javascript({
|
|
666
|
+
typescript: enableTypescript
|
|
667
|
+
}));
|
|
665
668
|
configs3.push(...comments);
|
|
666
669
|
if (enableTypescript) {
|
|
667
670
|
configs3.push(...typescript);
|
package/package.json
CHANGED
|
@@ -16,22 +16,23 @@
|
|
|
16
16
|
"description": "ESLint configuration for IQRF projects",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@eslint/compat": "^1.1.1",
|
|
19
|
-
"@eslint/js": "^9.
|
|
19
|
+
"@eslint/js": "^9.7.0",
|
|
20
20
|
"@intlify/eslint-plugin-vue-i18n": "^3.0.0",
|
|
21
21
|
"@stylistic/eslint-plugin": "^2.3.0",
|
|
22
|
-
"eslint
|
|
22
|
+
"@typescript-eslint/parser": "^7.17.0",
|
|
23
|
+
"eslint-config-flat-gitignore": "^0.1.8",
|
|
23
24
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
24
|
-
"eslint-plugin-cypress": "^3.
|
|
25
|
+
"eslint-plugin-cypress": "^3.4.0",
|
|
25
26
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
26
27
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
27
|
-
"eslint-plugin-import-x": "^
|
|
28
|
-
"eslint-plugin-jsdoc": "^48.
|
|
28
|
+
"eslint-plugin-import-x": "^3.1.0",
|
|
29
|
+
"eslint-plugin-jsdoc": "^48.8.3",
|
|
29
30
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
30
31
|
"eslint-plugin-markdown": "^5.1.0",
|
|
31
32
|
"eslint-plugin-math": "^0.6.0",
|
|
32
33
|
"eslint-plugin-perfectionist": "^2.11.0",
|
|
33
34
|
"eslint-plugin-pinia": "^0.2.0",
|
|
34
|
-
"eslint-plugin-promise": "^6.
|
|
35
|
+
"eslint-plugin-promise": "^6.6.0",
|
|
35
36
|
"eslint-plugin-regexp": "^2.6.0",
|
|
36
37
|
"eslint-plugin-unicorn": "^54.0.0",
|
|
37
38
|
"eslint-plugin-vitest": "^0.5.4",
|
|
@@ -41,20 +42,20 @@
|
|
|
41
42
|
"globals": "^15.8.0",
|
|
42
43
|
"jsonc-eslint-parser": "^2.4.0",
|
|
43
44
|
"local-pkg": "^0.5.0",
|
|
44
|
-
"typescript-eslint": "^7.
|
|
45
|
+
"typescript-eslint": "^7.17.0",
|
|
45
46
|
"vue-eslint-parser": "^9.4.3"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@types/eslint": "^8.56.
|
|
49
|
+
"@types/eslint": "^8.56.11",
|
|
49
50
|
"@types/eslint-plugin-markdown": "^2.0.2",
|
|
50
51
|
"@types/eslint__js": "^8.42.3",
|
|
51
|
-
"@types/node": "^20.14.
|
|
52
|
+
"@types/node": "^20.14.12",
|
|
52
53
|
"bumpp": "^9.4.1",
|
|
53
|
-
"eslint": "^9.
|
|
54
|
+
"eslint": "^9.7.0",
|
|
54
55
|
"eslint-plugin-eslint-plugin": "^6.2.0",
|
|
55
|
-
"tsup": "^8.
|
|
56
|
+
"tsup": "^8.2.3",
|
|
56
57
|
"tsx": "^4.16.2",
|
|
57
|
-
"typescript": "^5.5.
|
|
58
|
+
"typescript": "^5.5.4"
|
|
58
59
|
},
|
|
59
60
|
"engines": {
|
|
60
61
|
"node": "^18.18.0 || >=20.0.0"
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
},
|
|
85
86
|
"type": "module",
|
|
86
87
|
"types": "dist/index.d.ts",
|
|
87
|
-
"version": "0.1.
|
|
88
|
+
"version": "0.1.2",
|
|
88
89
|
"scripts": {
|
|
89
90
|
"build": "tsup",
|
|
90
91
|
"lint": "eslint .",
|