@jomae/catalog 0.7.0 → 0.9.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/dist/generated/baseline-history.js +4 -4
- package/dist/generated/baseline.d.ts.map +1 -1
- package/dist/generated/baseline.js +113 -1
- package/dist/generated/baseline.js.map +1 -1
- package/dist/generated/guides.d.ts.map +1 -1
- package/dist/generated/guides.js +6 -2
- package/dist/generated/guides.js.map +1 -1
- package/dist/generated/lint-rules.d.ts +26 -0
- package/dist/generated/lint-rules.d.ts.map +1 -0
- package/dist/generated/lint-rules.js +361 -0
- package/dist/generated/lint-rules.js.map +1 -0
- package/dist/generated/sizes.d.ts.map +1 -1
- package/dist/generated/sizes.js +128 -13
- package/dist/generated/sizes.js.map +1 -1
- package/dist/generated/support-claims.d.ts.map +1 -1
- package/dist/generated/support-claims.js +7 -1
- package/dist/generated/support-claims.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/lint.d.ts +53 -0
- package/dist/lint.d.ts.map +1 -0
- package/dist/lint.js +41 -0
- package/dist/lint.js.map +1 -0
- package/dist/markdown.d.ts +7 -0
- package/dist/markdown.d.ts.map +1 -1
- package/dist/markdown.js +81 -2
- package/dist/markdown.js.map +1 -1
- package/dist/rules/abort-controller.d.ts.map +1 -1
- package/dist/rules/abort-controller.js +3 -0
- package/dist/rules/abort-controller.js.map +1 -1
- package/dist/rules/accordion.d.ts.map +1 -1
- package/dist/rules/accordion.js +3 -0
- package/dist/rules/accordion.js.map +1 -1
- package/dist/rules/array-grouping.d.ts.map +1 -1
- package/dist/rules/array-grouping.js +1 -0
- package/dist/rules/array-grouping.js.map +1 -1
- package/dist/rules/aspect-ratio.d.ts.map +1 -1
- package/dist/rules/aspect-ratio.js +4 -0
- package/dist/rules/aspect-ratio.js.map +1 -1
- package/dist/rules/base64.d.ts.map +1 -1
- package/dist/rules/base64.js +3 -0
- package/dist/rules/base64.js.map +1 -1
- package/dist/rules/broadcast-channel.d.ts.map +1 -1
- package/dist/rules/broadcast-channel.js +3 -0
- package/dist/rules/broadcast-channel.js.map +1 -1
- package/dist/rules/carousel.d.ts.map +1 -1
- package/dist/rules/carousel.js +5 -0
- package/dist/rules/carousel.js.map +1 -1
- package/dist/rules/clipboard.d.ts.map +1 -1
- package/dist/rules/clipboard.js +3 -0
- package/dist/rules/clipboard.js.map +1 -1
- package/dist/rules/container-queries.d.ts.map +1 -1
- package/dist/rules/container-queries.js +3 -0
- package/dist/rules/container-queries.js.map +1 -1
- package/dist/rules/date-time-input.d.ts.map +1 -1
- package/dist/rules/date-time-input.js +4 -0
- package/dist/rules/date-time-input.js.map +1 -1
- package/dist/rules/dialog.d.ts.map +1 -1
- package/dist/rules/dialog.js +4 -0
- package/dist/rules/dialog.js.map +1 -1
- package/dist/rules/discrete-transitions.d.ts.map +1 -1
- package/dist/rules/discrete-transitions.js +4 -0
- package/dist/rules/discrete-transitions.js.map +1 -1
- package/dist/rules/display-names.d.ts +3 -0
- package/dist/rules/display-names.d.ts.map +1 -0
- package/dist/rules/display-names.js +33 -0
- package/dist/rules/display-names.js.map +1 -0
- package/dist/rules/duration-format.d.ts.map +1 -1
- package/dist/rules/duration-format.js +3 -0
- package/dist/rules/duration-format.js.map +1 -1
- package/dist/rules/event-target.d.ts.map +1 -1
- package/dist/rules/event-target.js +1 -0
- package/dist/rules/event-target.js.map +1 -1
- package/dist/rules/focus-visible.d.ts.map +1 -1
- package/dist/rules/focus-visible.js +4 -0
- package/dist/rules/focus-visible.js.map +1 -1
- package/dist/rules/fullscreen.d.ts.map +1 -1
- package/dist/rules/fullscreen.js +3 -0
- package/dist/rules/fullscreen.js.map +1 -1
- package/dist/rules/height-animation.d.ts.map +1 -1
- package/dist/rules/height-animation.js +4 -0
- package/dist/rules/height-animation.js.map +1 -1
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/index.js +16 -0
- package/dist/rules/index.js.map +1 -1
- package/dist/rules/inert.d.ts.map +1 -1
- package/dist/rules/inert.js +4 -0
- package/dist/rules/inert.js.map +1 -1
- package/dist/rules/intersection-observer.d.ts.map +1 -1
- package/dist/rules/intersection-observer.js +1 -0
- package/dist/rules/intersection-observer.js.map +1 -1
- package/dist/rules/lazy-loading.d.ts.map +1 -1
- package/dist/rules/lazy-loading.js +4 -0
- package/dist/rules/lazy-loading.js.map +1 -1
- package/dist/rules/line-clamp.d.ts.map +1 -1
- package/dist/rules/line-clamp.js +4 -0
- package/dist/rules/line-clamp.js.map +1 -1
- package/dist/rules/list-format.d.ts +3 -0
- package/dist/rules/list-format.d.ts.map +1 -0
- package/dist/rules/list-format.js +37 -0
- package/dist/rules/list-format.js.map +1 -0
- package/dist/rules/masonry.d.ts.map +1 -1
- package/dist/rules/masonry.js +4 -0
- package/dist/rules/masonry.js.map +1 -1
- package/dist/rules/natural-sort.d.ts.map +1 -1
- package/dist/rules/natural-sort.js +4 -0
- package/dist/rules/natural-sort.js.map +1 -1
- package/dist/rules/number-format.d.ts.map +1 -1
- package/dist/rules/number-format.js +4 -0
- package/dist/rules/number-format.js.map +1 -1
- package/dist/rules/page-visibility.d.ts.map +1 -1
- package/dist/rules/page-visibility.js +3 -0
- package/dist/rules/page-visibility.js.map +1 -1
- package/dist/rules/popover.d.ts.map +1 -1
- package/dist/rules/popover.js +5 -0
- package/dist/rules/popover.js.map +1 -1
- package/dist/rules/random-uuid.d.ts.map +1 -1
- package/dist/rules/random-uuid.js +4 -0
- package/dist/rules/random-uuid.js.map +1 -1
- package/dist/rules/relative-time.d.ts.map +1 -1
- package/dist/rules/relative-time.js +4 -0
- package/dist/rules/relative-time.js.map +1 -1
- package/dist/rules/resizable-panels.d.ts.map +1 -1
- package/dist/rules/resizable-panels.js +3 -0
- package/dist/rules/resizable-panels.js.map +1 -1
- package/dist/rules/resize-observer.d.ts.map +1 -1
- package/dist/rules/resize-observer.js +4 -0
- package/dist/rules/resize-observer.js.map +1 -1
- package/dist/rules/scroll-animations.d.ts.map +1 -1
- package/dist/rules/scroll-animations.js +4 -0
- package/dist/rules/scroll-animations.js.map +1 -1
- package/dist/rules/scroll-lock.d.ts.map +1 -1
- package/dist/rules/scroll-lock.js +3 -0
- package/dist/rules/scroll-lock.js.map +1 -1
- package/dist/rules/scrollbars.d.ts.map +1 -1
- package/dist/rules/scrollbars.js +3 -0
- package/dist/rules/scrollbars.js.map +1 -1
- package/dist/rules/segmenter.d.ts +3 -0
- package/dist/rules/segmenter.d.ts.map +1 -0
- package/dist/rules/segmenter.js +41 -0
- package/dist/rules/segmenter.js.map +1 -0
- package/dist/rules/select.d.ts.map +1 -1
- package/dist/rules/select.js +3 -0
- package/dist/rules/select.js.map +1 -1
- package/dist/rules/signal-timeout.d.ts +3 -0
- package/dist/rules/signal-timeout.d.ts.map +1 -0
- package/dist/rules/signal-timeout.js +31 -0
- package/dist/rules/signal-timeout.js.map +1 -0
- package/dist/rules/smooth-scroll.d.ts.map +1 -1
- package/dist/rules/smooth-scroll.js +4 -0
- package/dist/rules/smooth-scroll.js.map +1 -1
- package/dist/rules/sticky.d.ts.map +1 -1
- package/dist/rules/sticky.js +4 -0
- package/dist/rules/sticky.js.map +1 -1
- package/dist/rules/structured-clone.d.ts.map +1 -1
- package/dist/rules/structured-clone.js +1 -0
- package/dist/rules/structured-clone.js.map +1 -1
- package/dist/rules/text-wrap-balance.d.ts.map +1 -1
- package/dist/rules/text-wrap-balance.js +3 -0
- package/dist/rules/text-wrap-balance.js.map +1 -1
- package/dist/rules/url-pattern.d.ts +3 -0
- package/dist/rules/url-pattern.d.ts.map +1 -0
- package/dist/rules/url-pattern.js +36 -0
- package/dist/rules/url-pattern.js.map +1 -0
- package/dist/rules/url-search-params.d.ts.map +1 -1
- package/dist/rules/url-search-params.js +1 -0
- package/dist/rules/url-search-params.js.map +1 -1
- package/dist/rules/web-animations.d.ts +3 -0
- package/dist/rules/web-animations.d.ts.map +1 -0
- package/dist/rules/web-animations.js +40 -0
- package/dist/rules/web-animations.js.map +1 -0
- package/dist/rules/web-locks.d.ts +3 -0
- package/dist/rules/web-locks.d.ts.map +1 -0
- package/dist/rules/web-locks.js +35 -0
- package/dist/rules/web-locks.js.map +1 -0
- package/dist/rules/web-share.d.ts.map +1 -1
- package/dist/rules/web-share.js +3 -0
- package/dist/rules/web-share.js.map +1 -1
- package/dist/rules/with-resolvers.d.ts +3 -0
- package/dist/rules/with-resolvers.d.ts.map +1 -0
- package/dist/rules/with-resolvers.js +30 -0
- package/dist/rules/with-resolvers.js.map +1 -0
- package/dist/schema.d.ts +4 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +34 -0
- package/dist/schema.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-format.d.ts","sourceRoot":"","sources":["../../src/rules/number-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"number-format.d.ts","sourceRoot":"","sources":["../../src/rules/number-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,IAgC1B,CAAC"}
|
|
@@ -22,6 +22,10 @@ export const numberFormat = {
|
|
|
22
22
|
"You need a custom format pattern, such as a specific abbreviation style, that the options Intl.NumberFormat exposes cannot express.",
|
|
23
23
|
],
|
|
24
24
|
snippet: 'new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(value);',
|
|
25
|
+
handRolled: [
|
|
26
|
+
"a regex inserting thousands separators into a number's string form",
|
|
27
|
+
"toFixed followed by string surgery to add a currency symbol and group the digits",
|
|
28
|
+
],
|
|
25
29
|
},
|
|
26
30
|
};
|
|
27
31
|
//# sourceMappingURL=number-format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-format.js","sourceRoot":"","sources":["../../src/rules/number-format.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,6CAA6C;IACpD,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC;IACnE,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE;QACL,SAAS,EACP,wZAAwZ;QAC1Z,OAAO,EAAE;;;kCAGqB;QAC9B,MAAM,EACJ,oGAAoG;KACvG;IACD,KAAK,EAAE;QACL,IAAI,EAAE,yGAAyG;QAC/G,MAAM,EAAE;YACN,0fAA0f;YAC1f,mOAAmO;YACnO,qJAAqJ;YACrJ,qIAAqI;SACtI;QACD,OAAO,EACL,uFAAuF;
|
|
1
|
+
{"version":3,"file":"number-format.js","sourceRoot":"","sources":["../../src/rules/number-format.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,6CAA6C;IACpD,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC;IACnE,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE;QACL,SAAS,EACP,wZAAwZ;QAC1Z,OAAO,EAAE;;;kCAGqB;QAC9B,MAAM,EACJ,oGAAoG;KACvG;IACD,KAAK,EAAE;QACL,IAAI,EAAE,yGAAyG;QAC/G,MAAM,EAAE;YACN,0fAA0f;YAC1f,mOAAmO;YACnO,qJAAqJ;YACrJ,qIAAqI;SACtI;QACD,OAAO,EACL,uFAAuF;QACzF,UAAU,EAAE;YACV,oEAAoE;YACpE,kFAAkF;SACnF;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-visibility.d.ts","sourceRoot":"","sources":["../../src/rules/page-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"page-visibility.d.ts","sourceRoot":"","sources":["../../src/rules/page-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,cAAc,EAAE,IAgC5B,CAAC"}
|
|
@@ -20,6 +20,9 @@ export const pageVisibility = {
|
|
|
20
20
|
"You need to distinguish a window occluded by another window from a genuinely backgrounded tab. visibilityState only reports the latter.",
|
|
21
21
|
],
|
|
22
22
|
snippet: `document.addEventListener("visibilitychange", () => { ... });`,
|
|
23
|
+
handRolled: [
|
|
24
|
+
"a blur handler standing in for the tab being backgrounded, pausing a poll that a focus handler resumes",
|
|
25
|
+
],
|
|
23
26
|
},
|
|
24
27
|
guides: [
|
|
25
28
|
"detect-initial-visibility-state",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-visibility.js","sourceRoot":"","sources":["../../src/rules/page-visibility.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,uBAAuB,EAAE,cAAc,CAAC;IACnD,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,MAAM,EAAE,yDAAyD;IACjE,KAAK,EAAE;QACL,SAAS,EACP,wRAAwR;QAC1R,OAAO,EAAE;;;IAGT;QACA,MAAM,EACJ,kFAAkF;KACrF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,kGAAkG;QACxG,MAAM,EAAE;YACN,+GAA+G;YAC/G,yIAAyI;SAC1I;QACD,OAAO,EAAE,+DAA+D;
|
|
1
|
+
{"version":3,"file":"page-visibility.js","sourceRoot":"","sources":["../../src/rules/page-visibility.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,uBAAuB,EAAE,cAAc,CAAC;IACnD,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,MAAM,EAAE,yDAAyD;IACjE,KAAK,EAAE;QACL,SAAS,EACP,wRAAwR;QAC1R,OAAO,EAAE;;;IAGT;QACA,MAAM,EACJ,kFAAkF;KACrF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,kGAAkG;QACxG,MAAM,EAAE;YACN,+GAA+G;YAC/G,yIAAyI;SAC1I;QACD,OAAO,EAAE,+DAA+D;QACxE,UAAU,EAAE;YACV,wGAAwG;SACzG;KACF;IACD,MAAM,EAAE;QACN,iCAAiC;QACjC,iCAAiC;KAClC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/rules/popover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/rules/popover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,IA4ErB,CAAC"}
|
package/dist/rules/popover.js
CHANGED
|
@@ -62,6 +62,11 @@ export const popover = {
|
|
|
62
62
|
position-try-fallbacks: flip-block;
|
|
63
63
|
}
|
|
64
64
|
</style>`,
|
|
65
|
+
handRolled: [
|
|
66
|
+
"calling getBoundingClientRect on a trigger inside scroll and resize listeners to place a floating panel",
|
|
67
|
+
"writing top and left onto a tooltip from a requestAnimationFrame loop",
|
|
68
|
+
"flip logic comparing a panel's rect against the viewport and moving it to the other side of its trigger",
|
|
69
|
+
],
|
|
65
70
|
},
|
|
66
71
|
guides: [
|
|
67
72
|
"position-aware-tooltips",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/rules/popover.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAS;IAC3B,EAAE,EAAE,4BAA4B;IAChC,KAAK,EAAE,kCAAkC;IACzC,QAAQ,EAAE,OAAO;IACjB,QAAQ,EAAE;QACR,oBAAoB;QACpB,wBAAwB;QACxB,kBAAkB;QAClB,gBAAgB;QAChB,WAAW;QACX,UAAU;QACV,gBAAgB;QAChB,cAAc;QACd,eAAe;QACf,cAAc;QACd,WAAW;QACX,2BAA2B;KAC5B;IACD,UAAU,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC;IAC7C,MAAM,EAAE,6CAA6C;IACrD,KAAK,EAAE;QACL,SAAS,EACP,ugBAAugB;QACzgB,OAAO,EAAE;;;;;;;;;;;;;;;;;;SAkBJ;QACL,OAAO,EAAE,6CAA6C;QACtD,MAAM,EAAE,8DAA8D;KACvE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,oEAAoE;QAC1E,MAAM,EAAE;YACN,uUAAuU;YACvU,iIAAiI;YACjI,0DAA0D;YAC1D,iHAAiH;YACjH,uEAAuE;SACxE;QACD,OAAO,EAAE;;;;;;;;;;SAUJ;
|
|
1
|
+
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/rules/popover.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAS;IAC3B,EAAE,EAAE,4BAA4B;IAChC,KAAK,EAAE,kCAAkC;IACzC,QAAQ,EAAE,OAAO;IACjB,QAAQ,EAAE;QACR,oBAAoB;QACpB,wBAAwB;QACxB,kBAAkB;QAClB,gBAAgB;QAChB,WAAW;QACX,UAAU;QACV,gBAAgB;QAChB,cAAc;QACd,eAAe;QACf,cAAc;QACd,WAAW;QACX,2BAA2B;KAC5B;IACD,UAAU,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC;IAC7C,MAAM,EAAE,6CAA6C;IACrD,KAAK,EAAE;QACL,SAAS,EACP,ugBAAugB;QACzgB,OAAO,EAAE;;;;;;;;;;;;;;;;;;SAkBJ;QACL,OAAO,EAAE,6CAA6C;QACtD,MAAM,EAAE,8DAA8D;KACvE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,oEAAoE;QAC1E,MAAM,EAAE;YACN,uUAAuU;YACvU,iIAAiI;YACjI,0DAA0D;YAC1D,iHAAiH;YACjH,uEAAuE;SACxE;QACD,OAAO,EAAE;;;;;;;;;;SAUJ;QACL,UAAU,EAAE;YACV,yGAAyG;YACzG,uEAAuE;YACvE,yGAAyG;SAC1G;KACF;IACD,MAAM,EAAE;QACN,yBAAyB;QACzB,6BAA6B;QAC7B,8CAA8C;KAC/C;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random-uuid.d.ts","sourceRoot":"","sources":["../../src/rules/random-uuid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"random-uuid.d.ts","sourceRoot":"","sources":["../../src/rules/random-uuid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU,EAAE,IAmCxB,CAAC"}
|
|
@@ -26,6 +26,10 @@ export const randomUuid = {
|
|
|
26
26
|
"You need identifiers shorter or differently shaped than a 36-character UUID, which is what nanoid and short-uuid are for.",
|
|
27
27
|
],
|
|
28
28
|
snippet: "const id = crypto.randomUUID();",
|
|
29
|
+
handRolled: [
|
|
30
|
+
"a v4 id built from Math.random() and a template string of x and y placeholders",
|
|
31
|
+
"Date.now() joined to Math.random().toString(36) to make something unique enough",
|
|
32
|
+
],
|
|
29
33
|
},
|
|
30
34
|
};
|
|
31
35
|
//# sourceMappingURL=random-uuid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random-uuid.js","sourceRoot":"","sources":["../../src/rules/random-uuid.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,kBAAkB;IACzB,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,CAAC;IAC3D,UAAU,EAAE,EAAE;IACd,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,+gBAA+gB;KACthB;IACD,MAAM,EAAE,qBAAqB;IAC7B,KAAK,EAAE;QACL,SAAS,EACP,2ZAA2Z;QAC7Z,OAAO,EAAE;0CAC6B;QACtC,MAAM,EACJ,oEAAoE;KACvE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,6BAA6B;QACnC,MAAM,EAAE;YACN,oKAAoK;YACpK,wJAAwJ;YACxJ,qJAAqJ;YACrJ,wRAAwR;YACxR,2HAA2H;SAC5H;QACD,OAAO,EAAE,iCAAiC;
|
|
1
|
+
{"version":3,"file":"random-uuid.js","sourceRoot":"","sources":["../../src/rules/random-uuid.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,kBAAkB;IACzB,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,CAAC;IAC3D,UAAU,EAAE,EAAE;IACd,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,+gBAA+gB;KACthB;IACD,MAAM,EAAE,qBAAqB;IAC7B,KAAK,EAAE;QACL,SAAS,EACP,2ZAA2Z;QAC7Z,OAAO,EAAE;0CAC6B;QACtC,MAAM,EACJ,oEAAoE;KACvE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,6BAA6B;QACnC,MAAM,EAAE;YACN,oKAAoK;YACpK,wJAAwJ;YACxJ,qJAAqJ;YACrJ,wRAAwR;YACxR,2HAA2H;SAC5H;QACD,OAAO,EAAE,iCAAiC;QAC1C,UAAU,EAAE;YACV,gFAAgF;YAChF,iFAAiF;SAClF;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relative-time.d.ts","sourceRoot":"","sources":["../../src/rules/relative-time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"relative-time.d.ts","sourceRoot":"","sources":["../../src/rules/relative-time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,IA6B1B,CAAC"}
|
|
@@ -19,6 +19,10 @@ rtf.format(-5, "minute"); // "5 minutes ago"`,
|
|
|
19
19
|
"You need a locale Intl's relative-time data doesn't cover well on your target browsers, or offline locale data bundled ahead of time.",
|
|
20
20
|
],
|
|
21
21
|
snippet: 'new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-5, "minute");',
|
|
22
|
+
handRolled: [
|
|
23
|
+
"a chain of millisecond thresholds turning a date difference into minutes, hours or days ago",
|
|
24
|
+
"a table of singular and plural unit names written out to build phrases like 3 days ago",
|
|
25
|
+
],
|
|
22
26
|
},
|
|
23
27
|
};
|
|
24
28
|
//# sourceMappingURL=relative-time.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relative-time.js","sourceRoot":"","sources":["../../src/rules/relative-time.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,qBAAqB,EAAE,YAAY,EAAE,eAAe,CAAC;IAChE,UAAU,EAAE,CAAC,2BAA2B,CAAC;IACzC,MAAM,EAAE,yBAAyB;IACjC,KAAK,EAAE;QACL,SAAS,EACP,gTAAgT;QAClT,OAAO,EAAE;6CACgC;QACzC,MAAM,EACJ,0GAA0G;KAC7G;IACD,KAAK,EAAE;QACL,IAAI,EAAE,iFAAiF;QACvF,MAAM,EAAE;YACN,iQAAiQ;YACjQ,iNAAiN;YACjN,uIAAuI;SACxI;QACD,OAAO,EACL,8EAA8E;
|
|
1
|
+
{"version":3,"file":"relative-time.js","sourceRoot":"","sources":["../../src/rules/relative-time.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,qBAAqB,EAAE,YAAY,EAAE,eAAe,CAAC;IAChE,UAAU,EAAE,CAAC,2BAA2B,CAAC;IACzC,MAAM,EAAE,yBAAyB;IACjC,KAAK,EAAE;QACL,SAAS,EACP,gTAAgT;QAClT,OAAO,EAAE;6CACgC;QACzC,MAAM,EACJ,0GAA0G;KAC7G;IACD,KAAK,EAAE;QACL,IAAI,EAAE,iFAAiF;QACvF,MAAM,EAAE;YACN,iQAAiQ;YACjQ,iNAAiN;YACjN,uIAAuI;SACxI;QACD,OAAO,EACL,8EAA8E;QAChF,UAAU,EAAE;YACV,6FAA6F;YAC7F,wFAAwF;SACzF;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable-panels.d.ts","sourceRoot":"","sources":["../../src/rules/resizable-panels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"resizable-panels.d.ts","sourceRoot":"","sources":["../../src/rules/resizable-panels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,EAAE,IAkC7B,CAAC"}
|
|
@@ -26,6 +26,9 @@ export const resizablePanels = {
|
|
|
26
26
|
"You need a minimum of two resizable regions sharing the freed-up or reclaimed space, the way a split-pane library redistributes width between panels.",
|
|
27
27
|
],
|
|
28
28
|
snippet: ".sidebar { resize: horizontal; overflow: auto; min-width: 12rem; max-width: 32rem; }",
|
|
29
|
+
handRolled: [
|
|
30
|
+
"a mousedown on one panel's edge with mousemove handlers writing a width onto that same panel",
|
|
31
|
+
],
|
|
29
32
|
},
|
|
30
33
|
};
|
|
31
34
|
//# sourceMappingURL=resizable-panels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable-panels.js","sourceRoot":"","sources":["../../src/rules/resizable-panels.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,kBAAkB;IACzB,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,CAAC,cAAc,CAAC;IAC1B,UAAU,EAAE,CAAC,QAAQ,CAAC;IACtB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE;QACL,SAAS,EACP,ubAAub;QACzb,OAAO,EAAE;;;;;EAKX;QACE,MAAM,EAAE,yDAAyD;KAClE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,6EAA6E;QACnF,MAAM,EAAE;YACN,6IAA6I;YAC7I,wUAAwU;YACxU,+JAA+J;YAC/J,6JAA6J;YAC7J,mJAAmJ;YACnJ,uJAAuJ;SACxJ;QACD,OAAO,EACL,sFAAsF;
|
|
1
|
+
{"version":3,"file":"resizable-panels.js","sourceRoot":"","sources":["../../src/rules/resizable-panels.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,kBAAkB;IACzB,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,CAAC,cAAc,CAAC;IAC1B,UAAU,EAAE,CAAC,QAAQ,CAAC;IACtB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE;QACL,SAAS,EACP,ubAAub;QACzb,OAAO,EAAE;;;;;EAKX;QACE,MAAM,EAAE,yDAAyD;KAClE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,6EAA6E;QACnF,MAAM,EAAE;YACN,6IAA6I;YAC7I,wUAAwU;YACxU,+JAA+J;YAC/J,6JAA6J;YAC7J,mJAAmJ;YACnJ,uJAAuJ;SACxJ;QACD,OAAO,EACL,sFAAsF;QACxF,UAAU,EAAE;YACV,8FAA8F;SAC/F;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resize-observer.d.ts","sourceRoot":"","sources":["../../src/rules/resize-observer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"resize-observer.d.ts","sourceRoot":"","sources":["../../src/rules/resize-observer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,cAAc,EAAE,IA+B5B,CAAC"}
|
|
@@ -23,6 +23,10 @@ observer.observe(document.querySelector("#panel"));`,
|
|
|
23
23
|
"You need devicePixelContentBoxSize specifically. Chrome has it from {{chrome:api.ResizeObserverEntry.devicePixelContentBoxSize}} and Firefox from {{firefox:api.ResizeObserverEntry.devicePixelContentBoxSize}}, but Safari does not implement it at all.",
|
|
24
24
|
],
|
|
25
25
|
snippet: "new ResizeObserver((entries) => { ... }).observe(el);",
|
|
26
|
+
handRolled: [
|
|
27
|
+
"polling an element's dimensions on an interval to notice when they change",
|
|
28
|
+
],
|
|
26
29
|
},
|
|
30
|
+
lintRule: "unicorn/prefer-observer-apis",
|
|
27
31
|
};
|
|
28
32
|
//# sourceMappingURL=resize-observer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resize-observer.js","sourceRoot":"","sources":["../../src/rules/resize-observer.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,yBAAyB;IAChC,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,0BAA0B,EAAE,yBAAyB,CAAC;IACjE,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE;QACL,SAAS,EACP,+RAA+R;QACjS,OAAO,EAAE;;;;;oDAKuC;QAChD,MAAM,EAAE,iEAAiE;KAC1E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4EAA4E;QAClF,MAAM,EAAE;YACN,sIAAsI;YACtI,iHAAiH;YACjH,2PAA2P;SAC5P;QACD,OAAO,EAAE,uDAAuD;
|
|
1
|
+
{"version":3,"file":"resize-observer.js","sourceRoot":"","sources":["../../src/rules/resize-observer.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,yBAAyB;IAChC,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,0BAA0B,EAAE,yBAAyB,CAAC;IACjE,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE;QACL,SAAS,EACP,+RAA+R;QACjS,OAAO,EAAE;;;;;oDAKuC;QAChD,MAAM,EAAE,iEAAiE;KAC1E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4EAA4E;QAClF,MAAM,EAAE;YACN,sIAAsI;YACtI,iHAAiH;YACjH,2PAA2P;SAC5P;QACD,OAAO,EAAE,uDAAuD;QAChE,UAAU,EAAE;YACV,2EAA2E;SAC5E;KACF;IACD,QAAQ,EAAE,8BAA8B;CACzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-animations.d.ts","sourceRoot":"","sources":["../../src/rules/scroll-animations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"scroll-animations.d.ts","sourceRoot":"","sources":["../../src/rules/scroll-animations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,gBAAgB,EAAE,IAuE9B,CAAC"}
|
|
@@ -55,6 +55,10 @@ export const scrollAnimations = {
|
|
|
55
55
|
animation-range: entry 0% cover 40%;
|
|
56
56
|
}
|
|
57
57
|
}`,
|
|
58
|
+
handRolled: [
|
|
59
|
+
"a scroll listener setting a progress bar's width from scrollY over scrollHeight",
|
|
60
|
+
"mapping scroll position to a transform or an opacity on every scroll event",
|
|
61
|
+
],
|
|
58
62
|
},
|
|
59
63
|
guides: [
|
|
60
64
|
"parallax-scroll-effects",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-animations.js","sourceRoot":"","sources":["../../src/rules/scroll-animations.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,EAAE,EAAE,0BAA0B;IAC9B,KAAK,EAAE,6BAA6B;IACpC,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC;IAC7E,UAAU,EAAE,CAAC,0BAA0B,CAAC;IACxC,MAAM,EAAE,yCAAyC;IACjD,KAAK,EAAE;QACL,SAAS,EACP,ugBAAugB;QACzgB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BX;QACE,MAAM,EACJ,qEAAqE;KACxE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,0FAA0F;QAChG,MAAM,EAAE;YACN,2PAA2P;YAC3P,sLAAsL;YACtL,2IAA2I;YAC3I,sHAAsH;YACtH,4IAA4I;SAC7I;QACD,OAAO,EAAE;;;;;;;EAOX;
|
|
1
|
+
{"version":3,"file":"scroll-animations.js","sourceRoot":"","sources":["../../src/rules/scroll-animations.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,EAAE,EAAE,0BAA0B;IAC9B,KAAK,EAAE,6BAA6B;IACpC,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC;IAC7E,UAAU,EAAE,CAAC,0BAA0B,CAAC;IACxC,MAAM,EAAE,yCAAyC;IACjD,KAAK,EAAE;QACL,SAAS,EACP,ugBAAugB;QACzgB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BX;QACE,MAAM,EACJ,qEAAqE;KACxE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,0FAA0F;QAChG,MAAM,EAAE;YACN,2PAA2P;YAC3P,sLAAsL;YACtL,2IAA2I;YAC3I,sHAAsH;YACtH,4IAA4I;SAC7I;QACD,OAAO,EAAE;;;;;;;EAOX;QACE,UAAU,EAAE;YACV,iFAAiF;YACjF,4EAA4E;SAC7E;KACF;IACD,MAAM,EAAE;QACN,yBAAyB;QACzB,gBAAgB;QAChB,2BAA2B;QAC3B,2BAA2B;QAC3B,4BAA4B;KAC7B;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-lock.d.ts","sourceRoot":"","sources":["../../src/rules/scroll-lock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"scroll-lock.d.ts","sourceRoot":"","sources":["../../src/rules/scroll-lock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU,EAAE,IA6CxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-lock.js","sourceRoot":"","sources":["../../src/rules/scroll-lock.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,qBAAqB;IACzB,KAAK,EAAE,sCAAsC;IAC7C,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,CAAC,kBAAkB,CAAC;IAC9B,UAAU,EAAE,EAAE;IACd,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,mlBAAmlB;KAC1lB;IACD,MAAM,EAAE,8BAA8B;IACtC,KAAK,EAAE;QACL,SAAS,EACP,mfAAmf;QACrf,OAAO,EAAE;;;;;;;;;;EAUX;QACE,MAAM,EACJ,sEAAsE;KACzE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4FAA4F;QAClG,MAAM,EAAE;YACN,0KAA0K;YAC1K,2MAA2M;YAC3M,0IAA0I;YAC1I,kFAAkF;SACnF;QACD,OAAO,EAAE;;;EAGX;
|
|
1
|
+
{"version":3,"file":"scroll-lock.js","sourceRoot":"","sources":["../../src/rules/scroll-lock.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,qBAAqB;IACzB,KAAK,EAAE,sCAAsC;IAC7C,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,CAAC,kBAAkB,CAAC;IAC9B,UAAU,EAAE,EAAE;IACd,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,mlBAAmlB;KAC1lB;IACD,MAAM,EAAE,8BAA8B;IACtC,KAAK,EAAE;QACL,SAAS,EACP,mfAAmf;QACrf,OAAO,EAAE;;;;;;;;;;EAUX;QACE,MAAM,EACJ,sEAAsE;KACzE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4FAA4F;QAClG,MAAM,EAAE;YACN,0KAA0K;YAC1K,2MAA2M;YAC3M,0IAA0I;YAC1I,kFAAkF;SACnF;QACD,OAAO,EAAE;;;EAGX;QACE,UAAU,EAAE;YACV,iGAAiG;SAClG;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollbars.d.ts","sourceRoot":"","sources":["../../src/rules/scrollbars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"scrollbars.d.ts","sourceRoot":"","sources":["../../src/rules/scrollbars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU,EAAE,IAuDxB,CAAC"}
|
package/dist/rules/scrollbars.js
CHANGED
|
@@ -44,6 +44,9 @@ html {
|
|
|
44
44
|
scrollbar-width: thin;
|
|
45
45
|
scrollbar-color: #666 transparent;
|
|
46
46
|
}`,
|
|
47
|
+
handRolled: [
|
|
48
|
+
"measuring the scrollbar width from innerWidth minus documentElement.clientWidth and padding the body by it",
|
|
49
|
+
],
|
|
47
50
|
},
|
|
48
51
|
guides: [
|
|
49
52
|
"customize-scrollbar-color-and-thickness",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollbars.js","sourceRoot":"","sources":["../../src/rules/scrollbars.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE;QACR,yBAAyB;QACzB,2BAA2B;QAC3B,WAAW;QACX,iBAAiB;QACjB,mBAAmB;QACnB,yBAAyB;QACzB,mBAAmB;QACnB,uBAAuB;QACvB,uBAAuB;QACvB,uBAAuB;KACxB;IACD,UAAU,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,CAAC;IACtE,MAAM,EAAE,uDAAuD;IAC/D,KAAK,EAAE;QACL,SAAS,EACP,wdAAwd;QAC1d,OAAO,EAAE;;;;;;;;;;EAUX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,gGAAgG;QACtG,MAAM,EAAE;YACN,iMAAiM;YACjM,yGAAyG;YACzG,6HAA6H;YAC7H,iHAAiH;SAClH;QACD,OAAO,EAAE;;;;EAIX;
|
|
1
|
+
{"version":3,"file":"scrollbars.js","sourceRoot":"","sources":["../../src/rules/scrollbars.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE;QACR,yBAAyB;QACzB,2BAA2B;QAC3B,WAAW;QACX,iBAAiB;QACjB,mBAAmB;QACnB,yBAAyB;QACzB,mBAAmB;QACnB,uBAAuB;QACvB,uBAAuB;QACvB,uBAAuB;KACxB;IACD,UAAU,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,CAAC;IACtE,MAAM,EAAE,uDAAuD;IAC/D,KAAK,EAAE;QACL,SAAS,EACP,wdAAwd;QAC1d,OAAO,EAAE;;;;;;;;;;EAUX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,gGAAgG;QACtG,MAAM,EAAE;YACN,iMAAiM;YACjM,yGAAyG;YACzG,6HAA6H;YAC7H,iHAAiH;SAClH;QACD,OAAO,EAAE;;;;EAIX;QACE,UAAU,EAAE;YACV,4GAA4G;SAC7G;KACF;IACD,MAAM,EAAE;QACN,yCAAyC;QACzC,yCAAyC;KAC1C;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmenter.d.ts","sourceRoot":"","sources":["../../src/rules/segmenter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,SAAS,EAAE,IAyCvB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const segmenter = {
|
|
2
|
+
id: "intl-segmenter",
|
|
3
|
+
title: "Splitting text by character or word",
|
|
4
|
+
category: "formatting",
|
|
5
|
+
replaces: [
|
|
6
|
+
"graphemer",
|
|
7
|
+
"grapheme-splitter",
|
|
8
|
+
"string-length",
|
|
9
|
+
"lodash.words",
|
|
10
|
+
"split-graphemes",
|
|
11
|
+
],
|
|
12
|
+
featureIds: ["intl-segmenter"],
|
|
13
|
+
native: "Intl.Segmenter",
|
|
14
|
+
human: {
|
|
15
|
+
explainer: 'A string\'s length counts UTF-16 code units, so a thumbs-up with a skin tone reads as four and slicing at an arbitrary index can cut a character in half. These libraries fix that by shipping their own copy of the Unicode grapheme cluster rules, which is most of their weight. Intl.Segmenter reads the copy the browser already holds and segments by grapheme, word or sentence, so "how many characters" and "what are the words" both get a locale-aware answer.',
|
|
16
|
+
snippet: `const graphemes = new Intl.Segmenter("en", { granularity: "grapheme" });
|
|
17
|
+
|
|
18
|
+
"👍🏽ok".length; // 6
|
|
19
|
+
[...graphemes.segment("👍🏽ok")].length; // 3
|
|
20
|
+
|
|
21
|
+
const words = new Intl.Segmenter("en", { granularity: "word" });
|
|
22
|
+
[...words.segment("Hello, world")]
|
|
23
|
+
.filter((part) => part.isWordLike)
|
|
24
|
+
.map((part) => part.segment);
|
|
25
|
+
// ["Hello", "world"]`,
|
|
26
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter",
|
|
27
|
+
},
|
|
28
|
+
agent: {
|
|
29
|
+
when: "counting, splitting or truncating text by user-perceived character, word or sentence",
|
|
30
|
+
unless: [
|
|
31
|
+
"You use lodash.words to split identifiers, as in fooBarBaz or snake_case. That is a camel case convention rather than a Unicode word boundary, and Intl.Segmenter will not split it.",
|
|
32
|
+
"You only need code points rather than grapheme clusters. Array.from(str) and the spread form already split by code point, with no Segmenter and no library.",
|
|
33
|
+
"You need segmentation that cannot move. Each engine ships its own Unicode version, so a recent emoji can segment differently between browsers and can change when one updates.",
|
|
34
|
+
"The same code runs on a Node build compiled with small-icu, where the locale data Segmenter depends on is largely absent.",
|
|
35
|
+
"You measure the width of terminal output. string-length also strips ANSI escape codes before counting, and Intl.Segmenter counts them as segments, so a colourised CLI silently gets its column widths wrong.",
|
|
36
|
+
],
|
|
37
|
+
snippet: `const seg = new Intl.Segmenter("en", { granularity: "grapheme" });
|
|
38
|
+
const count = [...seg.segment(text)].length;`,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=segmenter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmenter.js","sourceRoot":"","sources":["../../src/rules/segmenter.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAS;IAC7B,EAAE,EAAE,gBAAgB;IACpB,KAAK,EAAE,qCAAqC;IAC5C,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE;QACR,WAAW;QACX,mBAAmB;QACnB,eAAe;QACf,cAAc;QACd,iBAAiB;KAClB;IACD,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE;QACL,SAAS,EACP,2cAA2c;QAC7c,OAAO,EAAE;;;;;;;;;sBASS;QAClB,MAAM,EACJ,iGAAiG;KACpG;IACD,KAAK,EAAE;QACL,IAAI,EAAE,sFAAsF;QAC5F,MAAM,EAAE;YACN,sLAAsL;YACtL,6JAA6J;YAC7J,gLAAgL;YAChL,2HAA2H;YAC3H,+MAA+M;SAChN;QACD,OAAO,EAAE;6CACgC;KAC1C;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/rules/select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/rules/select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,MAAM,EAAE,IAyEpB,CAAC"}
|
package/dist/rules/select.js
CHANGED
|
@@ -60,6 +60,9 @@ export const select = {
|
|
|
60
60
|
<style>
|
|
61
61
|
select, select::picker(select) { appearance: base-select; }
|
|
62
62
|
</style>`,
|
|
63
|
+
handRolled: [
|
|
64
|
+
"a div with role=listbox and children with role=option, wired to arrow keys and Enter by hand",
|
|
65
|
+
],
|
|
63
66
|
},
|
|
64
67
|
guides: [
|
|
65
68
|
"animated-select-picker",
|
package/dist/rules/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/rules/select.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAS;IAC1B,EAAE,EAAE,qBAAqB;IACzB,KAAK,EAAE,qBAAqB;IAC5B,QAAQ,EAAE,OAAO;IACjB,QAAQ,EAAE;QACR,cAAc;QACd,YAAY;QACZ,SAAS;QACT,YAAY;QACZ,YAAY;QACZ,iBAAiB;QACjB,sBAAsB;QACtB,eAAe;KAChB;IACD,UAAU,EAAE,CAAC,qBAAqB,CAAC;IACnC,MAAM,EAAE,qCAAqC;IAC7C,KAAK,EAAE;QACL,SAAS,EACP,+YAA+Y;QACjZ,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;SA0BJ;QACL,MAAM,EAAE,6DAA6D;KACtE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4EAA4E;QAClF,MAAM,EAAE;YACN,0LAA0L;YAC1L,qFAAqF;YACrF,gLAAgL;YAChL,qEAAqE;SACtE;QACD,OAAO,EAAE;;;;;;SAMJ;
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/rules/select.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAS;IAC1B,EAAE,EAAE,qBAAqB;IACzB,KAAK,EAAE,qBAAqB;IAC5B,QAAQ,EAAE,OAAO;IACjB,QAAQ,EAAE;QACR,cAAc;QACd,YAAY;QACZ,SAAS;QACT,YAAY;QACZ,YAAY;QACZ,iBAAiB;QACjB,sBAAsB;QACtB,eAAe;KAChB;IACD,UAAU,EAAE,CAAC,qBAAqB,CAAC;IACnC,MAAM,EAAE,qCAAqC;IAC7C,KAAK,EAAE;QACL,SAAS,EACP,+YAA+Y;QACjZ,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;SA0BJ;QACL,MAAM,EAAE,6DAA6D;KACtE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4EAA4E;QAClF,MAAM,EAAE;YACN,0LAA0L;YAC1L,qFAAqF;YACrF,gLAAgL;YAChL,qEAAqE;SACtE;QACD,OAAO,EAAE;;;;;;SAMJ;QACL,UAAU,EAAE;YACV,8FAA8F;SAC/F;KACF;IACD,MAAM,EAAE;QACN,wBAAwB;QACxB,wBAAwB;QACxB,8BAA8B;QAC9B,yBAAyB;KAC1B;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signal-timeout.d.ts","sourceRoot":"","sources":["../../src/rules/signal-timeout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,aAAa,EAAE,IA+B3B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const signalTimeout = {
|
|
2
|
+
id: "abortsignal-timeout",
|
|
3
|
+
title: "Timing out async work",
|
|
4
|
+
category: "async-data",
|
|
5
|
+
replaces: ["p-timeout", "promise-timeout"],
|
|
6
|
+
featureIds: ["abortsignal-timeout"],
|
|
7
|
+
native: "AbortSignal.timeout()",
|
|
8
|
+
human: {
|
|
9
|
+
explainer: "These packages race your promise against a timer and reject when the timer wins. The work carries on in the background, because a promise has no cancel, so a timed-out request still holds its connection and still lands its response. AbortSignal.timeout() returns a signal that aborts itself after the given time, and anything that takes a signal stops for real. AbortSignal.any() combines it with a controller when a timeout and a manual cancel both have to work.",
|
|
10
|
+
snippet: `const response = await fetch(url, { signal: AbortSignal.timeout(5000) });
|
|
11
|
+
|
|
12
|
+
// A timeout the user can also cancel.
|
|
13
|
+
const controller = new AbortController();
|
|
14
|
+
const response2 = await fetch(url, {
|
|
15
|
+
signal: AbortSignal.any([controller.signal, AbortSignal.timeout(5000)]),
|
|
16
|
+
});`,
|
|
17
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static",
|
|
18
|
+
},
|
|
19
|
+
agent: {
|
|
20
|
+
when: "giving a cancellable operation such as fetch a deadline",
|
|
21
|
+
unless: [
|
|
22
|
+
"What you are timing out takes no AbortSignal. A plain promise from a library with no signal option cannot be aborted, so racing it is still the only option and that race is what p-timeout is.",
|
|
23
|
+
"You need a specific error, or a fallback value instead of a rejection. AbortSignal.timeout() rejects with a TimeoutError DOMException and offers no hook, where p-timeout takes your own error or resolves with a default.",
|
|
24
|
+
"The combined signal has to say why it aborted. AbortSignal.any() adopts the reason of whichever signal fired, so telling a timeout from a user cancel means reading signal.reason rather than catching a distinct type.",
|
|
25
|
+
"You support browsers below Chrome {{chrome:abortsignal-timeout}}, Firefox {{firefox:abortsignal-timeout}} or Safari {{safari:abortsignal-timeout}}. AbortSignal.any() landed separately, so check it too if the snippet uses both.",
|
|
26
|
+
],
|
|
27
|
+
snippet: "await fetch(url, { signal: AbortSignal.timeout(5000) });",
|
|
28
|
+
},
|
|
29
|
+
lintRule: "unicorn/prefer-abort-signal-timeout",
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=signal-timeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signal-timeout.js","sourceRoot":"","sources":["../../src/rules/signal-timeout.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAS;IACjC,EAAE,EAAE,qBAAqB;IACzB,KAAK,EAAE,uBAAuB;IAC9B,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAC1C,UAAU,EAAE,CAAC,qBAAqB,CAAC;IACnC,MAAM,EAAE,uBAAuB;IAC/B,KAAK,EAAE;QACL,SAAS,EACP,idAAid;QACnd,OAAO,EAAE;;;;;;IAMT;QACA,MAAM,EACJ,6EAA6E;KAChF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,yDAAyD;QAC/D,MAAM,EAAE;YACN,iMAAiM;YACjM,4NAA4N;YAC5N,yNAAyN;YACzN,oOAAoO;SACrO;QACD,OAAO,EAAE,0DAA0D;KACpE;IACD,QAAQ,EAAE,qCAAqC;CAChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smooth-scroll.d.ts","sourceRoot":"","sources":["../../src/rules/smooth-scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"smooth-scroll.d.ts","sourceRoot":"","sources":["../../src/rules/smooth-scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,IAgD1B,CAAC"}
|
|
@@ -39,6 +39,10 @@ export const smoothScroll = {
|
|
|
39
39
|
:root { scroll-behavior: smooth; }
|
|
40
40
|
}
|
|
41
41
|
[id] { scroll-margin-top: 5rem; }`,
|
|
42
|
+
handRolled: [
|
|
43
|
+
"a requestAnimationFrame loop easing scrollTop from where it is toward a target",
|
|
44
|
+
"an easing function like easeInOutQuad written next to a scroll routine",
|
|
45
|
+
],
|
|
42
46
|
},
|
|
43
47
|
guides: ["scroll-target-on-load"],
|
|
44
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smooth-scroll.js","sourceRoot":"","sources":["../../src/rules/smooth-scroll.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,uCAAuC;IAC9C,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE;QACR,cAAc;QACd,uBAAuB;QACvB,0BAA0B;QAC1B,eAAe;QACf,SAAS;QACT,cAAc;KACf;IACD,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,MAAM,EAAE,gDAAgD;IACxD,KAAK,EAAE;QACL,SAAS,EACP,mYAAmY;QACrY,OAAO,EAAE;;;;;;;;;;EAUX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,6DAA6D;QACnE,MAAM,EAAE;YACN,mHAAmH;YACnH,6GAA6G;YAC7G,gFAAgF;YAChF,8KAA8K;SAC/K;QACD,OAAO,EAAE;;;kCAGqB;
|
|
1
|
+
{"version":3,"file":"smooth-scroll.js","sourceRoot":"","sources":["../../src/rules/smooth-scroll.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,uCAAuC;IAC9C,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE;QACR,cAAc;QACd,uBAAuB;QACvB,0BAA0B;QAC1B,eAAe;QACf,SAAS;QACT,cAAc;KACf;IACD,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,MAAM,EAAE,gDAAgD;IACxD,KAAK,EAAE;QACL,SAAS,EACP,mYAAmY;QACrY,OAAO,EAAE;;;;;;;;;;EAUX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,6DAA6D;QACnE,MAAM,EAAE;YACN,mHAAmH;YACnH,6GAA6G;YAC7G,gFAAgF;YAChF,8KAA8K;SAC/K;QACD,OAAO,EAAE;;;kCAGqB;QAC9B,UAAU,EAAE;YACV,gFAAgF;YAChF,wEAAwE;SACzE;KACF;IACD,MAAM,EAAE,CAAC,uBAAuB,CAAC;CAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["../../src/rules/sticky.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["../../src/rules/sticky.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,MAAM,EAAE,IA+CpB,CAAC"}
|
package/dist/rules/sticky.js
CHANGED
|
@@ -38,6 +38,10 @@ export const sticky = {
|
|
|
38
38
|
],
|
|
39
39
|
snippet: `.header { position: sticky; top: 0; z-index: 10; }
|
|
40
40
|
.sidebar { position: sticky; top: 5rem; align-self: start; }`,
|
|
41
|
+
handRolled: [
|
|
42
|
+
"a scroll listener toggling a fixed class once an element passes an offset",
|
|
43
|
+
"storing an element's original offsetTop so a placeholder can hold the gap when it goes fixed",
|
|
44
|
+
],
|
|
41
45
|
},
|
|
42
46
|
guides: ["state-aware-sticky-headers", "scroll-position-aware-elements"],
|
|
43
47
|
};
|
package/dist/rules/sticky.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky.js","sourceRoot":"","sources":["../../src/rules/sticky.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAS;IAC1B,EAAE,EAAE,oBAAoB;IACxB,KAAK,EAAE,6BAA6B;IACpC,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE;QACR,WAAW;QACX,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,sBAAsB;QACtB,YAAY;KACb;IACD,UAAU,EAAE,CAAC,oBAAoB,CAAC;IAClC,MAAM,EAAE,kBAAkB;IAC1B,KAAK,EAAE;QACL,SAAS,EACP,iaAAia;QACna,OAAO,EAAE;;;;;;;;;;;EAWX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,0EAA0E;QAChF,MAAM,EAAE;YACN,iLAAiL;YACjL,kLAAkL;YAClL,qFAAqF;SACtF;QACD,OAAO,EAAE;6DACgD;
|
|
1
|
+
{"version":3,"file":"sticky.js","sourceRoot":"","sources":["../../src/rules/sticky.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAS;IAC1B,EAAE,EAAE,oBAAoB;IACxB,KAAK,EAAE,6BAA6B;IACpC,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE;QACR,WAAW;QACX,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,sBAAsB;QACtB,YAAY;KACb;IACD,UAAU,EAAE,CAAC,oBAAoB,CAAC;IAClC,MAAM,EAAE,kBAAkB;IAC1B,KAAK,EAAE;QACL,SAAS,EACP,iaAAia;QACna,OAAO,EAAE;;;;;;;;;;;EAWX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,0EAA0E;QAChF,MAAM,EAAE;YACN,iLAAiL;YACjL,kLAAkL;YAClL,qFAAqF;SACtF;QACD,OAAO,EAAE;6DACgD;QACzD,UAAU,EAAE;YACV,2EAA2E;YAC3E,8FAA8F;SAC/F;KACF;IACD,MAAM,EAAE,CAAC,4BAA4B,EAAE,gCAAgC,CAAC;CACzE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-clone.d.ts","sourceRoot":"","sources":["../../src/rules/structured-clone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"structured-clone.d.ts","sourceRoot":"","sources":["../../src/rules/structured-clone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,mBAAmB,EAAE,IAgCjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-clone.js","sourceRoot":"","sources":["../../src/rules/structured-clone.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAS;IACvC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,cAAc;IACrB,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE;QACR,kBAAkB;QAClB,MAAM;QACN,OAAO;QACP,OAAO;QACP,YAAY;QACZ,WAAW;QACX,YAAY;KACb;IACD,UAAU,EAAE,CAAC,kBAAkB,CAAC;IAChC,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE;QACL,SAAS,EACP,4SAA4S;QAC9S,OAAO,EAAE,yCAAyC;QAClD,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,wEAAwE;QAC9E,MAAM,EAAE;YACN,+JAA+J;YAC/J,uOAAuO;YACvO,+IAA+I;YAC/I,+NAA+N;SAChO;QACD,OAAO,EAAE,yCAAyC;KACnD;
|
|
1
|
+
{"version":3,"file":"structured-clone.js","sourceRoot":"","sources":["../../src/rules/structured-clone.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAS;IACvC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,cAAc;IACrB,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE;QACR,kBAAkB;QAClB,MAAM;QACN,OAAO;QACP,OAAO;QACP,YAAY;QACZ,WAAW;QACX,YAAY;KACb;IACD,UAAU,EAAE,CAAC,kBAAkB,CAAC;IAChC,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE;QACL,SAAS,EACP,4SAA4S;QAC9S,OAAO,EAAE,yCAAyC;QAClD,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,wEAAwE;QAC9E,MAAM,EAAE;YACN,+JAA+J;YAC/J,uOAAuO;YACvO,+IAA+I;YAC/I,+NAA+N;SAChO;QACD,OAAO,EAAE,yCAAyC;KACnD;IACD,QAAQ,EAAE,iCAAiC;CAC5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-wrap-balance.d.ts","sourceRoot":"","sources":["../../src/rules/text-wrap-balance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"text-wrap-balance.d.ts","sourceRoot":"","sources":["../../src/rules/text-wrap-balance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,EAAE,IAuC7B,CAAC"}
|
|
@@ -31,6 +31,9 @@ p {
|
|
|
31
31
|
],
|
|
32
32
|
snippet: `h1, h2, h3 { text-wrap: balance; }
|
|
33
33
|
p { text-wrap: pretty; }`,
|
|
34
|
+
handRolled: [
|
|
35
|
+
"inserting a br or a non-breaking space between the last two words of a heading so it does not orphan one",
|
|
36
|
+
],
|
|
34
37
|
},
|
|
35
38
|
guides: ["improve-text-layout-and-legibility"],
|
|
36
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-wrap-balance.js","sourceRoot":"","sources":["../../src/rules/text-wrap-balance.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,qBAAqB,EAAE,cAAc,CAAC;IACjD,UAAU,EAAE,CAAC,mBAAmB,CAAC;IACjC,MAAM,EAAE,oBAAoB;IAC5B,KAAK,EAAE;QACL,SAAS,EACP,qbAAqb;QACvb,OAAO,EAAE;;;;;;;;;;;EAWX;QACE,MAAM,EAAE,4DAA4D;KACrE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,gFAAgF;QACtF,MAAM,EAAE;YACN,4JAA4J;YAC5J,mKAAmK;YACnK,gIAAgI;YAChI,gJAAgJ;SACjJ;QACD,OAAO,EAAE;yBACY;
|
|
1
|
+
{"version":3,"file":"text-wrap-balance.js","sourceRoot":"","sources":["../../src/rules/text-wrap-balance.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,qBAAqB,EAAE,cAAc,CAAC;IACjD,UAAU,EAAE,CAAC,mBAAmB,CAAC;IACjC,MAAM,EAAE,oBAAoB;IAC5B,KAAK,EAAE;QACL,SAAS,EACP,qbAAqb;QACvb,OAAO,EAAE;;;;;;;;;;;EAWX;QACE,MAAM,EAAE,4DAA4D;KACrE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,gFAAgF;QACtF,MAAM,EAAE;YACN,4JAA4J;YAC5J,mKAAmK;YACnK,gIAAgI;YAChI,gJAAgJ;SACjJ;QACD,OAAO,EAAE;yBACY;QACrB,UAAU,EAAE;YACV,0GAA0G;SAC3G;KACF;IACD,MAAM,EAAE,CAAC,oCAAoC,CAAC;CAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-pattern.d.ts","sourceRoot":"","sources":["../../src/rules/url-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU,EAAE,IAmCxB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const urlPattern = {
|
|
2
|
+
id: "urlpattern",
|
|
3
|
+
title: "Matching URL patterns",
|
|
4
|
+
category: "async-data",
|
|
5
|
+
replaces: ["path-to-regexp", "url-pattern", "route-parser"],
|
|
6
|
+
featureIds: ["urlpattern"],
|
|
7
|
+
native: "URLPattern",
|
|
8
|
+
human: {
|
|
9
|
+
explainer: 'These libraries compile a route string such as "/users/:id" into a regular expression and hand back the named groups when it matches. URLPattern is that same idea built in, with one extra: it matches every part of a URL, so protocol, hostname and search can take part in the pattern rather than only the path. A match returns an object keyed by URL part, each with its own groups.',
|
|
10
|
+
snippet: `const pattern = new URLPattern({ pathname: "/users/:id/posts/:postId" });
|
|
11
|
+
|
|
12
|
+
pattern.test("https://example.com/users/42/posts/7"); // true
|
|
13
|
+
|
|
14
|
+
const match = pattern.exec("https://example.com/users/42/posts/7");
|
|
15
|
+
match.pathname.groups; // { id: "42", postId: "7" }
|
|
16
|
+
|
|
17
|
+
// Other parts of the URL can take part too.
|
|
18
|
+
new URLPattern({ hostname: ":tenant.example.com" })
|
|
19
|
+
.exec("https://acme.example.com/")
|
|
20
|
+
.hostname.groups; // { tenant: "acme" }`,
|
|
21
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/URLPattern",
|
|
22
|
+
},
|
|
23
|
+
agent: {
|
|
24
|
+
when: "matching a URL against a route pattern and reading the named parameters",
|
|
25
|
+
unless: [
|
|
26
|
+
'You build URLs from the pattern as well as matching them. path-to-regexp\'s compile() turns "/users/:id" plus params back into a path, and URLPattern only goes in the matching direction.',
|
|
27
|
+
"You are replacing the matcher inside a router you do not control. Express and React Router depend on path-to-regexp directly, so it stays in the tree regardless of what your own code uses.",
|
|
28
|
+
"Your routes rely on path-to-regexp syntax that does not carry over, such as its custom match patterns or its handling of unnamed groups. The two syntaxes are close enough to look interchangeable and different enough to break quietly.",
|
|
29
|
+
"The code runs on a server runtime that has no URLPattern global, which is the case for Node before it shipped one.",
|
|
30
|
+
],
|
|
31
|
+
snippet: `const pattern = new URLPattern({ pathname: "/users/:id" });
|
|
32
|
+
const match = pattern.exec(url);
|
|
33
|
+
const id = match?.pathname.groups.id;`,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=url-pattern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-pattern.js","sourceRoot":"","sources":["../../src/rules/url-pattern.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,YAAY;IAChB,KAAK,EAAE,uBAAuB;IAC9B,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,gBAAgB,EAAE,aAAa,EAAE,cAAc,CAAC;IAC3D,UAAU,EAAE,CAAC,YAAY,CAAC;IAC1B,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE;QACL,SAAS,EACP,8XAA8X;QAChY,OAAO,EAAE;;;;;;;;;;0CAU6B;QACtC,MAAM,EAAE,6DAA6D;KACtE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,yEAAyE;QAC/E,MAAM,EAAE;YACN,4LAA4L;YAC5L,8LAA8L;YAC9L,2OAA2O;YAC3O,oHAAoH;SACrH;QACD,OAAO,EAAE;;sCAEyB;KACnC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-search-params.d.ts","sourceRoot":"","sources":["../../src/rules/url-search-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"url-search-params.d.ts","sourceRoot":"","sources":["../../src/rules/url-search-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,EAAE,IA0C7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-search-params.js","sourceRoot":"","sources":["../../src/rules/url-search-params.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,sBAAsB;IAC7B,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,CAAC;IAC/D,UAAU,EAAE,EAAE;IACd,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,6aAA6a;KACpb;IACD,MAAM,EAAE,yCAAyC;IACjD,KAAK,EAAE;QACL,SAAS,EACP,ybAAyb;QAC3b,OAAO,EAAE;;;;;;;;0BAQa;QACtB,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4DAA4D;QAClE,MAAM,EAAE;YACN,4JAA4J;YAC5J,0JAA0J;YAC1J,oJAAoJ;YACpJ,mKAAmK;YACnK,iHAAiH;YACjH,6QAA6Q;SAC9Q;QACD,OAAO,EAAE;;;8CAGiC;KAC3C;
|
|
1
|
+
{"version":3,"file":"url-search-params.js","sourceRoot":"","sources":["../../src/rules/url-search-params.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,sBAAsB;IAC7B,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,CAAC;IAC/D,UAAU,EAAE,EAAE;IACd,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,6aAA6a;KACpb;IACD,MAAM,EAAE,yCAAyC;IACjD,KAAK,EAAE;QACL,SAAS,EACP,ybAAyb;QAC3b,OAAO,EAAE;;;;;;;;0BAQa;QACtB,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4DAA4D;QAClE,MAAM,EAAE;YACN,4JAA4J;YAC5J,0JAA0J;YAC1J,oJAAoJ;YACpJ,mKAAmK;YACnK,iHAAiH;YACjH,6QAA6Q;SAC9Q;QACD,OAAO,EAAE;;;8CAGiC;KAC3C;IACD,QAAQ,EAAE,sCAAsC;CACjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-animations.d.ts","sourceRoot":"","sources":["../../src/rules/web-animations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,aAAa,EAAE,IAwC3B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const webAnimations = {
|
|
2
|
+
id: "web-animations",
|
|
3
|
+
title: "Animating from JavaScript",
|
|
4
|
+
category: "animation",
|
|
5
|
+
replaces: ["animejs", "popmotion", "velocity-animate"],
|
|
6
|
+
featureIds: ["web-animations"],
|
|
7
|
+
native: "element.animate()",
|
|
8
|
+
human: {
|
|
9
|
+
explainer: "These libraries run their own tick loop, working out each frame's values in JavaScript and writing them to the element's style. element.animate() hands the same keyframes to the engine that already runs CSS animations, so transforms and opacity are animated off the main thread and keep going while JavaScript is busy. It returns an Animation with play, pause, reverse, cancel and finish on it, plus a finished promise to await.",
|
|
10
|
+
snippet: `const animation = card.animate(
|
|
11
|
+
[
|
|
12
|
+
{ transform: "translateY(12px)", opacity: 0 },
|
|
13
|
+
{ transform: "none", opacity: 1 },
|
|
14
|
+
],
|
|
15
|
+
{ duration: 240, easing: "cubic-bezier(0.2, 0, 0, 1)", fill: "both" },
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
await animation.finished;
|
|
19
|
+
|
|
20
|
+
// The same handle drives it afterwards.
|
|
21
|
+
animation.reverse();`,
|
|
22
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API",
|
|
23
|
+
},
|
|
24
|
+
agent: {
|
|
25
|
+
when: "animating an element's styles from JavaScript and needing a handle to control it",
|
|
26
|
+
unless: [
|
|
27
|
+
"You animate something that is not a CSS property on an element: a number in a counter, a canvas, a scroll offset, an SVG path's shape. anime.js animates arbitrary object properties, where element.animate() only writes styles.",
|
|
28
|
+
"The motion is spring-based or driven by a gesture's velocity. Web Animations takes a duration and an easing curve, so anything that has to respond to how fast a finger was moving is still the library's job.",
|
|
29
|
+
"You sequence many elements on one timeline with staggers and relative offsets. That timeline is the reason a lot of people install anime.js, and composing it by hand means computing every delay yourself.",
|
|
30
|
+
"A plain CSS transition or @keyframes would do. Reaching for element.animate() to fade one element in trades a declarative rule for a script that has to run first.",
|
|
31
|
+
"You animate to an intrinsic size such as height: auto, which is interpolate-size and calc-size rather than either approach here.",
|
|
32
|
+
],
|
|
33
|
+
snippet: `const animation = card.animate(
|
|
34
|
+
[{ opacity: 0 }, { opacity: 1 }],
|
|
35
|
+
{ duration: 240, fill: "both" },
|
|
36
|
+
);
|
|
37
|
+
await animation.finished;`,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=web-animations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-animations.js","sourceRoot":"","sources":["../../src/rules/web-animations.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAS;IACjC,EAAE,EAAE,gBAAgB;IACpB,KAAK,EAAE,2BAA2B;IAClC,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,kBAAkB,CAAC;IACtD,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE;QACL,SAAS,EACP,8aAA8a;QAChb,OAAO,EAAE;;;;;;;;;;;qBAWQ;QACjB,MAAM,EACJ,qEAAqE;KACxE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,kFAAkF;QACxF,MAAM,EAAE;YACN,mOAAmO;YACnO,gNAAgN;YAChN,6MAA6M;YAC7M,oKAAoK;YACpK,kIAAkI;SACnI;QACD,OAAO,EAAE;;;;0BAIa;KACvB;CACF,CAAC"}
|