@virmator/lint 13.0.5 → 13.1.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/README.md +3 -1
- package/configs/eslint.config.base.mjs +63 -0
- package/configs/eslint.config.mjs +12 -3
- package/dist/lint.d.ts +30 -10
- package/dist/lint.js +28 -6
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -15,13 +15,15 @@ A default plugin for [virmator](https://www.npmjs.com/package/virmator).
|
|
|
15
15
|
- eslint.config.mjs
|
|
16
16
|
- Deps
|
|
17
17
|
- [eslint](https://npmjs.com/package/eslint)
|
|
18
|
+
- [eslint-plugin-require-extensions](https://npmjs.com/package/eslint-plugin-require-extensions)
|
|
19
|
+
- [eslint-plugin-unicorn](https://npmjs.com/package/eslint-plugin-unicorn)
|
|
18
20
|
- [@eslint/js](https://npmjs.com/package/@eslint/js)
|
|
21
|
+
- [@eslint/eslintrc](https://npmjs.com/package/@eslint/eslintrc)
|
|
19
22
|
- [@stylistic/eslint-plugin](https://npmjs.com/package/@stylistic/eslint-plugin)
|
|
20
23
|
- [@stylistic/eslint-plugin-ts](https://npmjs.com/package/@stylistic/eslint-plugin-ts)
|
|
21
24
|
- [@typescript-eslint/eslint-plugin](https://npmjs.com/package/@typescript-eslint/eslint-plugin)
|
|
22
25
|
- [eslint-config-prettier](https://npmjs.com/package/eslint-config-prettier)
|
|
23
26
|
- [eslint-plugin-jsdoc](https://npmjs.com/package/eslint-plugin-jsdoc)
|
|
24
|
-
- [eslint-plugin-mocha](https://npmjs.com/package/eslint-plugin-mocha)
|
|
25
27
|
- [eslint-plugin-playwright](https://npmjs.com/package/eslint-plugin-playwright)
|
|
26
28
|
- [eslint-plugin-prettier](https://npmjs.com/package/eslint-plugin-prettier)
|
|
27
29
|
- [eslint-plugin-sonarjs](https://npmjs.com/package/eslint-plugin-sonarjs)
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import {FlatCompat} from '@eslint/eslintrc';
|
|
1
2
|
import jsEslint from '@eslint/js';
|
|
2
3
|
import stylistic from '@stylistic/eslint-plugin';
|
|
3
4
|
import jsdoc from 'eslint-plugin-jsdoc';
|
|
4
5
|
import prettierEslintRecommended from 'eslint-plugin-prettier/recommended';
|
|
5
6
|
import sonarJsEslint from 'eslint-plugin-sonarjs';
|
|
7
|
+
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
|
6
8
|
import globals from 'globals';
|
|
7
9
|
import {existsSync} from 'node:fs';
|
|
8
10
|
import {join} from 'node:path';
|
|
@@ -25,7 +27,13 @@ function determineTsconfigPath(repoDir) {
|
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export function defineEslintConfig(repoDir) {
|
|
30
|
+
const compat = new FlatCompat({
|
|
31
|
+
baseDirectory: repoDir,
|
|
32
|
+
});
|
|
33
|
+
|
|
28
34
|
return [
|
|
35
|
+
...compat.plugins('require-extensions'),
|
|
36
|
+
...compat.extends('plugin:require-extensions/recommended'),
|
|
29
37
|
{
|
|
30
38
|
ignores: [
|
|
31
39
|
'*.graphql',
|
|
@@ -36,6 +44,7 @@ export function defineEslintConfig(repoDir) {
|
|
|
36
44
|
'*.yml',
|
|
37
45
|
'**/configs/',
|
|
38
46
|
'**/coverage/',
|
|
47
|
+
'**/dist-*/',
|
|
39
48
|
'**/dist/',
|
|
40
49
|
'cspell.config.cjs',
|
|
41
50
|
'package-lock.json',
|
|
@@ -57,6 +66,7 @@ export function defineEslintConfig(repoDir) {
|
|
|
57
66
|
plugins: {
|
|
58
67
|
'@stylistic': stylistic,
|
|
59
68
|
'@jsdoc': jsdoc,
|
|
69
|
+
unicorn: eslintPluginUnicorn,
|
|
60
70
|
},
|
|
61
71
|
rules: {
|
|
62
72
|
'@typescript-eslint/no-dynamic-delete': 'off',
|
|
@@ -68,12 +78,65 @@ export function defineEslintConfig(repoDir) {
|
|
|
68
78
|
'@typescript-eslint/no-unsafe-call': 'off',
|
|
69
79
|
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
|
|
70
80
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
81
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
82
|
+
|
|
71
83
|
'prettier/prettier': 'off',
|
|
72
84
|
'sonarjs/no-duplicate-string': 'off',
|
|
73
85
|
|
|
86
|
+
'unicorn/new-for-builtins': 'error',
|
|
87
|
+
'unicorn/no-array-push-push': 'error',
|
|
88
|
+
'unicorn/no-await-in-promise-methods': 'error',
|
|
89
|
+
'unicorn/no-document-cookie': 'error',
|
|
90
|
+
'unicorn/no-empty-file': 'error',
|
|
91
|
+
'unicorn/no-for-loop': 'error',
|
|
92
|
+
'unicorn/no-instanceof-array': 'error',
|
|
93
|
+
'unicorn/no-invalid-fetch-options': 'error',
|
|
94
|
+
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
95
|
+
'unicorn/no-length-as-slice-end': 'error',
|
|
96
|
+
'unicorn/no-lonely-if': 'error',
|
|
97
|
+
'unicorn/no-negated-condition': 'error',
|
|
98
|
+
'unicorn/no-negation-in-equality-check': 'error',
|
|
99
|
+
'unicorn/no-single-promise-in-promise-methods': 'error',
|
|
100
|
+
'unicorn/no-thenable': 'error',
|
|
101
|
+
'unicorn/no-unnecessary-await': 'error', // not sure on this one
|
|
102
|
+
'unicorn/no-unnecessary-polyfills': 'error',
|
|
103
|
+
'unicorn/no-unreadable-iife': 'error',
|
|
104
|
+
'unicorn/no-useless-fallback-in-spread': 'error',
|
|
105
|
+
'unicorn/no-useless-length-check': 'error',
|
|
106
|
+
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
107
|
+
'unicorn/no-useless-spread': 'error',
|
|
108
|
+
'unicorn/no-useless-switch-case': 'error',
|
|
109
|
+
'unicorn/no-zero-fractions': 'error',
|
|
110
|
+
'unicorn/number-literal-case': 'error',
|
|
111
|
+
'unicorn/numeric-separators-style': 'error',
|
|
112
|
+
'unicorn/prefer-array-find': 'error',
|
|
113
|
+
'unicorn/prefer-array-flat-map': 'error',
|
|
114
|
+
'unicorn/prefer-array-flat': 'error',
|
|
115
|
+
'unicorn/prefer-array-index-of': 'error',
|
|
116
|
+
'unicorn/prefer-array-some': 'error',
|
|
117
|
+
'unicorn/prefer-blob-reading-methods': 'error',
|
|
118
|
+
'unicorn/prefer-code-point': 'error',
|
|
119
|
+
'unicorn/prefer-date-now': 'error',
|
|
120
|
+
'unicorn/prefer-dom-node-append': 'error',
|
|
121
|
+
'unicorn/prefer-dom-node-remove': 'error',
|
|
122
|
+
'unicorn/prefer-event-target': 'error',
|
|
123
|
+
'unicorn/prefer-export-from': 'error',
|
|
124
|
+
'unicorn/prefer-includes': 'error',
|
|
125
|
+
'unicorn/prefer-logical-operator-over-ternary': 'error',
|
|
126
|
+
'unicorn/prefer-modern-dom-apis': 'error',
|
|
127
|
+
'unicorn/prefer-modern-math-apis': 'error',
|
|
128
|
+
'unicorn/prefer-module': 'error',
|
|
129
|
+
'unicorn/prefer-node-protocol': 'error',
|
|
130
|
+
'unicorn/prefer-set-size': 'error',
|
|
131
|
+
'unicorn/prefer-string-raw': 'error',
|
|
132
|
+
'unicorn/prefer-string-slice': 'error',
|
|
133
|
+
'unicorn/prefer-type-error': 'error',
|
|
134
|
+
'unicorn/throw-new-error': 'error',
|
|
135
|
+
|
|
74
136
|
'@jsdoc/no-undefined-types': 'error',
|
|
75
137
|
'@typescript-eslint/await-thenable': 'error',
|
|
76
138
|
'@typescript-eslint/no-unused-vars': 'error',
|
|
139
|
+
'no-lonely-if': 'error',
|
|
77
140
|
|
|
78
141
|
'@typescript-eslint/no-floating-promises': [
|
|
79
142
|
'error',
|
|
@@ -2,12 +2,21 @@ import {defineEslintConfig} from '@virmator/lint/configs/eslint.config.base.mjs'
|
|
|
2
2
|
import {dirname} from 'node:path';
|
|
3
3
|
import {fileURLToPath} from 'node:url';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const __dirname = dirname(__filename);
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
6
|
|
|
8
7
|
export default [
|
|
9
8
|
...defineEslintConfig(__dirname),
|
|
10
9
|
{
|
|
11
|
-
ignores: [
|
|
10
|
+
ignores: [
|
|
11
|
+
/** Add file globs that should be ignored. */
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
rules: {
|
|
16
|
+
/**
|
|
17
|
+
* Turn off or on specific rules. See {@link defineEslintConfig} for which plugins are
|
|
18
|
+
* already enabled.
|
|
19
|
+
*/
|
|
20
|
+
},
|
|
12
21
|
},
|
|
13
22
|
];
|
package/dist/lint.d.ts
CHANGED
|
@@ -43,11 +43,26 @@ export declare const virmatorLintPlugin: Readonly<Readonly<{
|
|
|
43
43
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
44
44
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
45
45
|
};
|
|
46
|
+
readonly 'eslint-plugin-require-extensions': {
|
|
47
|
+
readonly type: NpmDepType.Dev;
|
|
48
|
+
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
49
|
+
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
50
|
+
};
|
|
51
|
+
readonly 'eslint-plugin-unicorn': {
|
|
52
|
+
readonly type: NpmDepType.Dev;
|
|
53
|
+
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
54
|
+
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
55
|
+
};
|
|
46
56
|
readonly '@eslint/js': {
|
|
47
57
|
readonly type: NpmDepType.Dev;
|
|
48
58
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
49
59
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
50
60
|
};
|
|
61
|
+
readonly '@eslint/eslintrc': {
|
|
62
|
+
readonly type: NpmDepType.Dev;
|
|
63
|
+
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
64
|
+
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
65
|
+
};
|
|
51
66
|
readonly '@stylistic/eslint-plugin': {
|
|
52
67
|
readonly type: NpmDepType.Dev;
|
|
53
68
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
@@ -73,11 +88,6 @@ export declare const virmatorLintPlugin: Readonly<Readonly<{
|
|
|
73
88
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
74
89
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
75
90
|
};
|
|
76
|
-
readonly 'eslint-plugin-mocha': {
|
|
77
|
-
readonly type: NpmDepType.Dev;
|
|
78
|
-
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
79
|
-
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
80
|
-
};
|
|
81
91
|
readonly 'eslint-plugin-playwright': {
|
|
82
92
|
readonly type: NpmDepType.Dev;
|
|
83
93
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
@@ -144,11 +154,26 @@ export declare const virmatorLintPlugin: Readonly<Readonly<{
|
|
|
144
154
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
145
155
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
146
156
|
};
|
|
157
|
+
readonly 'eslint-plugin-require-extensions': {
|
|
158
|
+
readonly type: NpmDepType.Dev;
|
|
159
|
+
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
160
|
+
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
161
|
+
};
|
|
162
|
+
readonly 'eslint-plugin-unicorn': {
|
|
163
|
+
readonly type: NpmDepType.Dev;
|
|
164
|
+
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
165
|
+
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
166
|
+
};
|
|
147
167
|
readonly '@eslint/js': {
|
|
148
168
|
readonly type: NpmDepType.Dev;
|
|
149
169
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
150
170
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
151
171
|
};
|
|
172
|
+
readonly '@eslint/eslintrc': {
|
|
173
|
+
readonly type: NpmDepType.Dev;
|
|
174
|
+
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
175
|
+
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
176
|
+
};
|
|
152
177
|
readonly '@stylistic/eslint-plugin': {
|
|
153
178
|
readonly type: NpmDepType.Dev;
|
|
154
179
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
@@ -174,11 +199,6 @@ export declare const virmatorLintPlugin: Readonly<Readonly<{
|
|
|
174
199
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
175
200
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
176
201
|
};
|
|
177
|
-
readonly 'eslint-plugin-mocha': {
|
|
178
|
-
readonly type: NpmDepType.Dev;
|
|
179
|
-
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
180
|
-
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
181
|
-
};
|
|
182
202
|
readonly 'eslint-plugin-playwright': {
|
|
183
203
|
readonly type: NpmDepType.Dev;
|
|
184
204
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
package/dist/lint.js
CHANGED
|
@@ -78,6 +78,28 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
78
78
|
PackageType.MonoRoot,
|
|
79
79
|
],
|
|
80
80
|
},
|
|
81
|
+
'eslint-plugin-require-extensions': {
|
|
82
|
+
type: NpmDepType.Dev,
|
|
83
|
+
env: [
|
|
84
|
+
VirmatorEnv.Node,
|
|
85
|
+
VirmatorEnv.Web,
|
|
86
|
+
],
|
|
87
|
+
packageType: [
|
|
88
|
+
PackageType.TopPackage,
|
|
89
|
+
PackageType.MonoRoot,
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
'eslint-plugin-unicorn': {
|
|
93
|
+
type: NpmDepType.Dev,
|
|
94
|
+
env: [
|
|
95
|
+
VirmatorEnv.Node,
|
|
96
|
+
VirmatorEnv.Web,
|
|
97
|
+
],
|
|
98
|
+
packageType: [
|
|
99
|
+
PackageType.TopPackage,
|
|
100
|
+
PackageType.MonoRoot,
|
|
101
|
+
],
|
|
102
|
+
},
|
|
81
103
|
'@eslint/js': {
|
|
82
104
|
type: NpmDepType.Dev,
|
|
83
105
|
env: [
|
|
@@ -89,7 +111,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
89
111
|
PackageType.MonoRoot,
|
|
90
112
|
],
|
|
91
113
|
},
|
|
92
|
-
'@
|
|
114
|
+
'@eslint/eslintrc': {
|
|
93
115
|
type: NpmDepType.Dev,
|
|
94
116
|
env: [
|
|
95
117
|
VirmatorEnv.Node,
|
|
@@ -100,7 +122,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
100
122
|
PackageType.MonoRoot,
|
|
101
123
|
],
|
|
102
124
|
},
|
|
103
|
-
'@stylistic/eslint-plugin
|
|
125
|
+
'@stylistic/eslint-plugin': {
|
|
104
126
|
type: NpmDepType.Dev,
|
|
105
127
|
env: [
|
|
106
128
|
VirmatorEnv.Node,
|
|
@@ -111,7 +133,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
111
133
|
PackageType.MonoRoot,
|
|
112
134
|
],
|
|
113
135
|
},
|
|
114
|
-
'@
|
|
136
|
+
'@stylistic/eslint-plugin-ts': {
|
|
115
137
|
type: NpmDepType.Dev,
|
|
116
138
|
env: [
|
|
117
139
|
VirmatorEnv.Node,
|
|
@@ -122,7 +144,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
122
144
|
PackageType.MonoRoot,
|
|
123
145
|
],
|
|
124
146
|
},
|
|
125
|
-
'eslint-
|
|
147
|
+
'@typescript-eslint/eslint-plugin': {
|
|
126
148
|
type: NpmDepType.Dev,
|
|
127
149
|
env: [
|
|
128
150
|
VirmatorEnv.Node,
|
|
@@ -133,7 +155,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
133
155
|
PackageType.MonoRoot,
|
|
134
156
|
],
|
|
135
157
|
},
|
|
136
|
-
'eslint-
|
|
158
|
+
'eslint-config-prettier': {
|
|
137
159
|
type: NpmDepType.Dev,
|
|
138
160
|
env: [
|
|
139
161
|
VirmatorEnv.Node,
|
|
@@ -144,7 +166,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
144
166
|
PackageType.MonoRoot,
|
|
145
167
|
],
|
|
146
168
|
},
|
|
147
|
-
'eslint-plugin-
|
|
169
|
+
'eslint-plugin-jsdoc': {
|
|
148
170
|
type: NpmDepType.Dev,
|
|
149
171
|
env: [
|
|
150
172
|
VirmatorEnv.Node,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virmator/lint",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.1.1",
|
|
4
4
|
"description": "Default ESLint linting plugin for virmator.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"virmator",
|
|
@@ -35,21 +35,27 @@
|
|
|
35
35
|
"mri": "^1.2.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
38
39
|
"@eslint/js": "^9.8.0",
|
|
39
40
|
"@stylistic/eslint-plugin": "^2.6.1",
|
|
40
41
|
"@stylistic/eslint-plugin-ts": "^2.6.1",
|
|
42
|
+
"@types/node": "^22.1.0",
|
|
41
43
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
42
44
|
"c8": "^10.1.2",
|
|
43
45
|
"eslint": "^9.8.0",
|
|
44
46
|
"eslint-config-prettier": "^9.1.0",
|
|
45
47
|
"eslint-plugin-jsdoc": "^48.11.0",
|
|
46
|
-
"eslint-plugin-mocha": "^10.5.0",
|
|
47
48
|
"eslint-plugin-playwright": "^1.6.2",
|
|
48
49
|
"eslint-plugin-prettier": "^5.2.1",
|
|
50
|
+
"eslint-plugin-require-extensions": "^0.1.3",
|
|
49
51
|
"eslint-plugin-sonarjs": "^1.0.4",
|
|
52
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
50
53
|
"istanbul-smart-text-reporter": "^1.1.4",
|
|
51
54
|
"typescript-eslint": "^8.0.0"
|
|
52
55
|
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=22"
|
|
58
|
+
},
|
|
53
59
|
"publishConfig": {
|
|
54
60
|
"access": "public"
|
|
55
61
|
}
|