eslint-plugin-greasemonkey 1.0.0 → 1.2.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 +492 -37
- package/docs/LICENSE.md +9 -0
- package/docs/SECURITY.md +3 -0
- package/package.json +46 -12
- package/src/index.d.ts +6 -0
- package/src/index.js +42 -33
- package/src/rules/meta-spacing.js +51 -47
- package/src/rules/no-duplicate-keys.js +35 -0
- package/src/rules/no-unused-grants.js +33 -36
- package/src/rules/no-unused-resources.js +36 -40
- package/src/rules/require-matching-localized-fields.js +53 -53
- package/src/rules/require-required-fields.js +41 -41
- package/src/rules/require-user-js-filename.js +25 -0
- package/src/rules/valid-field-values.js +79 -60
- package/src/rules/valid-grants.js +79 -0
- package/src/utils.js +19 -19
package/README.md
CHANGED
|
@@ -1,37 +1,492 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
<a id="top"></a>
|
|
2
|
+
|
|
3
|
+
# <img height=24 src="https://cdn.staticdelivr.com/gl/adamlui/eslint-plugin-greasemonkey/e9128375d4/assets/images/icons/eslint/purple/icon32.png"> eslint-plugin-greasemonkey
|
|
4
|
+
|
|
5
|
+
[][epg-npm]
|
|
6
|
+
[](#license)
|
|
7
|
+
[](https://eslint.org/)
|
|
8
|
+
|
|
9
|
+
ESLint rules for Greasemonkey userscripts.
|
|
10
|
+
|
|
11
|
+
<img src="https://cdn.staticdelivr.com/gl/adamlui/eslint-plugin-greasemonkey/c9ac2985bb/assets/images/screenshots/vs-code/squiggles.png">
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
From your project root:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm i -D eslint-plugin-greasemonkey
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Add `greasemonkey` to your flat config:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import greasemonkey from 'eslint-plugin-greasemonkey'
|
|
27
|
+
|
|
28
|
+
export default [
|
|
29
|
+
{
|
|
30
|
+
files: ['**/*.user.js'],
|
|
31
|
+
plugins: { greasemonkey },
|
|
32
|
+
rules: {
|
|
33
|
+
'greasemonkey/meta-spacing': ['error', 3],
|
|
34
|
+
'greasemonkey/no-duplicate-keys': 'error',
|
|
35
|
+
'greasemonkey/no-unused-grants': 'error',
|
|
36
|
+
'greasemonkey/no-unused-resources': 'error',
|
|
37
|
+
'greasemonkey/require-matching-localized-fields': 'error',
|
|
38
|
+
'greasemonkey/require-required-fields': 'error',
|
|
39
|
+
'greasemonkey/require-user-js-filename': 'error',
|
|
40
|
+
'greasemonkey/valid-field-values': ['error', { versionType: 'semver' }],
|
|
41
|
+
'greasemonkey/valid-grants': ['error', { allowedGrants: [] }]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Note:** Rule config is either a severity string (`'off'`, `'warn'`, `'error'`) or an array `[severity, options]` when the rule accepts options.
|
|
48
|
+
|
|
49
|
+
To use the bundled recommended config (enables all 8 rules at `'error'`):
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
import greasemonkey from 'eslint-plugin-greasemonkey'
|
|
53
|
+
|
|
54
|
+
export default [
|
|
55
|
+
{
|
|
56
|
+
files: ['**/*.user.js'],
|
|
57
|
+
...greasemonkey.configs.recommended
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Supported rules
|
|
63
|
+
|
|
64
|
+
| ID | Description | Auto-fixable | Recommended |
|
|
65
|
+
| --- | --- | :-: | :-: |
|
|
66
|
+
| [`meta-spacing`](#meta-spacing) | Aligns metadata values to the column after the longest key | ✅ | ✅ |
|
|
67
|
+
| [`no-duplicate-keys`](#no-duplicate-keys) | Disallows duplicate metadata keys | ❌ | ✅ |
|
|
68
|
+
| [`no-unused-grants`](#no-unused-grants) | Flags `@grant` entries whose APIs are never used | ❌ | ✅ |
|
|
69
|
+
| [`no-unused-resources`](#no-unused-resources) | Flags `@resource` entries that are never referenced | ❌ | ✅ |
|
|
70
|
+
| [`require-matching-localized-fields`](#require-matching-localized-fields) | Requires matching localized `@name:xx` / `@description:xx` pairs | ❌ | ✅ |
|
|
71
|
+
| [`require-required-fields`](#require-required-fields) | Requires essential metadata fields | ❌ | ✅ |
|
|
72
|
+
| [`require-user-js-filename`](#require-user-js-filename) | Requires userscript filenames end in `.user.js` | ❌ | ✅ |
|
|
73
|
+
| [`valid-field-values`](#valid-field-values) | Validates `@version` and URL fields | ❌ | ✅ |
|
|
74
|
+
| [`valid-grants`](#valid-grants) | Disallows invalid `@grant` values | ❌ | ✅ |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### `meta-spacing`
|
|
79
|
+
|
|
80
|
+
> Aligns metadata values to the column after the longest key. The longest `@resource` name (if present) is included in the column calculation so resource URLs align with other values.
|
|
81
|
+
|
|
82
|
+
#### Options
|
|
83
|
+
|
|
84
|
+
- `number` (default `3`) – minimum spaces after the longest key
|
|
85
|
+
|
|
86
|
+
#### Incorrect code
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
// ==UserScript==
|
|
90
|
+
// @name My Script
|
|
91
|
+
// @namespace example.com
|
|
92
|
+
// @version 1.0.0
|
|
93
|
+
// ==/UserScript==
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Correct code
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
// ==UserScript==
|
|
100
|
+
// @name My Script
|
|
101
|
+
// @namespace example.com
|
|
102
|
+
// @version 1.0.0
|
|
103
|
+
// ==/UserScript==
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### When not to use it
|
|
107
|
+
|
|
108
|
+
If you don't care about visual alignment in metadata blocks.
|
|
109
|
+
|
|
110
|
+
<div align="center">
|
|
111
|
+
|
|
112
|
+
[Back to index ↑][epg-rules]
|
|
113
|
+
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
### `no-duplicate-keys`
|
|
119
|
+
|
|
120
|
+
> Disallows duplicate metadata keys. Multi-value keys are exempt (`@compatible`, `@connect`, `@description`, `@exclude`, `@exclude-match`, `@grant`, `@homepageURL`, `@include`, `@license`, `@match`, `@require`, `@resource`, `@supportURL`).
|
|
121
|
+
|
|
122
|
+
#### Incorrect code
|
|
123
|
+
|
|
124
|
+
```js
|
|
125
|
+
// ==UserScript==
|
|
126
|
+
// @name Foo
|
|
127
|
+
// @name Bar
|
|
128
|
+
// @version 1.0.0
|
|
129
|
+
// @version 2.0.0
|
|
130
|
+
// ==/UserScript==
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
#### Correct code
|
|
134
|
+
|
|
135
|
+
```js
|
|
136
|
+
// ==UserScript==
|
|
137
|
+
// @name My Script
|
|
138
|
+
// @version 1.0.0
|
|
139
|
+
// @match https://a.example.com/*
|
|
140
|
+
// @match https://b.example.com/*
|
|
141
|
+
// ==/UserScript==
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### When not to use it
|
|
145
|
+
|
|
146
|
+
If you intentionally repeat single-value keys.
|
|
147
|
+
|
|
148
|
+
<div align="center">
|
|
149
|
+
|
|
150
|
+
[Back to index ↑][epg-rules]
|
|
151
|
+
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### `no-unused-grants`
|
|
157
|
+
|
|
158
|
+
> Flags `@grant` entries whose APIs are never used in the script.
|
|
159
|
+
|
|
160
|
+
#### Incorrect code
|
|
161
|
+
|
|
162
|
+
```js
|
|
163
|
+
// ==UserScript==
|
|
164
|
+
// @grant GM_setValue
|
|
165
|
+
// ==/UserScript==
|
|
166
|
+
|
|
167
|
+
console.log('no GM_setValue call')
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### Correct code
|
|
171
|
+
|
|
172
|
+
```js
|
|
173
|
+
// ==UserScript==
|
|
174
|
+
// @grant GM_setValue
|
|
175
|
+
// ==/UserScript==
|
|
176
|
+
|
|
177
|
+
GM_setValue('key', 'value')
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
#### When not to use it
|
|
181
|
+
|
|
182
|
+
If you declare grants for APIs you use indirectly (e.g. via dynamic variable names or `eval`).
|
|
183
|
+
|
|
184
|
+
<div align="center">
|
|
185
|
+
|
|
186
|
+
[Back to index ↑][epg-rules]
|
|
187
|
+
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### `no-unused-resources`
|
|
193
|
+
|
|
194
|
+
> Flags `@resource` entries that are never referenced via `GM_getResourceText()` or `GM_getResourceURL()`.
|
|
195
|
+
|
|
196
|
+
#### Incorrect code
|
|
197
|
+
|
|
198
|
+
```js
|
|
199
|
+
// ==UserScript==
|
|
200
|
+
// @resource myCSS https://example.com/style.css
|
|
201
|
+
// ==/UserScript==
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
#### Correct code
|
|
205
|
+
|
|
206
|
+
```js
|
|
207
|
+
// ==UserScript==
|
|
208
|
+
// @resource myCSS https://example.com/style.css
|
|
209
|
+
// ==/UserScript==
|
|
210
|
+
|
|
211
|
+
GM_getResourceText('myCSS')
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
#### When not to use it
|
|
215
|
+
|
|
216
|
+
If you reference resources indirectly (e.g., building the resource name dynamically).
|
|
217
|
+
|
|
218
|
+
<div align="center">
|
|
219
|
+
|
|
220
|
+
[Back to index ↑][epg-rules]
|
|
221
|
+
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
### `require-matching-localized-fields`
|
|
227
|
+
|
|
228
|
+
> Requires that every `@name:xx` has a matching `@description:xx` (and vice versa).
|
|
229
|
+
|
|
230
|
+
#### Options
|
|
231
|
+
|
|
232
|
+
- `ignoreLanguages` (string[], default `[]`) – language codes to skip, e.g. `['fr', 'de']`
|
|
233
|
+
|
|
234
|
+
#### Incorrect code
|
|
235
|
+
|
|
236
|
+
```js
|
|
237
|
+
// ==UserScript==
|
|
238
|
+
// @name:en My Script
|
|
239
|
+
// @description:en Does something
|
|
240
|
+
// @name:fr Mon Script
|
|
241
|
+
// ==/UserScript==
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
#### Correct code
|
|
245
|
+
|
|
246
|
+
```js
|
|
247
|
+
// ==UserScript==
|
|
248
|
+
// @name:en My Script
|
|
249
|
+
// @description:en Does something
|
|
250
|
+
// @name:fr Mon Script
|
|
251
|
+
// @description:fr Fait quelque chose
|
|
252
|
+
// ==/UserScript==
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### When not to use it
|
|
256
|
+
|
|
257
|
+
If you intentionally provide localized names without descriptions (or vice versa).
|
|
258
|
+
|
|
259
|
+
<div align="center">
|
|
260
|
+
|
|
261
|
+
[Back to index ↑][epg-rules]
|
|
262
|
+
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
### `require-required-fields`
|
|
268
|
+
|
|
269
|
+
> Requires essential metadata fields (`@name`, `@namespace`, `@version`) and at least one `@match` or `@include`.
|
|
270
|
+
|
|
271
|
+
#### Options
|
|
272
|
+
|
|
273
|
+
- `fields` (string[], default `['name', 'namespace', 'version']`) – override the required field list
|
|
274
|
+
|
|
275
|
+
#### Incorrect code
|
|
276
|
+
|
|
277
|
+
```js
|
|
278
|
+
// ==UserScript==
|
|
279
|
+
// @name My Script
|
|
280
|
+
// ==/UserScript==
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
#### Correct code
|
|
284
|
+
|
|
285
|
+
```js
|
|
286
|
+
// ==UserScript==
|
|
287
|
+
// @name My Script
|
|
288
|
+
// @namespace example.com
|
|
289
|
+
// @version 1.0.0
|
|
290
|
+
// @match https://example.com/*
|
|
291
|
+
// ==/UserScript==
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
#### When not to use it
|
|
295
|
+
|
|
296
|
+
If you use a subset of metadata fields that doesn't match the convention.
|
|
297
|
+
|
|
298
|
+
<div align="center">
|
|
299
|
+
|
|
300
|
+
[Back to index ↑][epg-rules]
|
|
301
|
+
|
|
302
|
+
</div>
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
### `require-user-js-filename`
|
|
307
|
+
|
|
308
|
+
> Requires that files containing a userscript metadata block end in `.user.js`.
|
|
309
|
+
|
|
310
|
+
#### Incorrect code
|
|
311
|
+
|
|
312
|
+
```js
|
|
313
|
+
// ==UserScript==
|
|
314
|
+
// @name My Script
|
|
315
|
+
// ==/UserScript==
|
|
316
|
+
// (file: script.js)
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
#### Correct code
|
|
320
|
+
|
|
321
|
+
```js
|
|
322
|
+
// ==UserScript==
|
|
323
|
+
// @name My Script
|
|
324
|
+
// ==/UserScript==
|
|
325
|
+
// (file: script.user.js)
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
#### When not to use it
|
|
329
|
+
|
|
330
|
+
If you intentionally name your userscripts something other than `*.user.js`.
|
|
331
|
+
|
|
332
|
+
<div align="center">
|
|
333
|
+
|
|
334
|
+
[Back to index ↑][epg-rules]
|
|
335
|
+
|
|
336
|
+
</div>
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
### `valid-field-values`
|
|
341
|
+
|
|
342
|
+
> Validates `@version` (semver or date format) and URL fields (`@homepage`, `@icon`, `@icon64`, `@require`, `@resource`, `@source`, `@website`, any key ending in `URL` case-insensitively).
|
|
343
|
+
|
|
344
|
+
#### Options
|
|
345
|
+
|
|
346
|
+
- `versionType` (`'semver'` | `'date'`, default `'semver'`) – version format to enforce
|
|
347
|
+
|
|
348
|
+
#### Incorrect code
|
|
349
|
+
|
|
350
|
+
```js
|
|
351
|
+
// ==UserScript==
|
|
352
|
+
// @version abc
|
|
353
|
+
// @homepage not-a-url
|
|
354
|
+
// ==/UserScript==
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
#### Correct code
|
|
358
|
+
|
|
359
|
+
```js
|
|
360
|
+
// ==UserScript==
|
|
361
|
+
// @version 1.0.0
|
|
362
|
+
// @homepage https://example.com
|
|
363
|
+
// ==/UserScript==
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
#### When not to use it
|
|
367
|
+
|
|
368
|
+
If you use a custom versioning scheme or URLs that aren't standard.
|
|
369
|
+
|
|
370
|
+
<div align="center">
|
|
371
|
+
|
|
372
|
+
[Back to index ↑][epg-rules]
|
|
373
|
+
|
|
374
|
+
</div>
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
### `valid-grants`
|
|
379
|
+
|
|
380
|
+
> Disallows invalid `@grant` values.
|
|
381
|
+
|
|
382
|
+
#### Options
|
|
383
|
+
|
|
384
|
+
- `allowedGrants` (string[], default `[]`) – additional `@grant` values to allow beyond the built-in list (covering Tampermonkey, Violentmonkey and ScriptCat)
|
|
385
|
+
|
|
386
|
+
#### Incorrect code
|
|
387
|
+
|
|
388
|
+
```js
|
|
389
|
+
// ==UserScript==
|
|
390
|
+
// @grant GM_notificaiton
|
|
391
|
+
// @grant gm_setvalue
|
|
392
|
+
// @grant GM_xmlHttpRequest
|
|
393
|
+
// ==/UserScript==
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
#### Correct code
|
|
397
|
+
|
|
398
|
+
```js
|
|
399
|
+
// ==UserScript==
|
|
400
|
+
// @grant GM_notification
|
|
401
|
+
// @grant GM_setValue
|
|
402
|
+
// @grant GM_xmlhttpRequest
|
|
403
|
+
// ==/UserScript==
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
#### When not to use it
|
|
407
|
+
|
|
408
|
+
If you don't want `@grant` validation at all. For individual unlisted grants, prefer the `allowedGrants` option over disabling the rule.
|
|
409
|
+
|
|
410
|
+
<div align="center">
|
|
411
|
+
|
|
412
|
+
[Back to index ↑][epg-rules]
|
|
413
|
+
|
|
414
|
+
</div>
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## Shield
|
|
419
|
+
|
|
420
|
+
<a href="https://codeberg.org/adamlui/eslint-plugin-greasemonkey/#readme">
|
|
421
|
+
<img height=32 alt="[Linted by eslint-plugin-greasemonkey]" src="https://img.shields.io/badge/Linted_by-eslint--plugin--greasemonkey-4b32c3?logo=eslint&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
422
|
+
|
|
423
|
+
#### HTML
|
|
424
|
+
|
|
425
|
+
```html
|
|
426
|
+
<a href="https://codeberg.org/adamlui/eslint-plugin-greasemonkey/#readme">
|
|
427
|
+
<img height=32 alt="[Linted by eslint-plugin-greasemonkey]" src="https://img.shields.io/badge/Linted_by-eslint--plugin--greasemonkey-4b32c3?logo=eslint&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
#### Markdown
|
|
431
|
+
|
|
432
|
+
```md
|
|
433
|
+
[](https://codeberg.org/adamlui/eslint-plugin-greasemonkey/#readme)
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
## License
|
|
437
|
+
|
|
438
|
+
<details>
|
|
439
|
+
|
|
440
|
+
<summary>
|
|
441
|
+
|
|
442
|
+
Copyright © 2026 [Adam Lui][adamlui-cb] under the [MIT license](./docs/LICENSE.md).
|
|
443
|
+
|
|
444
|
+
</summary><br>
|
|
445
|
+
|
|
446
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
447
|
+
|
|
448
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
449
|
+
|
|
450
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
|
|
451
|
+
|
|
452
|
+
</details>
|
|
453
|
+
|
|
454
|
+
## Related
|
|
455
|
+
|
|
456
|
+
<!-- eslint-plugin-constructors -->
|
|
457
|
+
|
|
458
|
+
### [<img height=15 width=auto src="https://cdn.staticdelivr.com/gl/adamlui/eslint-plugin-greasemonkey/e9128375d4/assets/images/icons/eslint/purple/icon16.png">][epc-readme] [eslint-plugin-constructors][epc-readme]
|
|
459
|
+
|
|
460
|
+
<details>
|
|
461
|
+
|
|
462
|
+
<summary>ESLint rules for JavaScript constructor usage.</summary><br>
|
|
463
|
+
|
|
464
|
+
> [<img width=555 src="https://cdn.staticdelivr.com/gl/adamlui/eslint-plugin-constructors/6eeba7b2cb/assets/images/screenshots/vs-code/squiggles.png">][epc-readme]
|
|
465
|
+
|
|
466
|
+
> [**Install**][epc-install] / [Readme][epc-readme] / [Rules][epc-rules]
|
|
467
|
+
|
|
468
|
+
</details>
|
|
469
|
+
|
|
470
|
+
[epc-install]: https://codeberg.org/adamlui/eslint-plugin-constructors/#installation
|
|
471
|
+
[epc-readme]: https://codeberg.org/adamlui/eslint-plugin-constructors/#readme
|
|
472
|
+
[epc-rules]: https://codeberg.org/adamlui/eslint-plugin-constructors/#supported-rules
|
|
473
|
+
|
|
474
|
+
<!-- Footer -->
|
|
475
|
+
|
|
476
|
+
<img height=10 width="100%" src="https://cdn.staticdelivr.com/gl/adamlui/ai-web-extensions/d11d2ee/assets/images/separators/gradient-aqua.png">
|
|
477
|
+
<br><br>
|
|
478
|
+
|
|
479
|
+
<div align="center">
|
|
480
|
+
|
|
481
|
+
[**Latest releases**][epg-releases] / [Report a bug][epg-bugs] / [More packages by author][adamlui-npmx] / [Back to top ↑](#top)
|
|
482
|
+
|
|
483
|
+
</div>
|
|
484
|
+
|
|
485
|
+
<!-- Links -->
|
|
486
|
+
|
|
487
|
+
[adamlui-cb]: https://codeberg.org/adamlui
|
|
488
|
+
[adamlui-npmx]: https://npmx.dev/org/adamlui
|
|
489
|
+
[epg-bugs]: https://codeberg.org/adamlui/eslint-plugin-greasemonkey/issues/new
|
|
490
|
+
[epg-npm]: https://www.npmjs.com/package/eslint-plugin-greasemonkey
|
|
491
|
+
[epg-releases]: https://codeberg.org/adamlui/eslint-plugin-greasemonkey/releases
|
|
492
|
+
[epg-rules]: #supported-rules
|
package/docs/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# 🏛️ MIT License
|
|
2
|
+
|
|
3
|
+
**Copyright © 2026 [Adam Lui](https://codeberg.org/adamlui).**
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
|
package/docs/SECURITY.md
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-greasemonkey",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "ESLint rules for Greasemonkey/Tampermonkey userscripts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -12,9 +12,27 @@
|
|
|
12
12
|
"url": "https://codeberg.org/adamlui"
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://codeberg.org/adamlui/eslint-plugin-greasemonkey/#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://codeberg.org/adamlui/eslint-plugin-greasemonkey/issues",
|
|
17
|
+
"email": "support@adamlui.com"
|
|
18
|
+
},
|
|
15
19
|
"license": "MIT",
|
|
20
|
+
"funding": [
|
|
21
|
+
{
|
|
22
|
+
"type": "ko-fi",
|
|
23
|
+
"url": "https://ko-fi.com/adamlui"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "paypal",
|
|
27
|
+
"url": "https://paypal.me/adamlui"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
16
30
|
"main": "src/index.js",
|
|
17
|
-
"files": [
|
|
31
|
+
"files": [
|
|
32
|
+
"docs/",
|
|
33
|
+
"src/"
|
|
34
|
+
],
|
|
35
|
+
"types": "src/index.d.ts",
|
|
18
36
|
"scripts": {
|
|
19
37
|
"prepare": "husky",
|
|
20
38
|
"lint": "eslint . --cache",
|
|
@@ -22,29 +40,45 @@
|
|
|
22
40
|
"lint:fix": "eslint . --fix --cache",
|
|
23
41
|
"lint:fix-all": "eslint . --fix",
|
|
24
42
|
"test": "node tests/run.js",
|
|
25
|
-
"demo": "eslint --config demo/eslint.config.js demo/example.user.js"
|
|
43
|
+
"demo": "eslint --config demo/eslint.config.js demo/example.user.js",
|
|
44
|
+
"bump:patch": "bash utils/bump.sh patch",
|
|
45
|
+
"bump:minor": "bash utils/bump.sh minor",
|
|
46
|
+
"bump:feat": "npm run bump:minor",
|
|
47
|
+
"bump:major": "bash utils/bump.sh major"
|
|
48
|
+
},
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://codeberg.org/adamlui/eslint-plugin-greasemonkey.git"
|
|
26
52
|
},
|
|
27
53
|
"keywords": [
|
|
28
|
-
"greasemonkey",
|
|
29
|
-
"tampermonkey",
|
|
30
|
-
"userscript",
|
|
31
54
|
"eslint",
|
|
32
55
|
"eslint-plugin",
|
|
33
|
-
"
|
|
56
|
+
"eslintplugin",
|
|
57
|
+
"greasemonkey",
|
|
58
|
+
"metadata",
|
|
59
|
+
"tampermonkey",
|
|
60
|
+
"userscript"
|
|
34
61
|
],
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"eslint": ">=9.0.0"
|
|
64
|
+
},
|
|
35
65
|
"devDependencies": {
|
|
66
|
+
"@e18e/eslint-plugin": "^0.8.0",
|
|
36
67
|
"@eslint/js": "^10.0.1",
|
|
37
68
|
"@eslint/json": "^2.1.0",
|
|
38
69
|
"@eslint/markdown": "^8.0.3",
|
|
39
70
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
40
71
|
"eslint": "^10.10.0",
|
|
41
|
-
"eslint-plugin-
|
|
72
|
+
"eslint-plugin-constructors": "^1.0.3",
|
|
73
|
+
"eslint-plugin-eslint-plugin": "^7.6.2",
|
|
42
74
|
"eslint-plugin-import-x": "^4.17.1",
|
|
75
|
+
"eslint-plugin-n": "^18.3.0",
|
|
76
|
+
"eslint-plugin-no-secrets": "^2.3.3",
|
|
77
|
+
"eslint-plugin-no-unsanitized": "^4.1.5",
|
|
43
78
|
"eslint-plugin-promise": "^7.3.0",
|
|
44
79
|
"eslint-plugin-regexp": "^3.3.0",
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"eslint": ">=9.0.0"
|
|
80
|
+
"eslint-plugin-security": "^4.0.1",
|
|
81
|
+
"globals": "^17.12.0",
|
|
82
|
+
"husky": "^9.1.7"
|
|
49
83
|
}
|
|
50
84
|
}
|