eslint-plugin-greasemonkey 1.8.3 → 1.8.4
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 +102 -18
- package/package.json +4 -6
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<img alt="[Latest Build]" src="https://img.shields.io/npm/v/eslint-plugin-greasemonkey?logo=icinga&style=for-the-badge&label=Latest%20Build&color=32fcee"></a>
|
|
7
7
|
<a href="#license">
|
|
8
8
|
<img alt="[License: MIT]" src="https://img.shields.io/badge/License-MIT-f1f20a.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
9
|
-
<a>
|
|
9
|
+
<a target="_blank" href="https://getnpmstats.com/?package=eslint-plugin-greasemonkey&range=last-year&interval=monthly">
|
|
10
10
|
<img src="https://img.shields.io/npm/dm/eslint-plugin-greasemonkey?style=for-the-badge&logo=npm&color=black"></a>
|
|
11
11
|
<a target="_blank" href="https://eslint.org/">
|
|
12
12
|
<img alt="[Requires ESLint >=9.0.0]" src="https://img.shields.io/badge/Requires-ESLint_%3E%3D9.0.0-4B32C3?style=for-the-badge&logo=eslint"></a>
|
|
@@ -82,7 +82,7 @@ Available bundles: `recommended`, `strict` (everything), `problem` (deterministi
|
|
|
82
82
|
|
|
83
83
|
<summary>Enforces a preferred order for metadata keys.</summary>
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
<h4 id="meta-order-options">Options</h4>
|
|
86
86
|
|
|
87
87
|
- `order` (default `[]`) – metadata keys in custom order (e.g. `['license', 'namespace']`) to selectively override built-in order with
|
|
88
88
|
|
|
@@ -125,7 +125,18 @@ If you don't care about the order of metadata fields.
|
|
|
125
125
|
#### See also
|
|
126
126
|
|
|
127
127
|
- [`meta-spacing`](#meta-spacing)
|
|
128
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
129
|
+
<a title="Accepts eslint --fix" target="_blank" href="https://eslint.org/docs/latest/use/command-line-interface#--fix"><img height=14 alt="[Auto-fixable]" src="https://img.shields.io/badge/Auto--fixable-3b5bdb?style=flat-square" align="middle"></a>
|
|
130
|
+
<a title="Doesn't prevent bugs" href="#meta-spacing"><img height=14 alt="[Stylistic]" src="https://img.shields.io/badge/Stylistic-af68ff?style=flat-square" align="middle"></a>
|
|
131
|
+
<a title="Accepts array w/ options" href="#meta-spacing-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
128
132
|
- [`no-invalid-headers`](#no-invalid-headers)
|
|
133
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
134
|
+
<a title="Optimized in tampermonkey config" href="#usage"><img height=14 alt="[Tampermonkey]" src="https://img.shields.io/badge/Tampermonkey-00485b?style=flat-square" align="middle"></a>
|
|
135
|
+
<a title="Optimized in violentmonkey config" href="#usage"><img height=14 alt="[Violentmonkey]" src="https://img.shields.io/badge/Violentmonkey-f01e07?style=flat-square" align="middle"></a>
|
|
136
|
+
<a title="Optimized in greasemonkey config" href="#usage"><img height=14 alt="[Greasemonkey]" src="https://img.shields.io/badge/Greasemonkey-6c4d8c?style=flat-square" align="middle"></a>
|
|
137
|
+
<a title="Optimized in scriptcat config" href="#usage"><img height=14 alt="[ScriptCat]" src="https://img.shields.io/badge/ScriptCat-1296dc?style=flat-square" align="middle"></a>
|
|
138
|
+
<a title="Optimized in adguard config" href="#usage"><img height=14 alt="[AdGuard]" src="https://img.shields.io/badge/AdGuard-68bd72?style=flat-square" align="middle"></a>
|
|
139
|
+
<a title="Accepts array w/ options" href="#no-invalid-headers-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
129
140
|
|
|
130
141
|
<div align="center">
|
|
131
142
|
|
|
@@ -156,7 +167,7 @@ If you don't care about the order of metadata fields.
|
|
|
156
167
|
|
|
157
168
|
<summary>Aligns metadata values to the column after the longest key.</summary>
|
|
158
169
|
|
|
159
|
-
|
|
170
|
+
<h4 id="meta-spacing-options">Options</h4>
|
|
160
171
|
|
|
161
172
|
- `spaces` (default `3`) – minimum spaces after the longest key
|
|
162
173
|
|
|
@@ -197,7 +208,13 @@ If you don't care about visual alignment in metadata blocks.
|
|
|
197
208
|
#### See also
|
|
198
209
|
|
|
199
210
|
- [`require-blank-line-after-meta-block`](#require-blank-line-after-meta-block)
|
|
211
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
212
|
+
<a title="Accepts eslint --fix" target="_blank" href="https://eslint.org/docs/latest/use/command-line-interface#--fix"><img height=14 alt="[Auto-fixable]" src="https://img.shields.io/badge/Auto--fixable-3b5bdb?style=flat-square" align="middle"></a>
|
|
213
|
+
<a title="Doesn't prevent bugs" href="#require-blank-line-after-meta-block"><img height=14 alt="[Stylistic]" src="https://img.shields.io/badge/Stylistic-af68ff?style=flat-square" align="middle"></a>
|
|
200
214
|
- [`require-space-before-meta-key`](#require-space-before-meta-key)
|
|
215
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
216
|
+
<a title="Accepts eslint --fix" target="_blank" href="https://eslint.org/docs/latest/use/command-line-interface#--fix"><img height=14 alt="[Auto-fixable]" src="https://img.shields.io/badge/Auto--fixable-3b5bdb?style=flat-square" align="middle"></a>
|
|
217
|
+
<a title="Doesn't prevent bugs" href="#require-space-before-meta-key"><img height=14 alt="[Stylistic]" src="https://img.shields.io/badge/Stylistic-af68ff?style=flat-square" align="middle"></a>
|
|
201
218
|
|
|
202
219
|
<div align="center">
|
|
203
220
|
|
|
@@ -261,7 +278,11 @@ If you intentionally repeat single-value keys.
|
|
|
261
278
|
#### See also
|
|
262
279
|
|
|
263
280
|
- [`require-matching-localized-fields`](#require-matching-localized-fields)
|
|
281
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
282
|
+
<a title="Accepts array w/ options" href="#require-matching-localized-fields-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
264
283
|
- [`require-required-fields`](#require-required-fields)
|
|
284
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
285
|
+
<a title="Accepts array w/ options" href="#require-required-fields-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
265
286
|
|
|
266
287
|
<div align="center">
|
|
267
288
|
|
|
@@ -298,7 +319,7 @@ If you intentionally repeat single-value keys.
|
|
|
298
319
|
|
|
299
320
|
<summary>Disallows invalid or unsupported <code>@grant</code> values.</summary>
|
|
300
321
|
|
|
301
|
-
|
|
322
|
+
<h4 id="no-invalid-grants-options">Options</h4>
|
|
302
323
|
|
|
303
324
|
- `target` (default `'all'`) – manager(s) whose grants to validate against (`'all'`, `'tampermonkey'`, `'violentmonkey'`, `'greasemonkey'`, `'scriptcat'`, `'adguard'`), as a single string or array
|
|
304
325
|
- `allowedGrants` (default `[]`) – additional `@grant` values to allow beyond the built-in list (covering Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat and AdGuard), as a single string or array
|
|
@@ -354,7 +375,9 @@ If you don't want `@grant` validation at all. For individual uncovered grants, p
|
|
|
354
375
|
#### See also
|
|
355
376
|
|
|
356
377
|
- [`no-missing-grants`](#no-missing-grants)
|
|
378
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
357
379
|
- [`no-unused-grants`](#no-unused-grants)
|
|
380
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
358
381
|
|
|
359
382
|
<div align="center">
|
|
360
383
|
|
|
@@ -391,7 +414,7 @@ If you don't want `@grant` validation at all. For individual uncovered grants, p
|
|
|
391
414
|
|
|
392
415
|
<summary>Disallows invalid or unsupported metadata headers.</summary>
|
|
393
416
|
|
|
394
|
-
|
|
417
|
+
<h4 id="no-invalid-headers-options">Options</h4>
|
|
395
418
|
|
|
396
419
|
- `target` (default `'all'`) – manager(s) whose headers to validate against (`'all'`, `'tampermonkey'`, `'violentmonkey'`, `'greasemonkey'`, `'scriptcat'`, `'adguard'`), as a single string or array
|
|
397
420
|
- `allowedHeaders` (default `[]`) – additional headers to allow (strings or regexes), as a single value or array
|
|
@@ -435,7 +458,16 @@ If your script relies heavily on custom headers and you'd rather not maintain `a
|
|
|
435
458
|
#### See also
|
|
436
459
|
|
|
437
460
|
- [`no-invalid-grants`](#no-invalid-grants)
|
|
461
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
462
|
+
<a title="Optimized in tampermonkey config" href="#usage"><img height=14 alt="[Tampermonkey]" src="https://img.shields.io/badge/Tampermonkey-00485b?style=flat-square" align="middle"></a>
|
|
463
|
+
<a title="Optimized in violentmonkey config" href="#usage"><img height=14 alt="[Violentmonkey]" src="https://img.shields.io/badge/Violentmonkey-f01e07?style=flat-square" align="middle"></a>
|
|
464
|
+
<a title="Optimized in greasemonkey config" href="#usage"><img height=14 alt="[Greasemonkey]" src="https://img.shields.io/badge/Greasemonkey-6c4d8c?style=flat-square" align="middle"></a>
|
|
465
|
+
<a title="Optimized in scriptcat config" href="#usage"><img height=14 alt="[ScriptCat]" src="https://img.shields.io/badge/ScriptCat-1296dc?style=flat-square" align="middle"></a>
|
|
466
|
+
<a title="Optimized in adguard config" href="#usage"><img height=14 alt="[AdGuard]" src="https://img.shields.io/badge/AdGuard-68bd72?style=flat-square" align="middle"></a>
|
|
467
|
+
<a title="Accepts array w/ options" href="#no-invalid-grants-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
438
468
|
- [`valid-field-values`](#valid-field-values)
|
|
469
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
470
|
+
<a title="Accepts array w/ options" href="#valid-field-values-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
439
471
|
|
|
440
472
|
<div align="center">
|
|
441
473
|
|
|
@@ -492,7 +524,15 @@ If you use APIs through aliases or wrappers that obscure the original call site.
|
|
|
492
524
|
#### See also
|
|
493
525
|
|
|
494
526
|
- [`no-invalid-grants`](#no-invalid-grants)
|
|
527
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
528
|
+
<a title="Optimized in tampermonkey config" href="#usage"><img height=14 alt="[Tampermonkey]" src="https://img.shields.io/badge/Tampermonkey-00485b?style=flat-square" align="middle"></a>
|
|
529
|
+
<a title="Optimized in violentmonkey config" href="#usage"><img height=14 alt="[Violentmonkey]" src="https://img.shields.io/badge/Violentmonkey-f01e07?style=flat-square" align="middle"></a>
|
|
530
|
+
<a title="Optimized in greasemonkey config" href="#usage"><img height=14 alt="[Greasemonkey]" src="https://img.shields.io/badge/Greasemonkey-6c4d8c?style=flat-square" align="middle"></a>
|
|
531
|
+
<a title="Optimized in scriptcat config" href="#usage"><img height=14 alt="[ScriptCat]" src="https://img.shields.io/badge/ScriptCat-1296dc?style=flat-square" align="middle"></a>
|
|
532
|
+
<a title="Optimized in adguard config" href="#usage"><img height=14 alt="[AdGuard]" src="https://img.shields.io/badge/AdGuard-68bd72?style=flat-square" align="middle"></a>
|
|
533
|
+
<a title="Accepts array w/ options" href="#no-invalid-grants-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
495
534
|
- [`no-unused-grants`](#no-unused-grants)
|
|
535
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
496
536
|
|
|
497
537
|
<div align="center">
|
|
498
538
|
|
|
@@ -549,6 +589,7 @@ If you reference resources through an alias or computed pattern that obscures th
|
|
|
549
589
|
#### See also
|
|
550
590
|
|
|
551
591
|
- [`no-unused-resources`](#no-unused-resources)
|
|
592
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
552
593
|
|
|
553
594
|
<div align="center">
|
|
554
595
|
|
|
@@ -602,7 +643,15 @@ If you access the granted API through an alias or computed property rather than
|
|
|
602
643
|
#### See also
|
|
603
644
|
|
|
604
645
|
- [`no-invalid-grants`](#no-invalid-grants)
|
|
646
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
647
|
+
<a title="Optimized in tampermonkey config" href="#usage"><img height=14 alt="[Tampermonkey]" src="https://img.shields.io/badge/Tampermonkey-00485b?style=flat-square" align="middle"></a>
|
|
648
|
+
<a title="Optimized in violentmonkey config" href="#usage"><img height=14 alt="[Violentmonkey]" src="https://img.shields.io/badge/Violentmonkey-f01e07?style=flat-square" align="middle"></a>
|
|
649
|
+
<a title="Optimized in greasemonkey config" href="#usage"><img height=14 alt="[Greasemonkey]" src="https://img.shields.io/badge/Greasemonkey-6c4d8c?style=flat-square" align="middle"></a>
|
|
650
|
+
<a title="Optimized in scriptcat config" href="#usage"><img height=14 alt="[ScriptCat]" src="https://img.shields.io/badge/ScriptCat-1296dc?style=flat-square" align="middle"></a>
|
|
651
|
+
<a title="Optimized in adguard config" href="#usage"><img height=14 alt="[AdGuard]" src="https://img.shields.io/badge/AdGuard-68bd72?style=flat-square" align="middle"></a>
|
|
652
|
+
<a title="Accepts array w/ options" href="#no-invalid-grants-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
605
653
|
- [`no-missing-grants`](#no-missing-grants)
|
|
654
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
606
655
|
|
|
607
656
|
<div align="center">
|
|
608
657
|
|
|
@@ -656,6 +705,7 @@ If you pass resource names through variables or aliases rather than use them lit
|
|
|
656
705
|
#### See also
|
|
657
706
|
|
|
658
707
|
- [`no-missing-resources`](#no-missing-resources)
|
|
708
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
659
709
|
|
|
660
710
|
<div align="center">
|
|
661
711
|
|
|
@@ -707,8 +757,8 @@ If you rely on `@include` patterns that cannot be expressed using `@match`.
|
|
|
707
757
|
|
|
708
758
|
#### See also
|
|
709
759
|
|
|
710
|
-
- <a target="_blank" href="https://www.tampermonkey.net/documentation.php?locale=en&q=include#meta:match">Tampermonkey — `@match`</a>
|
|
711
|
-
- <a target="_blank" href="https://www.tampermonkey.net/documentation.php?locale=en&q=include#meta:include">Tampermonkey — `@include`</a>
|
|
760
|
+
- <img height=12 src="https://www.google.com/s2/favicons?domain=tampermonkey.net&sz=64"> <a target="_blank" href="https://www.tampermonkey.net/documentation.php?locale=en&q=include#meta:match">Tampermonkey — `@match`</a>
|
|
761
|
+
- <img height=12 src="https://www.google.com/s2/favicons?domain=tampermonkey.net&sz=64"> <a target="_blank" href="https://www.tampermonkey.net/documentation.php?locale=en&q=include#meta:include">Tampermonkey — `@include`</a>
|
|
712
762
|
|
|
713
763
|
<div align="center">
|
|
714
764
|
|
|
@@ -771,7 +821,15 @@ If you don't care about visual separation between metadata and code.
|
|
|
771
821
|
#### See also
|
|
772
822
|
|
|
773
823
|
- [`meta-order`](#meta-order)
|
|
824
|
+
<a title="Only included in strict config" href="#usage"><img height=14 alt="[Strict only]" src="https://img.shields.io/badge/Strict_only-ff8c42?style=flat-square" align="middle"></a>
|
|
825
|
+
<a title="Accepts eslint --fix" target="_blank" href="https://eslint.org/docs/latest/use/command-line-interface#--fix"><img height=14 alt="[Auto-fixable]" src="https://img.shields.io/badge/Auto--fixable-3b5bdb?style=flat-square" align="middle"></a>
|
|
826
|
+
<a title="Doesn't prevent bugs" href="#meta-order"><img height=14 alt="[Stylistic]" src="https://img.shields.io/badge/Stylistic-af68ff?style=flat-square" align="middle"></a>
|
|
827
|
+
<a title="Accepts array w/ options" href="#meta-order-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
774
828
|
- [`meta-spacing`](#meta-spacing)
|
|
829
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
830
|
+
<a title="Accepts eslint --fix" target="_blank" href="https://eslint.org/docs/latest/use/command-line-interface#--fix"><img height=14 alt="[Auto-fixable]" src="https://img.shields.io/badge/Auto--fixable-3b5bdb?style=flat-square" align="middle"></a>
|
|
831
|
+
<a title="Doesn't prevent bugs" href="#meta-spacing"><img height=14 alt="[Stylistic]" src="https://img.shields.io/badge/Stylistic-af68ff?style=flat-square" align="middle"></a>
|
|
832
|
+
<a title="Accepts array w/ options" href="#meta-spacing-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
775
833
|
|
|
776
834
|
<div align="center">
|
|
777
835
|
|
|
@@ -825,9 +883,8 @@ If you don't care about ensuring homepage URL compatibility across different man
|
|
|
825
883
|
|
|
826
884
|
#### See also
|
|
827
885
|
|
|
828
|
-
-
|
|
829
|
-
- <a target="_blank" href="https://
|
|
830
|
-
- <a target="_blank" href="https://docs.scriptcat.org/en/docs/dev/meta/#homepage-homepageurl-website">ScriptCat `@homepage`, `@homepageURL`, `@website`</a>
|
|
886
|
+
- <img height=12 src="https://www.google.com/s2/favicons?domain=tampermonkey.net&sz=64"> <a target="_blank" href="https://www.tampermonkey.net/documentation.php?q=homepage#meta:homepage">Tampermonkey `@homepage`, `@homepageURL`, `@website`, `@source`</a>
|
|
887
|
+
- <img height=12 src="https://www.google.com/s2/favicons?domain=docs.scriptcat.org&sz=64"> <a target="_blank" href="https://docs.scriptcat.org/en/docs/dev/meta/#homepage-homepageurl-website">ScriptCat `@homepage`, `@homepageURL`, `@website`</a>
|
|
831
888
|
|
|
832
889
|
<div align="center">
|
|
833
890
|
|
|
@@ -854,7 +911,7 @@ If you don't care about ensuring homepage URL compatibility across different man
|
|
|
854
911
|
|
|
855
912
|
<summary>Requires that every <code>@name:xx</code> has a matching <code>@description:xx</code> (and vice versa).</summary>
|
|
856
913
|
|
|
857
|
-
|
|
914
|
+
<h4 id="require-matching-localized-fields-options">Options</h4>
|
|
858
915
|
|
|
859
916
|
- `ignoreLanguages` (default `[]`) – language code(s) to skip (e.g. `'de'` or `['es', 'fr']`)
|
|
860
917
|
|
|
@@ -896,7 +953,10 @@ If you intentionally provide localized names without descriptions (or vice versa
|
|
|
896
953
|
#### See also
|
|
897
954
|
|
|
898
955
|
- [`no-duplicate-keys`](#no-duplicate-keys)
|
|
956
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
899
957
|
- [`require-required-fields`](#require-required-fields)
|
|
958
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
959
|
+
<a title="Accepts array w/ options" href="#require-required-fields-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
900
960
|
|
|
901
961
|
<div align="center">
|
|
902
962
|
|
|
@@ -923,7 +983,7 @@ If you intentionally provide localized names without descriptions (or vice versa
|
|
|
923
983
|
|
|
924
984
|
<summary>Requires essential metadata fields (<code>@name</code>, <code>@version</code> and at least one <code>@match</code> or <code>@include</code>).</summary>
|
|
925
985
|
|
|
926
|
-
|
|
986
|
+
<h4 id="require-required-fields-options">Options</h4>
|
|
927
987
|
|
|
928
988
|
- `fields` (default `['name', 'version']`) – override the required field list
|
|
929
989
|
- `requireMatchOrInclude` (default `true`) – require `@match` or `@include`
|
|
@@ -962,7 +1022,10 @@ If your script is a work-in-progress, or metadata is injected at build time.
|
|
|
962
1022
|
#### See also
|
|
963
1023
|
|
|
964
1024
|
- [`no-duplicate-keys`](#no-duplicate-keys)
|
|
1025
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
965
1026
|
- [`require-matching-localized-fields`](#require-matching-localized-fields)
|
|
1027
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
1028
|
+
<a title="Accepts array w/ options" href="#require-matching-localized-fields-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
966
1029
|
|
|
967
1030
|
<div align="center">
|
|
968
1031
|
|
|
@@ -1021,7 +1084,14 @@ If you intentionally use a different prefix style.
|
|
|
1021
1084
|
#### See also
|
|
1022
1085
|
|
|
1023
1086
|
- [`meta-spacing`](#meta-spacing)
|
|
1087
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
1088
|
+
<a title="Accepts eslint --fix" target="_blank" href="https://eslint.org/docs/latest/use/command-line-interface#--fix"><img height=14 alt="[Auto-fixable]" src="https://img.shields.io/badge/Auto--fixable-3b5bdb?style=flat-square" align="middle"></a>
|
|
1089
|
+
<a title="Doesn't prevent bugs" href="#meta-spacing"><img height=14 alt="[Stylistic]" src="https://img.shields.io/badge/Stylistic-af68ff?style=flat-square" align="middle"></a>
|
|
1090
|
+
<a title="Accepts array w/ options" href="#meta-spacing-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
1024
1091
|
- [`require-blank-line-after-meta-block`](#require-blank-line-after-meta-block)
|
|
1092
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
1093
|
+
<a title="Accepts eslint --fix" target="_blank" href="https://eslint.org/docs/latest/use/command-line-interface#--fix"><img height=14 alt="[Auto-fixable]" src="https://img.shields.io/badge/Auto--fixable-3b5bdb?style=flat-square" align="middle"></a>
|
|
1094
|
+
<a title="Doesn't prevent bugs" href="#require-blank-line-after-meta-block"><img height=14 alt="[Stylistic]" src="https://img.shields.io/badge/Stylistic-af68ff?style=flat-square" align="middle"></a>
|
|
1025
1095
|
|
|
1026
1096
|
<div align="center">
|
|
1027
1097
|
|
|
@@ -1048,7 +1118,7 @@ If you intentionally use a different prefix style.
|
|
|
1048
1118
|
|
|
1049
1119
|
<summary>Requires SRI hashes on <code>@require</code> and <code>@resource</code> URLs.</summary>
|
|
1050
1120
|
|
|
1051
|
-
|
|
1121
|
+
<h4 id="require-sri-hashing-options">Options</h4>
|
|
1052
1122
|
|
|
1053
1123
|
- `algorithm` (default `'sha256'`) – SRI hash algorithm(s) to enforce (`'md5'`, `'sha1'`, `'sha256'`, `'sha384'`, `'sha512'`), as a single string or array
|
|
1054
1124
|
|
|
@@ -1088,8 +1158,8 @@ If you prefer shorter URLs, or don't support users who strictly enforce subresou
|
|
|
1088
1158
|
|
|
1089
1159
|
#### See also
|
|
1090
1160
|
|
|
1091
|
-
- <a target="_blank" href="https://www.tampermonkey.net/documentation.php?q=sri">Tampermonkey — Subresource Integrity</a>
|
|
1092
|
-
- <a target="_blank" href="https://docs.scriptcat.org/en/docs/dev/meta/#resource-integrity-verification">ScriptCat — Resource Integrity Verification</a>
|
|
1161
|
+
- <img height=12 src="https://www.google.com/s2/favicons?domain=tampermonkey.net&sz=64"> <a target="_blank" href="https://www.tampermonkey.net/documentation.php?q=sri">Tampermonkey — Subresource Integrity</a>
|
|
1162
|
+
- <img height=12 src="https://www.google.com/s2/favicons?domain=docs.scriptcat.org&sz=64"> <a target="_blank" href="https://docs.scriptcat.org/en/docs/dev/meta/#resource-integrity-verification">ScriptCat — Resource Integrity Verification</a>
|
|
1093
1163
|
|
|
1094
1164
|
<div align="center">
|
|
1095
1165
|
|
|
@@ -1147,8 +1217,8 @@ If you don't strictly target Tampermonkey, ScriptCat or AdGuard (where `@updateU
|
|
|
1147
1217
|
|
|
1148
1218
|
#### See also
|
|
1149
1219
|
|
|
1150
|
-
- <a target="_blank" href="https://www.tampermonkey.net/documentation.php?q=update_url#meta:updateURL">Tampermonkey — `@updateURL`</a>
|
|
1151
|
-
- <a target="_blank" href="https://docs.scriptcat.org/en/docs/dev/meta/#updateurl">ScriptCat — `@updateURL`</a>
|
|
1220
|
+
- <img height=12 src="https://www.google.com/s2/favicons?domain=tampermonkey.net&sz=64"> <a target="_blank" href="https://www.tampermonkey.net/documentation.php?q=update_url#meta:updateURL">Tampermonkey — `@updateURL`</a>
|
|
1221
|
+
- <img height=12 src="https://www.google.com/s2/favicons?domain=docs.scriptcat.org&sz=64"> <a target="_blank" href="https://docs.scriptcat.org/en/docs/dev/meta/#updateurl">ScriptCat — `@updateURL`</a>
|
|
1152
1222
|
|
|
1153
1223
|
<div align="center">
|
|
1154
1224
|
|
|
@@ -1219,7 +1289,7 @@ If you intentionally name your userscripts something other than `*.user.js`.
|
|
|
1219
1289
|
|
|
1220
1290
|
<summary>Validates <code>@version</code> (semver or date format) and URL fields.</summary>
|
|
1221
1291
|
|
|
1222
|
-
|
|
1292
|
+
<h4 id="valid-field-values-options">Options</h4>
|
|
1223
1293
|
|
|
1224
1294
|
- `versionType` (default `'semver'`) – version format to enforce (`'semver'`, `'date'`)
|
|
1225
1295
|
- `allowFutureDate` (default `false`) – allow `@version` dates later than the current date
|
|
@@ -1260,7 +1330,21 @@ If you use a custom versioning scheme or URLs that aren't standard.
|
|
|
1260
1330
|
#### See also
|
|
1261
1331
|
|
|
1262
1332
|
- [`no-invalid-grants`](#no-invalid-grants)
|
|
1333
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
1334
|
+
<a title="Optimized in tampermonkey config" href="#usage"><img height=14 alt="[Tampermonkey]" src="https://img.shields.io/badge/Tampermonkey-00485b?style=flat-square" align="middle"></a>
|
|
1335
|
+
<a title="Optimized in violentmonkey config" href="#usage"><img height=14 alt="[Violentmonkey]" src="https://img.shields.io/badge/Violentmonkey-f01e07?style=flat-square" align="middle"></a>
|
|
1336
|
+
<a title="Optimized in greasemonkey config" href="#usage"><img height=14 alt="[Greasemonkey]" src="https://img.shields.io/badge/Greasemonkey-6c4d8c?style=flat-square" align="middle"></a>
|
|
1337
|
+
<a title="Optimized in scriptcat config" href="#usage"><img height=14 alt="[ScriptCat]" src="https://img.shields.io/badge/ScriptCat-1296dc?style=flat-square" align="middle"></a>
|
|
1338
|
+
<a title="Optimized in adguard config" href="#usage"><img height=14 alt="[AdGuard]" src="https://img.shields.io/badge/AdGuard-68bd72?style=flat-square" align="middle"></a>
|
|
1339
|
+
<a title="Accepts array w/ options" href="#no-invalid-grants-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
1263
1340
|
- [`no-invalid-headers`](#no-invalid-headers)
|
|
1341
|
+
<a title="Included in recommended config" href="#usage"><img height=14 alt="[Recommended]" src="https://img.shields.io/badge/Recommended-f1f20a?style=flat-square" align="middle"></a>
|
|
1342
|
+
<a title="Optimized in tampermonkey config" href="#usage"><img height=14 alt="[Tampermonkey]" src="https://img.shields.io/badge/Tampermonkey-00485b?style=flat-square" align="middle"></a>
|
|
1343
|
+
<a title="Optimized in violentmonkey config" href="#usage"><img height=14 alt="[Violentmonkey]" src="https://img.shields.io/badge/Violentmonkey-f01e07?style=flat-square" align="middle"></a>
|
|
1344
|
+
<a title="Optimized in greasemonkey config" href="#usage"><img height=14 alt="[Greasemonkey]" src="https://img.shields.io/badge/Greasemonkey-6c4d8c?style=flat-square" align="middle"></a>
|
|
1345
|
+
<a title="Optimized in scriptcat config" href="#usage"><img height=14 alt="[ScriptCat]" src="https://img.shields.io/badge/ScriptCat-1296dc?style=flat-square" align="middle"></a>
|
|
1346
|
+
<a title="Optimized in adguard config" href="#usage"><img height=14 alt="[AdGuard]" src="https://img.shields.io/badge/AdGuard-68bd72?style=flat-square" align="middle"></a>
|
|
1347
|
+
<a title="Accepts array w/ options" href="#no-invalid-headers-options"><img height=14 alt="[Configurable]" src="https://img.shields.io/badge/Configurable-black?style=flat-square" align="middle"></a>
|
|
1264
1348
|
|
|
1265
1349
|
<div align="center">
|
|
1266
1350
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-greasemonkey",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.4",
|
|
4
4
|
"description": "ESLint rules for Greasemonkey/Tampermonkey userscripts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "src/index.d.ts",
|
|
36
36
|
"scripts": {
|
|
37
|
-
"prepare": "husky",
|
|
38
37
|
"lint": "eslint . --cache && yamllint .",
|
|
39
38
|
"lint:all": "eslint . && yamllint .",
|
|
40
39
|
"lint:fix": "eslint . --fix --cache && yamllint .",
|
|
@@ -65,11 +64,11 @@
|
|
|
65
64
|
"devDependencies": {
|
|
66
65
|
"@e18e/eslint-plugin": "^0.8.1",
|
|
67
66
|
"@eslint/js": "^10.0.1",
|
|
68
|
-
"@eslint/json": "^2.1.
|
|
69
|
-
"@eslint/markdown": "^
|
|
67
|
+
"@eslint/json": "^2.1.1",
|
|
68
|
+
"@eslint/markdown": "^7.5.1",
|
|
70
69
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
71
70
|
"eslint": "^10.12.0",
|
|
72
|
-
"eslint-plugin-constructors": "^1.4.
|
|
71
|
+
"eslint-plugin-constructors": "^1.4.2",
|
|
73
72
|
"eslint-plugin-eslint-plugin": "^7.6.2",
|
|
74
73
|
"eslint-plugin-import-x": "^4.17.1",
|
|
75
74
|
"eslint-plugin-n": "^18.4.1",
|
|
@@ -79,7 +78,6 @@
|
|
|
79
78
|
"eslint-plugin-regexp": "^3.3.1",
|
|
80
79
|
"eslint-plugin-security": "^4.2.0",
|
|
81
80
|
"globals": "^17.13.0",
|
|
82
|
-
"husky": "^9.1.7",
|
|
83
81
|
"yamllint-js": "^0.2.4"
|
|
84
82
|
}
|
|
85
83
|
}
|