@virmator/lint 13.0.4 → 13.1.0
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 +2 -1
- package/configs/eslint.config.base.mjs +62 -0
- package/configs/eslint.config.mjs +1 -2
- package/dist/lint.d.ts +20 -10
- package/dist/lint.js +17 -6
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -15,13 +15,14 @@ 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)
|
|
18
19
|
- [@eslint/js](https://npmjs.com/package/@eslint/js)
|
|
20
|
+
- [@eslint/eslintrc](https://npmjs.com/package/@eslint/eslintrc)
|
|
19
21
|
- [@stylistic/eslint-plugin](https://npmjs.com/package/@stylistic/eslint-plugin)
|
|
20
22
|
- [@stylistic/eslint-plugin-ts](https://npmjs.com/package/@stylistic/eslint-plugin-ts)
|
|
21
23
|
- [@typescript-eslint/eslint-plugin](https://npmjs.com/package/@typescript-eslint/eslint-plugin)
|
|
22
24
|
- [eslint-config-prettier](https://npmjs.com/package/eslint-config-prettier)
|
|
23
25
|
- [eslint-plugin-jsdoc](https://npmjs.com/package/eslint-plugin-jsdoc)
|
|
24
|
-
- [eslint-plugin-mocha](https://npmjs.com/package/eslint-plugin-mocha)
|
|
25
26
|
- [eslint-plugin-playwright](https://npmjs.com/package/eslint-plugin-playwright)
|
|
26
27
|
- [eslint-plugin-prettier](https://npmjs.com/package/eslint-plugin-prettier)
|
|
27
28
|
- [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',
|
|
@@ -57,6 +65,7 @@ export function defineEslintConfig(repoDir) {
|
|
|
57
65
|
plugins: {
|
|
58
66
|
'@stylistic': stylistic,
|
|
59
67
|
'@jsdoc': jsdoc,
|
|
68
|
+
unicorn: eslintPluginUnicorn,
|
|
60
69
|
},
|
|
61
70
|
rules: {
|
|
62
71
|
'@typescript-eslint/no-dynamic-delete': 'off',
|
|
@@ -71,6 +80,59 @@ export function defineEslintConfig(repoDir) {
|
|
|
71
80
|
'prettier/prettier': 'off',
|
|
72
81
|
'sonarjs/no-duplicate-string': 'off',
|
|
73
82
|
|
|
83
|
+
'no-lonely-if': 'error',
|
|
84
|
+
|
|
85
|
+
'unicorn/new-for-builtins': 'error',
|
|
86
|
+
'unicorn/no-array-push-push': 'error',
|
|
87
|
+
'unicorn/no-await-in-promise-methods': 'error',
|
|
88
|
+
'unicorn/no-document-cookie': 'error',
|
|
89
|
+
'unicorn/no-empty-file': 'error',
|
|
90
|
+
'unicorn/no-for-loop': 'error',
|
|
91
|
+
'unicorn/no-instanceof-array': 'error',
|
|
92
|
+
'unicorn/no-invalid-fetch-options': 'error',
|
|
93
|
+
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
94
|
+
'unicorn/no-length-as-slice-end': 'error',
|
|
95
|
+
'unicorn/no-lonely-if': 'error',
|
|
96
|
+
'unicorn/no-negated-condition': 'error',
|
|
97
|
+
'unicorn/no-negation-in-equality-check': 'error',
|
|
98
|
+
'unicorn/no-useless-length-check': 'error',
|
|
99
|
+
'unicorn/no-single-promise-in-promise-methods': 'error',
|
|
100
|
+
'unicorn/no-thenable': 'error',
|
|
101
|
+
/** Not sure on this one. */
|
|
102
|
+
'unicorn/no-unnecessary-await': 'error',
|
|
103
|
+
'unicorn/no-unnecessary-polyfills': 'error',
|
|
104
|
+
'unicorn/no-unreadable-iife': 'error',
|
|
105
|
+
'unicorn/no-useless-fallback-in-spread': '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/prefer-logical-operator-over-ternary': 'error',
|
|
112
|
+
'unicorn/numeric-separators-style': 'error',
|
|
113
|
+
'unicorn/prefer-array-find': 'error',
|
|
114
|
+
'unicorn/prefer-array-flat': 'error',
|
|
115
|
+
'unicorn/prefer-array-flat-map': 'error',
|
|
116
|
+
'unicorn/prefer-array-index-of': 'error',
|
|
117
|
+
'unicorn/prefer-array-some': 'error',
|
|
118
|
+
'unicorn/prefer-blob-reading-methods': 'error',
|
|
119
|
+
'unicorn/prefer-code-point': 'error',
|
|
120
|
+
'unicorn/prefer-date-now': 'error',
|
|
121
|
+
'unicorn/prefer-dom-node-append': 'error',
|
|
122
|
+
'unicorn/prefer-dom-node-remove': 'error',
|
|
123
|
+
'unicorn/prefer-event-target': 'error',
|
|
124
|
+
'unicorn/prefer-export-from': 'error',
|
|
125
|
+
'unicorn/prefer-includes': 'error',
|
|
126
|
+
'unicorn/prefer-modern-dom-apis': 'error',
|
|
127
|
+
'unicorn/prefer-module': 'error',
|
|
128
|
+
'unicorn/prefer-modern-math-apis': 'error',
|
|
129
|
+
'unicorn/prefer-set-size': 'error',
|
|
130
|
+
'unicorn/prefer-string-raw': 'error',
|
|
131
|
+
'unicorn/prefer-string-slice': 'error',
|
|
132
|
+
'unicorn/prefer-type-error': 'error',
|
|
133
|
+
'unicorn/throw-new-error': 'error',
|
|
134
|
+
'unicorn/prefer-node-protocol': 'error',
|
|
135
|
+
|
|
74
136
|
'@jsdoc/no-undefined-types': 'error',
|
|
75
137
|
'@typescript-eslint/await-thenable': 'error',
|
|
76
138
|
'@typescript-eslint/no-unused-vars': 'error',
|
|
@@ -2,8 +2,7 @@ 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),
|
package/dist/lint.d.ts
CHANGED
|
@@ -43,11 +43,21 @@ 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
|
+
};
|
|
46
51
|
readonly '@eslint/js': {
|
|
47
52
|
readonly type: NpmDepType.Dev;
|
|
48
53
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
49
54
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
50
55
|
};
|
|
56
|
+
readonly '@eslint/eslintrc': {
|
|
57
|
+
readonly type: NpmDepType.Dev;
|
|
58
|
+
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
59
|
+
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
60
|
+
};
|
|
51
61
|
readonly '@stylistic/eslint-plugin': {
|
|
52
62
|
readonly type: NpmDepType.Dev;
|
|
53
63
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
@@ -73,11 +83,6 @@ export declare const virmatorLintPlugin: Readonly<Readonly<{
|
|
|
73
83
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
74
84
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
75
85
|
};
|
|
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
86
|
readonly 'eslint-plugin-playwright': {
|
|
82
87
|
readonly type: NpmDepType.Dev;
|
|
83
88
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
@@ -144,11 +149,21 @@ export declare const virmatorLintPlugin: Readonly<Readonly<{
|
|
|
144
149
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
145
150
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
146
151
|
};
|
|
152
|
+
readonly 'eslint-plugin-require-extensions': {
|
|
153
|
+
readonly type: NpmDepType.Dev;
|
|
154
|
+
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
155
|
+
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
156
|
+
};
|
|
147
157
|
readonly '@eslint/js': {
|
|
148
158
|
readonly type: NpmDepType.Dev;
|
|
149
159
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
150
160
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
151
161
|
};
|
|
162
|
+
readonly '@eslint/eslintrc': {
|
|
163
|
+
readonly type: NpmDepType.Dev;
|
|
164
|
+
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
165
|
+
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
166
|
+
};
|
|
152
167
|
readonly '@stylistic/eslint-plugin': {
|
|
153
168
|
readonly type: NpmDepType.Dev;
|
|
154
169
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
@@ -174,11 +189,6 @@ export declare const virmatorLintPlugin: Readonly<Readonly<{
|
|
|
174
189
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
|
175
190
|
readonly packageType: readonly [PackageType.TopPackage, PackageType.MonoRoot];
|
|
176
191
|
};
|
|
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
192
|
readonly 'eslint-plugin-playwright': {
|
|
183
193
|
readonly type: NpmDepType.Dev;
|
|
184
194
|
readonly env: readonly [VirmatorEnv.Node, VirmatorEnv.Web];
|
package/dist/lint.js
CHANGED
|
@@ -78,6 +78,17 @@ 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
|
+
},
|
|
81
92
|
'@eslint/js': {
|
|
82
93
|
type: NpmDepType.Dev,
|
|
83
94
|
env: [
|
|
@@ -89,7 +100,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
89
100
|
PackageType.MonoRoot,
|
|
90
101
|
],
|
|
91
102
|
},
|
|
92
|
-
'@
|
|
103
|
+
'@eslint/eslintrc': {
|
|
93
104
|
type: NpmDepType.Dev,
|
|
94
105
|
env: [
|
|
95
106
|
VirmatorEnv.Node,
|
|
@@ -100,7 +111,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
100
111
|
PackageType.MonoRoot,
|
|
101
112
|
],
|
|
102
113
|
},
|
|
103
|
-
'@stylistic/eslint-plugin
|
|
114
|
+
'@stylistic/eslint-plugin': {
|
|
104
115
|
type: NpmDepType.Dev,
|
|
105
116
|
env: [
|
|
106
117
|
VirmatorEnv.Node,
|
|
@@ -111,7 +122,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
111
122
|
PackageType.MonoRoot,
|
|
112
123
|
],
|
|
113
124
|
},
|
|
114
|
-
'@
|
|
125
|
+
'@stylistic/eslint-plugin-ts': {
|
|
115
126
|
type: NpmDepType.Dev,
|
|
116
127
|
env: [
|
|
117
128
|
VirmatorEnv.Node,
|
|
@@ -122,7 +133,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
122
133
|
PackageType.MonoRoot,
|
|
123
134
|
],
|
|
124
135
|
},
|
|
125
|
-
'eslint-
|
|
136
|
+
'@typescript-eslint/eslint-plugin': {
|
|
126
137
|
type: NpmDepType.Dev,
|
|
127
138
|
env: [
|
|
128
139
|
VirmatorEnv.Node,
|
|
@@ -133,7 +144,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
133
144
|
PackageType.MonoRoot,
|
|
134
145
|
],
|
|
135
146
|
},
|
|
136
|
-
'eslint-
|
|
147
|
+
'eslint-config-prettier': {
|
|
137
148
|
type: NpmDepType.Dev,
|
|
138
149
|
env: [
|
|
139
150
|
VirmatorEnv.Node,
|
|
@@ -144,7 +155,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
144
155
|
PackageType.MonoRoot,
|
|
145
156
|
],
|
|
146
157
|
},
|
|
147
|
-
'eslint-plugin-
|
|
158
|
+
'eslint-plugin-jsdoc': {
|
|
148
159
|
type: NpmDepType.Dev,
|
|
149
160
|
env: [
|
|
150
161
|
VirmatorEnv.Node,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virmator/lint",
|
|
3
|
-
"version": "13.0
|
|
3
|
+
"version": "13.1.0",
|
|
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
|
}
|