@nldd/design-system 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +32 -0
- package/dist/cdn/autoloader.js +141 -141
- package/dist/cdn/chunks/{accordion-item-D90CmJyl.js → accordion-item-Db9LW8AG.js} +4 -4
- package/dist/cdn/chunks/{accordion-DBM4AcGb.js → accordion-tLICRUFs.js} +4 -4
- package/dist/cdn/chunks/{activity-indicator-B6m9h0oa.js → activity-indicator-CMNIikEV.js} +5 -5
- package/dist/cdn/chunks/{admonition-B-YTkCjn.js → admonition-DEXVkTJm.js} +4 -4
- package/dist/cdn/chunks/{avatar-group-DW_xMwb_.js → avatar-group-DMU0HLBL.js} +15 -15
- package/dist/cdn/chunks/{avatar-CfBP9UZZ.js → avatar-nLrlfh4s.js} +6 -6
- package/dist/cdn/chunks/{badge-DnAuIhp1.js → badge-D1XadmOE.js} +5 -5
- package/dist/cdn/chunks/{banner-CRk2ARtC.js → banner-B4kFQlHx.js} +7 -7
- package/dist/cdn/chunks/{bar-split-view-DDgOYs7Z.js → bar-split-view-DtD4zmoP.js} +5 -5
- package/dist/cdn/chunks/{blockquote-DlfhBScg.js → blockquote-DbFjwox8.js} +3 -3
- package/dist/cdn/chunks/{box-DdU13yI4.js → box-BlwaDicI.js} +3 -3
- package/dist/cdn/chunks/{breadcrumbs-CqkR_6XN.js → breadcrumbs-DJS9-8wX.js} +5 -5
- package/dist/cdn/chunks/{button-muXGJHlo.js → button-BK8CmshL.js} +8 -8
- package/dist/cdn/chunks/{button-bar-BKkap9nk.js → button-bar-5RtXjgGl.js} +3 -3
- package/dist/cdn/chunks/{button-group-D-YTmErV.js → button-group-BYMkQNhT.js} +2 -2
- package/dist/cdn/chunks/{card-Dvqz83fC.js → card-NNl0PxBY.js} +4 -4
- package/dist/cdn/chunks/{cell-C0O8tZbX.js → cell-D2NzCBVZ.js} +6 -6
- package/dist/cdn/chunks/{checkbox-CNWROiHV.js → checkbox-CXFA_up4.js} +5 -5
- package/dist/cdn/chunks/{checkbox-field-DCYpRJfz.js → checkbox-field-sFs7GvAq.js} +7 -7
- package/dist/cdn/chunks/{checkbox-group-DxWAYp_b.js → checkbox-group-BPN4eRCX.js} +3 -3
- package/dist/cdn/chunks/{class-map-D720ceWJ.js → class-map-1XjgYGeg.js} +1 -1
- package/dist/cdn/chunks/{code-editor-DlnTXkHx.js → code-editor-KZEaMAN7.js} +5 -5
- package/dist/cdn/chunks/{code-viewer-DyJzo36-.js → code-viewer-CJwpLKb1.js} +7 -7
- package/dist/cdn/chunks/{codemirror-input-DPSOMYZ4.js → codemirror-input-CYBNNf0-.js} +5 -5
- package/dist/cdn/chunks/{collection-i7H8zkQ8.js → collection-BdUB8qeL.js} +8 -8
- package/dist/cdn/chunks/{combo-box-CpNl_us0.js → combo-box-DxWW-zeE.js} +9 -9
- package/dist/cdn/chunks/{container-YWW7mHNa.js → container-Dhf1Ahi8.js} +2 -2
- package/dist/cdn/chunks/{custom-element-D8yf5dqU.js → custom-element-DtLjpays.js} +1 -1
- package/dist/cdn/chunks/{date-field-DzhUp4Rk.js → date-field-D83r9gjY.js} +12 -12
- package/dist/cdn/chunks/{date-picker-CGvsvK3g.js → date-picker-D8qv2iuG.js} +10 -10
- package/dist/cdn/chunks/{decorate-1aEyfetK.js → decorate-BhnGmemK.js} +1 -1
- package/dist/cdn/chunks/{described-by-mixin-DffYoaxu.js → described-by-mixin-Jh_PTTde.js} +2 -2
- package/dist/cdn/chunks/{description-cell-DEw6xc2o.js → description-cell-nQKMluy8.js} +6 -6
- package/dist/cdn/chunks/{dev-checks-CTopJcdE.js → dev-checks-Bet7bhMS.js} +87 -49
- package/dist/cdn/chunks/{directive-helpers-BQml5ahH.js → directive-helpers-dLE2M1R1.js} +1 -1
- package/dist/cdn/chunks/{dist-DAf6EMuK.js → dist-BTuJ-NyU.js} +2 -2
- package/dist/cdn/chunks/{dist-B5t9fS8q.js → dist-BbwC3zHR.js} +2 -2
- package/dist/cdn/chunks/{dist-BYbLHkMP.js → dist-BpqJqkl_.js} +1 -1
- package/dist/cdn/chunks/{dist-D59Ae7dj.js → dist-C9xmfEc_.js} +1 -1
- package/dist/cdn/chunks/{dist-CIX4JLW1.js → dist-CYKK2xXE.js} +3 -3
- package/dist/cdn/chunks/{dist-DevfJ4Mu.js → dist-Cdmhq-4P.js} +2 -2
- package/dist/cdn/chunks/{dist-BKnqQxdv.js → dist-DJSiRJRL.js} +1 -1
- package/dist/cdn/chunks/{dist-C8ZY_QIK.js → dist-DwevYbXo.js} +1 -1
- package/dist/cdn/chunks/{dist-B87Ag4L-.js → dist-Dzlvec4O.js} +1 -1
- package/dist/cdn/chunks/{dist-qHSPGfTO.js → dist-EP5KATv0.js} +1 -1
- package/dist/cdn/chunks/{dist-Cr8NctvS.js → dist-u6MS5-M8.js} +3 -3
- package/dist/cdn/chunks/{divider-44rkHLYj.js → divider-DjT76fuO.js} +2 -2
- package/dist/cdn/chunks/{document-tab-bar-CcSKzhEy.js → document-tab-bar-CO2M1bFc.js} +9 -9
- package/dist/cdn/chunks/{dropdown-CJPjI-p1.js → dropdown-CdQ1beF2.js} +5 -5
- package/dist/cdn/chunks/{file-field-B4HQKpkI.js → file-field-D0UlnM9R.js} +13 -13
- package/dist/cdn/chunks/{form-obggZEpt.js → form-BV9wifov.js} +1 -1
- package/dist/cdn/chunks/{form-actions-HaBfh6vm.js → form-actions-DDeF8urg.js} +2 -2
- package/dist/cdn/chunks/{form-associated-mixin-BByNH679.js → form-associated-mixin-Cm1N24gR.js} +2 -2
- package/dist/cdn/chunks/{form-field-CwYXsuvv.js → form-field-IeKadcwe.js} +5 -5
- package/dist/cdn/chunks/{form-section-B2UZx_-z.js → form-section-C350G5wg.js} +1 -1
- package/dist/cdn/chunks/{full-bleed-section-BSnWghWY.js → full-bleed-section-CR3zsX7K.js} +3 -3
- package/dist/cdn/chunks/{hero-CzbuEAUM.js → hero-Ch5el5J5.js} +4 -4
- package/dist/cdn/chunks/{icon-CkCT7sPE.js → icon-Dj98ov4G.js} +2 -2
- package/dist/cdn/chunks/{icon-button-BBGwCfYp.js → icon-button-HKoCqWG3.js} +9 -9
- package/dist/cdn/chunks/{icon-cell-DcHnXV-8.js → icon-cell-C1I-oIWn.js} +5 -5
- package/dist/cdn/chunks/{identity-C0fujsxK.js → identity-DNkEDJ8m.js} +6 -6
- package/dist/cdn/chunks/{if-defined-CL4nn-Q-.js → if-defined-CZ1Fmb74.js} +1 -1
- package/dist/cdn/chunks/{image-BgtqLXfM.js → image-KXTd-hL-.js} +8 -8
- package/dist/cdn/chunks/{inline-dialog-BYRIWhkm.js → inline-dialog-BTI0xmIT.js} +6 -6
- package/dist/cdn/chunks/{just-in-time-education-DwH3ubhZ.js → just-in-time-education-BtjbYffu.js} +5 -5
- package/dist/cdn/chunks/{kanban-BIZUoBj-.js → kanban-DNXtL34O.js} +5 -5
- package/dist/cdn/chunks/{kanban-column-CtjCIgaR.js → kanban-column-D0ujQ2_W.js} +4 -4
- package/dist/cdn/chunks/{keyboard-shortcut-BHylGMNu.js → keyboard-shortcut-BikzmCBH.js} +3 -3
- package/dist/cdn/chunks/{languages-DghCYmiz.js → languages-CPd7_I8H.js} +12 -12
- package/dist/cdn/chunks/{link-S53veJpD.js → link-DqMeRYFm.js} +6 -6
- package/dist/cdn/chunks/{link-group-B2_vdANe.js → link-group-BKn4MHA-.js} +2 -2
- package/dist/cdn/chunks/{list-C8hY4uGW.js → list-C8Dnks-q.js} +8 -8
- package/dist/cdn/chunks/{list-item-CK1Rli4F.js → list-item-CSP1a_cN.js} +5 -5
- package/dist/cdn/chunks/{list-item-segment-KyrcOFDA.js → list-item-segment-BvFqXXnA.js} +3 -3
- package/dist/cdn/chunks/{menu-m67vk1Z4.js → menu-LZ0DmVCe.js} +13 -13
- package/dist/cdn/chunks/{menu-bar-item-DKW198ZW.js → menu-bar-item-DENdrp0m.js} +6 -6
- package/dist/cdn/chunks/{menu-bar-BRoqy5zp.js → menu-bar-rsGd3kKq.js} +6 -6
- package/dist/cdn/chunks/{menu-divider-DDPBPK-o.js → menu-divider-BptK2nug.js} +3 -3
- package/dist/cdn/chunks/{menu-group-uZXsE-uu.js → menu-group-0B34NyN5.js} +4 -4
- package/dist/cdn/chunks/{menu-item-BOvb4QLd.js → menu-item-55vjckz2.js} +4 -4
- package/dist/cdn/chunks/{menu.template-v6VnRUNJ.js → menu.template-B_HMnBsa.js} +5 -5
- package/dist/cdn/chunks/{modal-dialog-BNq0r-1L.js → modal-dialog-DQY_0Qlk.js} +4 -4
- package/dist/cdn/chunks/{multi-line-text-field-Bfq47I3P.js → multi-line-text-field-DB4Vflno.js} +6 -6
- package/dist/cdn/chunks/{navigation-split-view-BiPoxCLL.js → navigation-split-view-Dbhrxni9.js} +4 -4
- package/dist/cdn/chunks/{notification-DjZXBv4J.js → notification-dtrMLORo.js} +6 -6
- package/dist/cdn/chunks/{number-field-tqoQLrgZ.js → number-field-Ctxk40as.js} +8 -8
- package/dist/cdn/chunks/{one-half-one-half-section-CyIm21PD.js → one-half-one-half-section-Bx6KLSY5.js} +3 -3
- package/dist/cdn/chunks/{one-third-two-thirds-section-CpnK0vzB.js → one-third-two-thirds-section-Bql0Xrsc.js} +3 -3
- package/dist/cdn/chunks/{one-time-code-field-6sMEfzoY.js → one-time-code-field-B-y5gRLi.js} +7 -7
- package/dist/cdn/chunks/{overflow-menu-IfYEX8tm.js → overflow-menu-Cs1VLcX7.js} +1 -1
- package/dist/cdn/chunks/{page-w4XAfBWD.js → page-Bdkit86l.js} +6 -6
- package/dist/cdn/chunks/{page-footer-ET6j1N2Z.js → page-footer-D68JiIFE.js} +4 -4
- package/dist/cdn/chunks/{page-section-mixin-D9JL2q9A.js → page-section-mixin-Bmlpcmrw.js} +3 -3
- package/dist/cdn/chunks/{pagination-D7QFUu8x.js → pagination-BH6UQbby.js} +6 -6
- package/dist/cdn/chunks/{password-field-Ck5wx6pg.js → password-field-Dz0znv2L.js} +8 -8
- package/dist/cdn/chunks/{popover-DOmi5m85.js → popover-C6j3sO70.js} +5 -5
- package/dist/cdn/chunks/{progress-bar-BDNcB06i.js → progress-bar-BA_5dDXK.js} +7 -7
- package/dist/cdn/chunks/{progress-circle-BAMztpb3.js → progress-circle-DsCyTyw-.js} +7 -7
- package/dist/cdn/chunks/{radio-button-field-BbPk0nM_.js → radio-button-field-JsQalrMs.js} +6 -6
- package/dist/cdn/chunks/{radio-button-group-lxzwku00.js → radio-button-group-Bqn43LYh.js} +3 -3
- package/dist/cdn/chunks/{radio-button-DAps6n0Q.js → radio-button-pcE5Vo5k.js} +4 -4
- package/dist/cdn/chunks/{render-marked-ClMFyNu0.js → render-marked-DAVGoeYa.js} +1 -1
- package/dist/cdn/chunks/{reorder-handle-cell-Cap2u2zx.js → reorder-handle-cell-r4OuA45S.js} +4 -4
- package/dist/cdn/chunks/{reorder-handle-mixin-CnRKPVqU.js → reorder-handle-mixin-Co5E_Y7l.js} +2 -2
- package/dist/cdn/chunks/{repeat-CIyCvHHQ.js → repeat-DoLR8W_a.js} +2 -2
- package/dist/cdn/chunks/{rich-text-CblFmHY-.js → rich-text-CEmzxZRC.js} +3 -3
- package/dist/cdn/chunks/{row-header-mixin-C8z9StDU.js → row-header-mixin-BCYXiXva.js} +2 -2
- package/dist/cdn/chunks/{scroll-fade-C_L9CJrR.js → scroll-fade-OSFrYTum.js} +2 -2
- package/dist/cdn/chunks/{search-field-JeUPcBjZ.js → search-field-CT483s7J.js} +10 -10
- package/dist/cdn/chunks/{segmented-control-DtycvVyp.js → segmented-control-5zMasjz7.js} +7 -7
- package/dist/cdn/chunks/{shadow-resets-DgR56wQK.js → shadow-resets-DR73IFIL.js} +2 -2
- package/dist/cdn/chunks/{sheet-XtRs26hN.js → sheet-CDXX61d_.js} +3 -3
- package/dist/cdn/chunks/{shell-CCaEEGna.js → shell-C4vAeA49.js} +3 -3
- package/dist/cdn/chunks/{side-by-side-split-view-mhXD4Lde.js → side-by-side-split-view-D9_u1TIS.js} +4 -4
- package/dist/cdn/chunks/{sidebar-section-Cwd4LSE6.js → sidebar-section-vWX-ymIa.js} +7 -7
- package/dist/cdn/chunks/{simple-section-BuiaCGks.js → simple-section-CEw2oC7K.js} +3 -3
- package/dist/cdn/chunks/{skip-link-nTlmioFt.js → skip-link-DcOGlfM9.js} +4 -4
- package/dist/cdn/chunks/{slider-C0rNQEIY.js → slider-B108QDlz.js} +9 -9
- package/dist/cdn/chunks/{spacer-CeSO9CP1.js → spacer-CpfTNtbZ.js} +2 -2
- package/dist/cdn/chunks/{spacer-cell-NhlxEdhA.js → spacer-cell-DBm7_AUi.js} +4 -4
- package/dist/cdn/chunks/{split-button-BR-ccA6_.js → split-button-DxgDxdan.js} +7 -7
- package/dist/cdn/chunks/{split-view-divider-HcIV0yli.js → split-view-divider-6_RDvANN.js} +2 -2
- package/dist/cdn/chunks/{split-view-pane-BgFUL3BV.js → split-view-pane-9tEGLRZC.js} +3 -3
- package/dist/cdn/chunks/{stacked-split-view-j77p3uE2.js → stacked-split-view-CRMEMwtv.js} +4 -4
- package/dist/cdn/chunks/{static-html-CGoLwgpW.js → static-html-CmXnRyP6.js} +1 -1
- package/dist/cdn/chunks/{status-bar-ByJ21hV2.js → status-bar-Blk_iYSD.js} +4 -4
- package/dist/cdn/chunks/{step-bar-CRxF0S42.js → step-bar-DM4a_0PG.js} +5 -5
- package/dist/cdn/chunks/{step-cell-C-gOxNA6.js → step-cell-CUs8AKJq.js} +5 -5
- package/dist/cdn/chunks/{stepper-Dmljb7Qc.js → stepper-JwxPNJRc.js} +7 -7
- package/dist/cdn/chunks/{style-map-CK811FGv.js → style-map-DUDIMhuW.js} +1 -1
- package/dist/cdn/chunks/{swatch-picker-DtAgTXLo.js → swatch-picker-BXs7Ob4o.js} +6 -6
- package/dist/cdn/chunks/{switch-Bqion92b.js → switch-CWKoOyz7.js} +5 -5
- package/dist/cdn/chunks/{switch-field-CWobTcEn.js → switch-field-BgX9mNOA.js} +6 -6
- package/dist/cdn/chunks/{tab-bar-DPtRjP8Z.js → tab-bar-BNaJSB38.js} +8 -8
- package/dist/cdn/chunks/{table-C4CFiDgr.js → table-dgJdHR92.js} +5 -5
- package/dist/cdn/chunks/{tag-Bo23A60g.js → tag-DHHf_gxq.js} +4 -4
- package/dist/cdn/chunks/{term-DPMEWR-t.js → term-DNLqQErM.js} +12 -12
- package/dist/cdn/chunks/{text-CuiMvMZQ.js → text-CK1-qJ6d.js} +3 -3
- package/dist/cdn/chunks/{text-cell-E3yc99xw.js → text-cell-CrKBqL5A.js} +8 -8
- package/dist/cdn/chunks/{text-editor-BVmHiq_b.js → text-editor-B0A2vNpD.js} +10 -10
- package/dist/cdn/chunks/{text-field-DOv1aI_F.js → text-field-CqYxSiKy.js} +6 -6
- package/dist/cdn/chunks/{time-field-BhlLk6tt.js → time-field-DHm6KQsG.js} +14 -14
- package/dist/cdn/chunks/{time-picker-A4-HeVas.js → time-picker-C_BE5oNq.js} +5 -5
- package/dist/cdn/chunks/{title-EMt-SYKV.js → title-BpREzeX9.js} +4 -4
- package/dist/cdn/chunks/{title-cell--EE-L_8a.js → title-cell-C4ZL3mJo.js} +8 -8
- package/dist/cdn/chunks/{toggle-button-BLwpxmQs.js → toggle-button-COQdr-hZ.js} +8 -8
- package/dist/cdn/chunks/{toggle-button-group-scdxolJt.js → toggle-button-group-D4vTcGce.js} +2 -2
- package/dist/cdn/chunks/{token-DVgXuCRO.js → token-1DfHVSVj.js} +5 -5
- package/dist/cdn/chunks/{token-field-CICQXLlO.js → token-field-s_mCjtcZ.js} +11 -11
- package/dist/cdn/chunks/{toolbar-Des2gaH2.js → toolbar-Bz_8d1v-.js} +8 -8
- package/dist/cdn/chunks/{toolbar-item-CkwQ2UyY.js → toolbar-item-B-EDYaPf.js} +3 -3
- package/dist/cdn/chunks/{toolbar-title-PoOf794l.js → toolbar-title-Cl8VPHYK.js} +4 -4
- package/dist/cdn/chunks/{toolbar.styles-DzreUGTp.js → toolbar.styles-BiT7JPsr.js} +3 -3
- package/dist/cdn/chunks/{tooltip-CMCT2iiD.js → tooltip-DhPeqDvL.js} +4 -4
- package/dist/cdn/chunks/{top-navigation-bar-BfMGgTIy.js → top-navigation-bar-CHWqoNms.js} +17 -17
- package/dist/cdn/chunks/{top-title-bar-CvvldlNt.js → top-title-bar-DUp0bSIU.js} +6 -6
- package/dist/cdn/chunks/{translations-C5JpcNNC.js → translations-C6WKR-hE.js} +1 -1
- package/dist/cdn/chunks/{two-thirds-one-third-section-BTkeIiHm.js → two-thirds-one-third-section-CftZqodu.js} +3 -3
- package/dist/cdn/chunks/{validation-list-BasB3ZaT.js → validation-list-BdTSfsD6.js} +3 -3
- package/dist/cdn/chunks/{visibility-mixin-BxhcJG-x.js → visibility-mixin-DL737l0g.js} +2 -2
- package/dist/cdn/chunks/{visually-hidden-ByHY8pKl.js → visually-hidden-DvU3wAD4.js} +2 -2
- package/dist/cdn/chunks/{window-B5blEfMR.js → window-7XYqha2V.js} +4 -4
- package/dist/cdn/chunks/{with-translations-QDhHJYMT.js → with-translations-nT8q6ELU.js} +3 -3
- package/dist/components/content/image/image.d.ts +1 -4
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +1 -4
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts +1 -4
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +1 -4
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +4 -0
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +4 -0
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page/page.styles.js +2 -2
- package/dist/components/layout/shell/shell.d.ts +2 -0
- package/dist/components/layout/shell/shell.d.ts.map +1 -1
- package/dist/components/layout/shell/shell.js +2 -0
- package/dist/components/layout/shell/shell.js.map +1 -1
- package/dist/nldd.min.js +2 -2
- package/dist/utilities/dev-checks.d.ts +6 -0
- package/dist/utilities/dev-checks.d.ts.map +1 -1
- package/dist/utilities/dev-checks.js +42 -16
- package/dist/utilities/dev-checks.js.map +1 -1
- package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
- package/dist/utilities/dev-rules.generated.js +27 -2
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/lint/css.js +58 -26
- package/lint/data.generated.json +1 -1
- package/lint/engine.js +29 -12
- package/lint/fix.js +103 -12
- package/lint/format.js +4 -3
- package/lint/frontends.js +153 -35
- package/lint/linter.js +174 -25
- package/lint/main.js +7 -2
- package/lint/project.js +50 -12
- package/lint/rule-compiler.js +20 -11
- package/lint/rule-data.js +8 -0
- package/lint/rule.schema.json +2 -1
- package/lint/session.js +42 -18
- package/lint/tree.js +5 -2
- package/package.json +1 -1
package/lint/session.js
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* corpus measures the linter consumers run.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
9
|
+
import { lstatSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
10
10
|
import { extname, relative, resolve, sep } from 'node:path';
|
|
11
11
|
import { applyFixes, linesNaming, renameReferences } from './fix.js';
|
|
12
12
|
import { BUILT_IN_RULES, GROUPS, OPT_IN_GROUPS } from './rule-data.js';
|
|
13
|
-
import { DEFAULT_EXTENSIONS, findFiles, IGNORED_DIRECTORIES, isBundle, isRelevant, projectTokens, REFERENCE_EXTENSIONS, STYLESHEET_EXTENSIONS, UNREAD_EXTENSIONS } from './project.js';
|
|
13
|
+
import { DEFAULT_EXTENSIONS, findFiles, IGNORED_DIRECTORIES, partialExcludes, isBundle, isRelevant, projectTokens, REFERENCE_EXTENSIONS, SCRIPT_EXTENSIONS, STYLESHEET_EXTENSIONS, UNREAD_EXTENSIONS } from './project.js';
|
|
14
14
|
|
|
15
15
|
/** Every name `--select`, `--ignore` and .nldd-lint.json may use: rule ids, aliases and groups. */
|
|
16
16
|
export function knownKeys(data) {
|
|
@@ -28,22 +28,29 @@ export function isUtf8(filename) {
|
|
|
28
28
|
return bytes.equals(Buffer.from(bytes.toString('utf8')));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/** Writing through a link would change a file somewhere else, maybe outside the project. */
|
|
32
|
+
const isSymlink = (filename) => lstatSync(filename, { throwIfNoEntry: false })?.isSymbolicLink() ?? false;
|
|
33
|
+
|
|
31
34
|
const MAX_FIX_PASSES = 10;
|
|
32
35
|
|
|
33
|
-
/**
|
|
34
|
-
|
|
36
|
+
/**
|
|
37
|
+
* One fix can open the way for the next: a renamed tag has rules of its own.
|
|
38
|
+
* `unstable` says the passes ran out with fixes still to apply.
|
|
39
|
+
*/
|
|
40
|
+
export async function fixUntilStable(linter, original, filename, options) {
|
|
35
41
|
let source = original;
|
|
36
42
|
let fixed = 0;
|
|
37
43
|
const renamedTags = new Map();
|
|
38
44
|
for (let pass = 0; pass < MAX_FIX_PASSES; pass++) {
|
|
39
|
-
const { findings } = await linter.lintSource(source, filename);
|
|
45
|
+
const { findings } = await linter.lintSource(source, filename, options);
|
|
40
46
|
const change = applyFixes(source, findings);
|
|
41
|
-
if (change.fixed === 0) return { source, fixed, renamedTags, findings };
|
|
47
|
+
if (change.fixed === 0) return { source, fixed, renamedTags, findings, unstable: false };
|
|
42
48
|
source = change.source;
|
|
43
49
|
fixed += change.fixed;
|
|
44
50
|
for (const [from, to] of change.renamedTags) renamedTags.set(from, to);
|
|
45
51
|
}
|
|
46
|
-
|
|
52
|
+
const { findings } = await linter.lintSource(source, filename, options);
|
|
53
|
+
return { source, fixed, renamedTags, findings, unstable: applyFixes(source, findings).fixed > 0 };
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
const isUnread = (filename) => UNREAD_EXTENSIONS.includes(extname(filename));
|
|
@@ -68,10 +75,12 @@ function fixReferences(renamedTags, paths, root, exclude) {
|
|
|
68
75
|
const remaining = [];
|
|
69
76
|
const kindOf = (file) => (/\.(css|scss|less)$/.test(file) ? 'styles' : /\.[cm]?[jt]s$/.test(file) || !inMarkup.includes(file) ? 'script' : 'markup');
|
|
70
77
|
for (const list of [inMarkup, elsewhere]) {
|
|
71
|
-
for (const filename of list
|
|
78
|
+
for (const filename of list) {
|
|
72
79
|
const source = readFileSync(filename, 'utf8');
|
|
80
|
+
// The lint pass skips a bundle, so a rename leaves it alone too.
|
|
81
|
+
if (isBundle(filename, source)) continue;
|
|
73
82
|
const change = isBuilt(filename, root) ? { source, fixed: 0 } : renameReferences(source, renamedTags, kindOf(filename));
|
|
74
|
-
if (change.fixed > 0 && isUtf8(filename)) {
|
|
83
|
+
if (change.fixed > 0 && !isSymlink(filename) && isUtf8(filename)) {
|
|
75
84
|
writeFileSync(filename, change.source);
|
|
76
85
|
fixed += change.fixed;
|
|
77
86
|
files += 1;
|
|
@@ -93,7 +102,7 @@ function fixReferences(renamedTags, paths, root, exclude) {
|
|
|
93
102
|
* @param {boolean} [options.fix] - write the fixes that are certain
|
|
94
103
|
* @param {(filename: string) => boolean} [options.keep] - read this file even without a component
|
|
95
104
|
* @returns {Promise<{ results: object[], files: number, unread: number, fixed: number, fixedFiles: number,
|
|
96
|
-
* notUtf8: string[], references?: { fixed: number, files: number, remaining: string[] } }>}
|
|
105
|
+
* notUtf8: string[], symlinks: string[], unstable: string[], partialExcludes: { entry: string, file: string }[], references?: { fixed: number, files: number, remaining: string[] } }>}
|
|
97
106
|
*/
|
|
98
107
|
export async function lintProject(data, { root, paths = [], config = {}, severities, input, fix = false, keep = () => false }) {
|
|
99
108
|
const everything = readsEverything(data, severities);
|
|
@@ -101,7 +110,7 @@ export async function lintProject(data, { root, paths = [], config = {}, severit
|
|
|
101
110
|
const named = new Set(paths.map((path) => resolve(root, path)).filter((path) => statSync(path, { throwIfNoEntry: false })?.isFile()));
|
|
102
111
|
const inputs = input
|
|
103
112
|
? [{ filename: resolve(root, input.filename), source: input.source }]
|
|
104
|
-
: findFiles(paths, root, config.exclude, [...DEFAULT_EXTENSIONS, ...STYLESHEET_EXTENSIONS, ...UNREAD_EXTENSIONS])
|
|
113
|
+
: findFiles(paths, root, config.exclude, [...DEFAULT_EXTENSIONS, ...STYLESHEET_EXTENSIONS, ...UNREAD_EXTENSIONS, ...SCRIPT_EXTENSIONS])
|
|
105
114
|
.filter((filename) => named.has(resolve(filename)) || !isBuiltScript(filename, root))
|
|
106
115
|
.map((filename) => ({ filename, source: readFileSync(filename, 'utf8') }))
|
|
107
116
|
// A template the linter cannot read matters only with our markup; the rest is let go.
|
|
@@ -111,13 +120,23 @@ export async function lintProject(data, { root, paths = [], config = {}, severit
|
|
|
111
120
|
// Most files in an app use no component at all, and those need no parser either.
|
|
112
121
|
// A stylesheet is still read for the tokens it declares.
|
|
113
122
|
const isStylesheet = (filename) => STYLESHEET_EXTENSIONS.includes(extname(filename));
|
|
114
|
-
|
|
123
|
+
// A script found by the scan is read only for a listener on a renamed event; one named on the command line is read in full.
|
|
124
|
+
const removedEvents = Object.keys(data.removedEvents ?? {});
|
|
125
|
+
const events = removedEvents.length > 0 ? new RegExp(removedEvents.map((name) => name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|')) : undefined;
|
|
126
|
+
const eventsOnly = (filename) => SCRIPT_EXTENSIONS.includes(extname(filename)) && !named.has(resolve(filename));
|
|
127
|
+
const relevant = (everything ? inputs : inputs.filter((one) => isRelevant(one, { wrappers: config.wrappers, keep, events })))
|
|
128
|
+
.filter((one) => !eventsOnly(one.filename) || events?.test(one.source));
|
|
115
129
|
// A file without a parser was opened and not checked, so it does not count as one.
|
|
116
130
|
const checked = inputs.filter(({ filename }) => !isUnread(filename));
|
|
117
|
-
const
|
|
131
|
+
const countsWhenRelevant = (filename) => isStylesheet(filename) || eventsOnly(filename);
|
|
132
|
+
const files = everything
|
|
133
|
+
? checked.filter(({ filename }) => !eventsOnly(filename)).length + relevant.filter(({ filename }) => eventsOnly(filename)).length
|
|
134
|
+
: checked.filter(({ filename }) => !countsWhenRelevant(filename)).length + relevant.filter(({ filename }) => countsWhenRelevant(filename)).length;
|
|
118
135
|
|
|
119
136
|
const results = [];
|
|
120
137
|
const notUtf8 = [];
|
|
138
|
+
const symlinks = [];
|
|
139
|
+
const unstable = [];
|
|
121
140
|
const renamedTags = new Map();
|
|
122
141
|
let fixed = 0;
|
|
123
142
|
let fixedFiles = 0;
|
|
@@ -125,13 +144,17 @@ export async function lintProject(data, { root, paths = [], config = {}, severit
|
|
|
125
144
|
const { createLinter } = await import('./linter.js');
|
|
126
145
|
const linter = createLinter(data, { wrappers: config.wrappers, severities, projectTokens: projectTokens(inputs) });
|
|
127
146
|
for (const { filename, source } of relevant) {
|
|
128
|
-
const
|
|
129
|
-
|
|
147
|
+
const options = eventsOnly(filename) ? { only: 'events' } : undefined;
|
|
148
|
+
const linked = fix && isSymlink(filename);
|
|
149
|
+
const canWrite = fix && !linked && isUtf8(filename);
|
|
150
|
+
if (linked) symlinks.push(filename);
|
|
151
|
+
else if (fix && !canWrite) notUtf8.push(filename);
|
|
130
152
|
if (!canWrite) {
|
|
131
|
-
results.push({ filename, source, ...(await linter.lintSource(source, filename)) });
|
|
153
|
+
results.push({ filename, source, ...(await linter.lintSource(source, filename, options)) });
|
|
132
154
|
continue;
|
|
133
155
|
}
|
|
134
|
-
const change = await fixUntilStable(linter, source, filename);
|
|
156
|
+
const change = await fixUntilStable(linter, source, filename, options);
|
|
157
|
+
if (change.unstable) unstable.push(filename);
|
|
135
158
|
if (change.fixed > 0) {
|
|
136
159
|
writeFileSync(filename, change.source);
|
|
137
160
|
fixed += change.fixed;
|
|
@@ -145,5 +168,6 @@ export async function lintProject(data, { root, paths = [], config = {}, severit
|
|
|
145
168
|
// Not in `files`: what has our markup and was not read, so the summary can say so.
|
|
146
169
|
// Counted on the markup, so a suppressed `file-not-read` does not make it read.
|
|
147
170
|
const unread = inputs.filter(({ filename, source }) => isUnread(filename) && hasOurMarkup(source)).length;
|
|
148
|
-
|
|
171
|
+
const partial = input ? [] : partialExcludes(paths, root, config.exclude, [...DEFAULT_EXTENSIONS, ...STYLESHEET_EXTENSIONS, ...UNREAD_EXTENSIONS, ...SCRIPT_EXTENSIONS]);
|
|
172
|
+
return { results, files, unread, fixed, fixedFiles, notUtf8, symlinks, unstable, partialExcludes: partial, references };
|
|
149
173
|
}
|
package/lint/tree.js
CHANGED
|
@@ -51,7 +51,10 @@ export const BOUND = Symbol('bound');
|
|
|
51
51
|
*/
|
|
52
52
|
|
|
53
53
|
/** Vue, Alpine, Lit and Angular write a name with a prefix, JSX and HTML bare. */
|
|
54
|
-
const WRITTEN = /^(:|v-bind:|x-bind:|\.|\?|\[attr\.|\[\(?)?([A-Za-z_][\w-]*)((?:\.
|
|
54
|
+
const WRITTEN = /^(:|v-bind:|x-bind:|\.|\?|\[attr\.|\[\(?)?([A-Za-z_][\w-]*)((?:\.[a-zA-Z]+)*)(\)?\])?$/;
|
|
55
|
+
|
|
56
|
+
/** Vue and Alpine take any modifier after the name, `:value.sync`; the others only these. */
|
|
57
|
+
const modifiersFit = (prefix = '', modifiers) => !modifiers || /^\.(prop|attr|camel)$/.test(modifiers) || /^(:|v-bind:|x-bind:)$/.test(prefix);
|
|
55
58
|
|
|
56
59
|
/**
|
|
57
60
|
* The span of an attribute the parser reported from `start` to just before `end`.
|
|
@@ -60,7 +63,7 @@ const WRITTEN = /^(:|v-bind:|x-bind:|\.|\?|\[attr\.|\[\(?)?([A-Za-z_][\w-]*)((?:
|
|
|
60
63
|
export function attributeSpan(source, written, start, end) {
|
|
61
64
|
const match = WRITTEN.exec(written);
|
|
62
65
|
const bracketed = Boolean(match?.[1]?.startsWith('['));
|
|
63
|
-
const valid = match && bracketed === Boolean(match[4]);
|
|
66
|
+
const valid = match && bracketed === Boolean(match[4]) && modifiersFit(match[1], match[3]);
|
|
64
67
|
const prefix = valid ? (match[1] ?? '') : '';
|
|
65
68
|
const nameStart = start + prefix.length;
|
|
66
69
|
const nameEnd = valid ? nameStart + match[2].length : start + written.length;
|