diff --git a/finder.js b/finder.js index cb118d9..d05c111 100644 --- a/finder.js +++ b/finder.js @@ -102,7 +102,7 @@ function* search(input, config, rootDocument) { } } function wordLike(name) { - if (/^[a-z0-9\-]{3,}$/i.test(name)) { + if (/^[a-z\-]{3,}$/i.test(name)) { const words = name.split(/-|[A-Z]/); for (const word of words) { if (word.length <= 2) { diff --git a/finder.ts b/finder.ts index 3e75ddc..1d8e852 100644 --- a/finder.ts +++ b/finder.ts @@ -155,7 +155,7 @@ function* search( } function wordLike(name: string): boolean { - if (/^[a-z0-9\-]{3,}$/i.test(name)) { + if (/^[a-z\-]{3,}$/i.test(name)) { const words = name.split(/-|[A-Z]/) for (const word of words) { if (word.length <= 2) { diff --git a/tests/__snapshots__/finder.test.js.snap b/tests/__snapshots__/finder.test.js.snap index 4a410da..041b9d7 100644 --- a/tests/__snapshots__/finder.test.js.snap +++ b/tests/__snapshots__/finder.test.js.snap @@ -1,5 +1,15 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html +exports[`bad-class-names 1`] = ` +[ + "html", + "head", + "body", + "div:nth-of-type(1)", + "div:nth-of-type(2)", +] +`; + exports[`deployer 1`] = ` [ "html", @@ -267,7 +277,7 @@ exports[`github 1`] = ` "meta:nth-of-type(32)", "meta:nth-of-type(33)", "meta:nth-of-type(34)", - "[name="dimension1"]", + "meta:nth-of-type(35)", "[name="hostname"]", "[name="user-login"]", "[name="expected-hostname"]", @@ -283,7 +293,7 @@ exports[`github 1`] = ` "[rel="mask-icon"]", "[rel="icon"]", "[name="theme-color"]", - "[name="u2f-support"]", + "meta:nth-of-type(47)", "[rel="manifest"]", ".logged-out", ".logged-out > .position-relative", @@ -318,7 +328,7 @@ exports[`github 1`] = ` ".header-search", ".header-search > form", ".header-search div", - ".header-search [name="utf8"]", + ".header-search div > input", ".header-search-wrapper", ".header-search-scope", ".header-search-input", @@ -343,7 +353,7 @@ exports[`github 1`] = ` ".flex-items-center > div > div", ".text-gray > .home-hero-signup", ".text-gray div", - ".text-gray [name="utf8"]", + ".text-gray div > input:nth-of-type(1)", ".text-gray div > input:nth-of-type(2)", ".home-hero-signup > dl:nth-of-type(1)", ".home-hero-signup > dl:nth-of-type(1) > .input-label", @@ -600,7 +610,7 @@ exports[`github 1`] = ` "div:nth-of-type(6) > div:nth-of-type(2)", ".featurette .home-hero-signup", "div:nth-of-type(2) > .home-hero-signup > div:nth-of-type(1)", - "div:nth-of-type(2) > .home-hero-signup [name="utf8"]", + "div:nth-of-type(2) > .home-hero-signup > div:nth-of-type(1) > input:nth-of-type(1)", "div:nth-of-type(2) > .home-hero-signup > div:nth-of-type(1) > input:nth-of-type(2)", ".home-hero-signup > .flex-wrap", ".flex-wrap > dl:nth-of-type(1)", @@ -1452,15 +1462,15 @@ exports[`tailwindcss 1`] = ` ".relative > .flex-none", ".flex-none > span", ".relative > .flex-none > svg", - ".flex-none .fill-sky-400", + "a:nth-of-type(1) path:nth-of-type(1)", ".flex-none > svg > path:nth-of-type(2)", ".flex-none > svg > path:nth-of-type(3)", ".relative > .group", - ".fill-sky-500", - ".fill-sky-500 > path", + ".group > svg:nth-of-type(1)", + ".group > svg:nth-of-type(1) > path", ".group > .font-semibold", - ".fill-slate-900", - ".fill-slate-900 > circle", + ".group > svg:nth-of-type(2)", + ".group circle", ".hidden > .font-medium", ".group > .font-medium > span", ".group > svg:nth-of-type(3)", @@ -1472,12 +1482,12 @@ exports[`tailwindcss 1`] = ` "a:nth-of-type(4)", ".relative > button:nth-of-type(1)", ".relative > button:nth-of-type(1) > span", - ".fill-gray-900", - ".fill-gray-900 > path", + "button:nth-of-type(1) > svg", + "button:nth-of-type(1) path", "button:nth-of-type(2)", "button:nth-of-type(2) > span", - ".stroke-slate-900", - ".stroke-slate-900 > path", + "button:nth-of-type(2) > svg", + "button:nth-of-type(2) path", "nav div:nth-of-type(2)", ".flex > div:nth-of-type(2) > a:nth-of-type(1)", ".hidden > .inline-flex", @@ -1486,16 +1496,16 @@ exports[`tailwindcss 1`] = ` "#app > div", "#app > .relative > .absolute", ".overflow-hidden > .relative", - ".relative > .text-sky-500", - ".relative > .text-4xl", - ".grid > .text-slate-700", + ".relative > .relative > .font-semibold", + ".relative > .font-extrabold", + ".relative > .relative > p", ".relative > .flex-col", ".flex-col > .text-white", ".flex-col > .text-white > span", - "span > .text-slate-400", - ".flex-col > .text-slate-900", - ".flex-col > .text-slate-900 > span", - ".text-slate-900 > span > .hidden", + ".text-white .hidden", + ".flex-col > a:nth-of-type(2)", + ".flex-col > a:nth-of-type(2) > span", + "a:nth-of-type(2) .hidden", ".grid > .pointer-events-none", ".origin-top", ".origin-top > div:nth-of-type(1)", @@ -1530,26 +1540,26 @@ exports[`tailwindcss 1`] = ` "div:nth-of-type(4) > .absolute > .flex", "div:nth-of-type(4) > .absolute > .flex > div:nth-of-type(1)", "div:nth-of-type(4) > .absolute div:nth-of-type(2)", - ".flex > .relative > .text-slate-900", - ".relative > .text-slate-900 > div:nth-of-type(1)", - ".text-slate-900 > div:nth-of-type(1) > .rounded-full", - ".text-slate-900 > div:nth-of-type(1) > .flex-auto", + ".relative > .relative > div:nth-of-type(5)", + "div:nth-of-type(4) > div:nth-of-type(5) > div:nth-of-type(1)", + "div:nth-of-type(5) > div:nth-of-type(1) > .rounded-full", + "div:nth-of-type(5) > div:nth-of-type(1) > .flex-auto", "div:nth-of-type(1) > .flex-auto > .font-medium", - "div:nth-of-type(1) > .flex-auto > .text-slate-700", - ".text-slate-900 > div:nth-of-type(1) > .text-slate-700", - ".relative > .text-slate-900 > div:nth-of-type(2)", - ".text-slate-900 > div:nth-of-type(2) > .rounded-full", - ".text-slate-900 > div:nth-of-type(2) > .flex-auto", + "div:nth-of-type(5) > div:nth-of-type(1) > .flex-auto > div:nth-of-type(2)", + "div:nth-of-type(5) > div:nth-of-type(1) > .pointer-events-auto", + "div:nth-of-type(4) > div:nth-of-type(5) > div:nth-of-type(2)", + "div:nth-of-type(5) > div:nth-of-type(2) > .rounded-full", + "div:nth-of-type(5) > div:nth-of-type(2) > .flex-auto", "div:nth-of-type(2) > .flex-auto > .font-medium", - "div:nth-of-type(2) > .flex-auto > .text-slate-700", - ".text-slate-900 > div:nth-of-type(2) > .pointer-events-auto", - ".relative > .text-slate-900 > div:nth-of-type(3)", + "div:nth-of-type(5) > div:nth-of-type(2) > .flex-auto > div:nth-of-type(2)", + "div:nth-of-type(5) > div:nth-of-type(2) > .pointer-events-auto", + "div:nth-of-type(4) > div:nth-of-type(5) > div:nth-of-type(3)", "div:nth-of-type(3) > .rounded-full", "div:nth-of-type(3) > .flex-auto", "div:nth-of-type(3) > .flex-auto > .font-medium", - "div:nth-of-type(3) > .flex-auto > .text-slate-700", + "div:nth-of-type(3) > .flex-auto > div:nth-of-type(2)", "div:nth-of-type(3) > .pointer-events-auto", - ".relative > .text-slate-900 > div:nth-of-type(4)", + ".relative > div:nth-of-type(5) > div:nth-of-type(4)", ".text-center", ".origin-top > div:nth-of-type(2)", ".origin-top > div:nth-of-type(2) > .relative", @@ -1594,8 +1604,8 @@ exports[`tailwindcss 1`] = ` "div:nth-of-type(2) > .bottom-full > .flex > div:nth-of-type(1)", "div:nth-of-type(2) > .bottom-full div:nth-of-type(2)", "div > .relative > .items-center", - ".relative > .flex > .stroke-slate-500", - "div:nth-of-type(5) > .stroke-slate-500 > path", + "div:nth-of-type(5) > svg:nth-of-type(1)", + "div:nth-of-type(5) > svg:nth-of-type(1) > path", ".relative > .flex > svg:nth-of-type(2)", "div:nth-of-type(5) > svg:nth-of-type(2) > path", ".relative > .items-center > .flex", @@ -1608,17 +1618,17 @@ exports[`tailwindcss 1`] = ` "svg:nth-of-type(4) > path", ".justify-end > div:nth-of-type(3)", ".justify-end > div:nth-of-type(3) > div", - ".ring-indigo-600", - ".ring-indigo-600 > .flex", - ".ring-indigo-600 > .flex > .font-medium", - ".ring-indigo-600 .flex-none", + ".relative > .relative > div:nth-of-type(1) > div:nth-of-type(1)", + "div:nth-of-type(1) > .justify-between", + "div:nth-of-type(1) > .flex > .font-medium", + "div:nth-of-type(1) > .justify-between > .flex-none", ".justify-between > svg:nth-child(2) > path", - ".ring-indigo-600 > .text-slate-700", - ".ring-indigo-600 > .font-medium", + ".relative > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2)", + ".relative > div:nth-of-type(1) > div:nth-of-type(1) > .font-medium", ".relative > .relative > div:nth-of-type(1) > div:nth-of-type(2)", "div:nth-of-type(2) > .justify-between", "div:nth-of-type(2) > .justify-between > .font-medium", - ".relative > div:nth-of-type(1) > div:nth-of-type(2) > .text-slate-700", + ".relative > .relative > div:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2)", "div:nth-of-type(1) > div:nth-of-type(2) > .font-medium", ".items-start .items-start", ".items-start .items-start > div:nth-of-type(1)", @@ -1627,18 +1637,18 @@ exports[`tailwindcss 1`] = ` ".flex > .relative > .font-medium", ".flex > .relative > .font-medium > div:nth-of-type(1)", ".pointer-events-auto > div:nth-of-type(1) > .flex", - "div:nth-of-type(1) > .flex > .fill-slate-400", - "div:nth-of-type(1) > .flex > .fill-slate-400 > path", - ".font-medium .text-slate-900", + "div:nth-of-type(1) > .flex-none > svg:nth-child(1)", + "div:nth-of-type(1) > .flex-none > svg:nth-child(1) > path", + ".pointer-events-auto > div:nth-of-type(1) > div:nth-of-type(2)", ".flex > .relative > .font-medium > div:nth-of-type(2)", ".font-medium > div:nth-of-type(2) > .flex", - "div:nth-of-type(2) > .flex-none > .fill-slate-400", - "div:nth-of-type(2) > .flex-none > .fill-slate-400 > path", + "div:nth-of-type(2) > .flex-none > svg", + "div:nth-of-type(2) > .flex-none > svg > path", ".font-medium > div:nth-of-type(2) > div:nth-of-type(2)", ".relative > .font-medium > div:nth-of-type(3)", "div:nth-of-type(3) > .justify-center", - "div:nth-of-type(3) > .flex > .fill-slate-400", - "div:nth-of-type(3) > .flex > .fill-slate-400 > path", + "div:nth-of-type(3) > .flex-none > svg", + "div:nth-of-type(3) > .flex-none > svg > path", ".font-medium > div:nth-of-type(3) > div:nth-of-type(2)", ".items-start .items-start > div:nth-of-type(2)", ".items-start .items-start > div:nth-of-type(2) > div:nth-of-type(1)", @@ -1650,9 +1660,9 @@ exports[`tailwindcss 1`] = ` ".items-start > .relative > .absolute div:nth-of-type(2)", ".flex > div:nth-of-type(2) > .pointer-events-auto", ".pointer-events-auto > .font-semibold", - ".text-slate-700 > .justify-between", - ".justify-between > .fill-slate-400", - ".justify-between > .fill-slate-400 > path", + ".relative > .pointer-events-auto > .justify-between", + ".pointer-events-auto > .items-center > .flex-none", + ".justify-between > svg:nth-child(1) > path", ".pointer-events-auto > .overflow-hidden", ".overflow-hidden > .text-white", ".pointer-events-auto > .overflow-hidden > div:nth-of-type(2)", @@ -1661,9 +1671,9 @@ exports[`tailwindcss 1`] = ` ".origin-top > .flex > div:nth-of-type(2)", ".origin-top > .flex > div:nth-of-type(2) > div:nth-of-type(1)", ".items-start > div > .relative > .pointer-events-auto", - ".pointer-events-auto > .text-slate-400", - ".text-slate-400 > .stroke-slate-500", - ".text-slate-400 path", + "div:nth-of-type(1) > .pointer-events-auto > .items-center", + "div:nth-of-type(1) > .pointer-events-auto > .items-center > svg", + "div:nth-of-type(1) > .pointer-events-auto > .items-center path", ".items-start > div > .relative > .pointer-events-auto > div:nth-of-type(2)", ".pointer-events-auto > div > .font-semibold", ".pointer-events-auto > div:nth-of-type(2) > .text-white", @@ -1674,39 +1684,39 @@ exports[`tailwindcss 1`] = ` "div:nth-of-type(2) > div:nth-of-type(3) path", ".flex > div > .relative > .pointer-events-auto > div:nth-of-type(3)", "div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(3) > div:nth-of-type(1)", - "div:nth-of-type(1) > .stroke-slate-400", - "div:nth-of-type(1) > .stroke-slate-400 > path", + ".pointer-events-auto > div > div:nth-of-type(1) > .flex-none", + "div:nth-of-type(3) > div:nth-of-type(1) > .flex-none > path", "div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(3) > div:nth-of-type(2)", - "div:nth-of-type(2) > .stroke-slate-400", - "div:nth-of-type(2) > .stroke-slate-400 > path", + "div:nth-of-type(3) > div:nth-of-type(2) > svg", + "div:nth-of-type(3) > div:nth-of-type(2) > .flex-none > path", "div:nth-of-type(1) > .pointer-events-auto > div:nth-of-type(3) > div:nth-of-type(3)", - "div:nth-of-type(3) > div:nth-of-type(3) > .stroke-slate-400", + "div:nth-of-type(3) > div:nth-of-type(3) > svg", "div:nth-of-type(3) > div:nth-of-type(3) > .flex-none > path", "div:nth-of-type(1) > .pointer-events-auto div:nth-of-type(4)", - "div:nth-of-type(4) > .stroke-slate-400", + "div:nth-of-type(4) > svg", "div:nth-of-type(4) > .flex-none > path", ".origin-top > .flex > div:nth-of-type(2) > div:nth-of-type(2)", ".items-start > div:nth-of-type(2) > div:nth-of-type(2) > div", "div:nth-of-type(2) > div:nth-of-type(1) > .font-semibold", - ".relative > div > .text-slate-500", + "div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(2)", "div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(3)", - "div:nth-of-type(1) > .text-slate-900 > div:nth-of-type(1)", + "div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(1) > div > div:nth-of-type(1)", "div:nth-of-type(1) > span:nth-of-type(1)", "div:nth-of-type(1) > span:nth-of-type(2)", "div:nth-of-type(3) > .flex > .pointer-events-auto", - "div:nth-of-type(1) > .text-slate-900 > div:nth-of-type(2)", - ".text-slate-900 > div:nth-of-type(2) > span:nth-of-type(1)", - ".text-slate-900 > div:nth-of-type(2) > span:nth-of-type(2)", - ".text-slate-900 > .flex > .flex", + "div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(1) > div > div:nth-of-type(2)", + "div:nth-of-type(3) > div:nth-of-type(2) > span:nth-of-type(1)", + "div:nth-of-type(3) > div:nth-of-type(2) > span:nth-of-type(2)", + "div:nth-of-type(3) > .items-center > .flex", ".flex > .font-medium > span:nth-of-type(1)", ".font-medium > span:nth-of-type(2)", ".font-medium > span:nth-of-type(3)", - "div:nth-of-type(1) > .text-slate-900 > div:nth-of-type(3)", + "div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(1) > div > div:nth-of-type(3)", "div:nth-of-type(3) > span:nth-of-type(1)", "div:nth-of-type(3) > span:nth-of-type(2)", "div:nth-of-type(3) > span > .pointer-events-auto", "div:nth-of-type(3) > span > .pointer-events-auto > .rounded-full", - "div:nth-of-type(1) > .text-slate-900 > div:nth-of-type(4)", + "div:nth-of-type(2) > div:nth-of-type(1) > div > div:nth-of-type(4)", "div:nth-of-type(4) > span:nth-of-type(1)", "div:nth-of-type(4) > span:nth-of-type(2)", "div:nth-of-type(4) > span > .pointer-events-auto", @@ -1714,21 +1724,21 @@ exports[`tailwindcss 1`] = ` "section:nth-of-type(1)", "section:nth-of-type(1) > div:nth-of-type(1)", "section > div > h2", - "section > div > .text-4xl", + "section > div > .font-extrabold", "section > div:nth-of-type(2)", - "section > div > .text-slate-700", + "section > div:nth-of-type(2) > p", "section > div:nth-of-type(3)", - "div:nth-of-type(3) > .text-indigo-600", - "div:nth-of-type(3) > .text-indigo-600 > span", + "section > div > .text-base", + "section > div > .text-base > span", "section > button", "section > div:nth-of-type(4)", "[role="tablist"]", "[role="tablist"] > div:nth-of-type(1)", - ".border-indigo-500", - ".border-indigo-500 > h3", - "h3 > .text-indigo-600", - ".text-indigo-600 > .absolute", - ".border-indigo-500 > .hidden", + ".flex > div:nth-of-type(1) > .text-left", + ".flex > div:nth-of-type(1) > .relative > h3", + "h3 > [data-headlessui-state="selected"]", + "[data-headlessui-state="selected"] > .absolute", + ".flex > div:nth-of-type(1) > .relative > .hidden", "[role="tablist"] > div:nth-of-type(2)", "[role="tablist"] > div:nth-of-type(3)", "div:nth-of-type(3) > .text-left", @@ -1745,99 +1755,99 @@ exports[`tailwindcss 1`] = ` "div:nth-of-type(5) .hidden", "section:nth-of-type(1) > div > div:nth-of-type(2)", "div > [data-headlessui-state="selected"]", - "[role="tabpanel"] > .text-slate-700", + "[role="tabpanel"] > p", "[role="tabpanel"] > div:nth-of-type(1)", "[role="tabpanel"] .grid", ".grid > li:nth-of-type(1)", "li:nth-of-type(1) > .group", "li:nth-of-type(1) .overflow-hidden", "li:nth-of-type(1) .relative > .absolute", - "li:nth-of-type(1) .text-slate-900", + "li:nth-of-type(1) h4", "li:nth-of-type(1) > .group a", "li:nth-of-type(1) .font-medium .absolute", "li:nth-of-type(1) .font-medium .relative", - "li:nth-of-type(1) .text-slate-500", + "li:nth-of-type(1) p", ".grid > li:nth-of-type(2)", "li:nth-of-type(2) > .group", "li:nth-of-type(2) .overflow-hidden", "li:nth-of-type(2) .relative > .absolute", - "li:nth-of-type(2) .text-slate-900", + "li:nth-of-type(2) h4", "li:nth-of-type(2) > .group a", "li:nth-of-type(2) .font-medium .absolute", "li:nth-of-type(2) .font-medium .relative", - "li:nth-of-type(2) .text-slate-500", + "li:nth-of-type(2) p", ".grid > li:nth-of-type(3)", "li:nth-of-type(3) > .group", "li:nth-of-type(3) .overflow-hidden", "li:nth-of-type(3) .relative > .absolute", - "li:nth-of-type(3) .text-slate-900", + "li:nth-of-type(3) h4", "li:nth-of-type(3) > .group a", "li:nth-of-type(3) .font-medium .absolute", "li:nth-of-type(3) .font-medium .relative", - "li:nth-of-type(3) .text-slate-500", + "li:nth-of-type(3) p", ".grid > li:nth-of-type(4)", "li:nth-of-type(4) > .group", "li:nth-of-type(4) .overflow-hidden", "li:nth-of-type(4) .relative > .absolute", - "li:nth-of-type(4) .text-slate-900", + "li:nth-of-type(4) h4", "li:nth-of-type(4) > .group a", "li:nth-of-type(4) .font-medium .absolute", "li:nth-of-type(4) .font-medium .relative", - "li:nth-of-type(4) .text-slate-500", + "li:nth-of-type(4) p", ".grid > li:nth-of-type(5)", "li:nth-of-type(5) > .group", "li:nth-of-type(5) .overflow-hidden", "li:nth-of-type(5) .relative > .absolute", - "li:nth-of-type(5) .text-slate-900", + "li:nth-of-type(5) h4", "li:nth-of-type(5) > .group a", "li:nth-of-type(5) .font-medium .absolute", "li:nth-of-type(5) .font-medium .relative", - "li:nth-of-type(5) .text-slate-500", + "li:nth-of-type(5) p", ".grid > li:nth-of-type(6)", "li:nth-of-type(6) > .group", "li:nth-of-type(6) .overflow-hidden", "li:nth-of-type(6) .relative > .absolute", - "li:nth-of-type(6) .text-slate-900", + "li:nth-of-type(6) h4", "li:nth-of-type(6) > .group a", "li:nth-of-type(6) .font-medium .absolute", "li:nth-of-type(6) .font-medium .relative", - "li:nth-of-type(6) .text-slate-500", + "li:nth-of-type(6) p", ".grid > li:nth-of-type(7)", "li:nth-of-type(7) > .group", "li:nth-of-type(7) .overflow-hidden", "li:nth-of-type(7) .relative > .absolute", - "li:nth-of-type(7) .text-slate-900", + "li:nth-of-type(7) h4", "li:nth-of-type(7) > .group a", "li:nth-of-type(7) .font-medium .absolute", "li:nth-of-type(7) .font-medium .relative", - "li:nth-of-type(7) .text-slate-500", + "li:nth-of-type(7) p", ".grid > li:nth-of-type(8)", "li:nth-of-type(8) > .group", "li:nth-of-type(8) .overflow-hidden", "li:nth-of-type(8) .relative > .absolute", - "li:nth-of-type(8) .text-slate-900", + "li:nth-of-type(8) h4", "li:nth-of-type(8) > .group a", "li:nth-of-type(8) .font-medium .absolute", "li:nth-of-type(8) .font-medium .relative", - "li:nth-of-type(8) .text-slate-500", + "li:nth-of-type(8) p", ".grid > li:nth-of-type(9)", "li:nth-of-type(9) > .group", "li:nth-of-type(9) .overflow-hidden", "li:nth-of-type(9) .relative > .absolute", - "li:nth-of-type(9) .text-slate-900", + "li:nth-of-type(9) h4", "li:nth-of-type(9) > .group a", "li:nth-of-type(9) .font-medium .absolute", "li:nth-of-type(9) .font-medium .relative", - "li:nth-of-type(9) .text-slate-500", + "li:nth-of-type(9) p", ".grid > li:nth-of-type(10)", "li:nth-of-type(10) > .group", "li:nth-of-type(10) .overflow-hidden", "li:nth-of-type(10) .relative > .absolute", - "li:nth-of-type(10) .text-slate-900", + "li:nth-of-type(10) h4", "li:nth-of-type(10) > .group a", "li:nth-of-type(10) .font-medium .absolute", "li:nth-of-type(10) .font-medium .relative", - "li:nth-of-type(10) .text-slate-500", + "li:nth-of-type(10) p", ".from-white", "[role="tabpanel"] > .pointer-events-none", ".pointer-events-none > .inline-flex", @@ -1849,195 +1859,195 @@ exports[`tailwindcss 1`] = ` "section:nth-of-type(2) > div", "section:nth-of-type(2) > div > div:nth-of-type(1)", "div > div > h2", - "div:nth-child(1) > div > .text-4xl", + "div:nth-child(1) > div > .font-extrabold", "section:nth-of-type(2) > div > div:nth-of-type(2)", "div:nth-of-type(1) > div > p:nth-child(1)", "section > div > div:nth-of-type(3)", - "div:nth-of-type(3) > .text-sky-500", - ".text-sky-500 > span", + "div > div > .text-base", + "div > div > .text-base > span", ".overflow-hidden > div > div:nth-of-type(4)", "div:nth-of-type(1) > div:nth-of-type(4) > .flex-none", ".flex-none > .flex", - ".border-blue-500", - ".border-blue-500 > h3", - ".text-blue-600", - ".text-blue-600 > .absolute", - ".border-blue-500 > .text-slate-600", - ".border-blue-500 > .hidden", + ".flex-none > .flex > div:nth-of-type(1)", + ".flex > div:nth-of-type(1) > h3", + ".flex > div:nth-of-type(1) > h3 > .font-semibold", + ".flex > div:nth-of-type(1) > h3 .absolute", + ".flex > div:nth-of-type(1) > p:nth-child(2)", + ".flex > div:nth-of-type(1) > .hidden", ".flex-none > .flex > div:nth-of-type(2)", ".flex > div:nth-of-type(2) > h3", "div:nth-of-type(2) > h3 > .font-semibold", "div:nth-of-type(2) .font-semibold > .absolute", - ".flex > div:nth-of-type(2) > .text-slate-600", + "div:nth-of-type(2) > p:nth-child(2)", "div:nth-of-type(2) > .hidden", ".flex-none div:nth-of-type(3)", ".flex > div:nth-of-type(3) > h3", "div:nth-of-type(3) > h3 > .font-semibold", "div:nth-of-type(3) > h3 .absolute", - "div:nth-of-type(3) > .text-slate-600", + "div:nth-of-type(1) > div:nth-of-type(3) > p:nth-of-type(1)", "div:nth-of-type(3) > .hidden", ".flex-none div:nth-of-type(4)", ".flex > div:nth-of-type(4) > h3", "div:nth-of-type(4) > h3 > .font-semibold", "div:nth-of-type(4) > h3 .absolute", - "div:nth-of-type(4) > .text-slate-600", + "div:nth-of-type(1) > div:nth-of-type(4) > p:nth-of-type(1)", "div:nth-of-type(4) > .hidden", ".transition-transform", ".transition-transform > div:nth-of-type(1)", - ".transition-transform > div:nth-of-type(1) > .text-slate-700", + ".transition-transform > div:nth-of-type(1) > p", ".flex > div:nth-of-type(1) > img", ".transition-transform > div:nth-of-type(2)", - ".transition-transform > div:nth-of-type(2) > .text-slate-700", + ".transition-transform > div:nth-of-type(2) > p", ".flex > div:nth-of-type(2) > img", ".transition-transform > div:nth-of-type(3)", - ".transition-transform > div:nth-of-type(3) > .text-slate-700", + ".transition-transform > div:nth-of-type(3) > p", ".flex > div:nth-of-type(3) > img", ".transition-transform > div:nth-of-type(4)", - ".transition-transform > div:nth-of-type(4) > .text-slate-700", + ".transition-transform > div:nth-of-type(4) > p", "div:nth-of-type(4) > img", "footer", "#footer-heading", "footer > div:nth-of-type(1)", "footer svg", - ".text-slate-900 > .fill-sky-400", - ".text-slate-900 > path:nth-of-type(2)", - ".text-slate-900 > path:nth-of-type(3)", - "div > .text-gray-600", - ".text-gray-600 > .whitespace-nowrap", + "footer path:nth-of-type(1)", + "div:nth-child(2) > svg:nth-child(1) > path:nth-of-type(2)", + "div:nth-child(2) > svg > path:nth-of-type(3)", + "footer > div:nth-of-type(1) > p", + "p > .whitespace-nowrap", "hr", "footer > div > .grid", "footer > div > .grid > div:nth-of-type(1)", - "div:nth-of-type(1) > .text-gray-900", + ".grid > div:nth-of-type(1) > .font-semibold", "div:nth-of-type(1) > [role="list"]", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(1)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(1) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(1) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(2)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(2) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(2) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(3)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(3) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(3) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(4)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(4) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(4) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(5)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(5) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(5) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(6)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(6) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(6) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(7)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(7) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(7) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(8)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(8) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(8) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(9)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(9) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(9) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(10)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(10) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(10) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(11)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(11) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(11) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(12)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(12) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(12) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(13)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(13) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(13) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(14)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(14) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(14) > a", "div:nth-of-type(1) > [role="list"] > li:nth-of-type(15)", - "div:nth-of-type(1) > [role="list"] > li:nth-of-type(15) > .text-gray-600", + "div:nth-of-type(1) > [role="list"] > li:nth-of-type(15) > a", "div:nth-of-type(1) > [role="list"] span", "div > .grid > div:nth-child(2)", - "div:nth-of-type(2) > .text-gray-900", + ".grid > div:nth-of-type(2) > h3", "div:nth-of-type(2) > [role="list"]", "div:nth-of-type(2) > [role="list"] > li:nth-of-type(1)", - "div:nth-of-type(2) li:nth-of-type(1) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(1) > a", "div:nth-of-type(2) > [role="list"] > li:nth-of-type(2)", - "div:nth-of-type(2) li:nth-of-type(2) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(2) > a", "div:nth-of-type(2) > [role="list"] > li:nth-of-type(3)", - "div:nth-of-type(2) li:nth-of-type(3) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(3) > a", "div:nth-of-type(2) > [role="list"] > li:nth-of-type(4)", - "div:nth-of-type(2) li:nth-of-type(4) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(4) > a", "div:nth-of-type(2) > [role="list"] > li:nth-of-type(5)", - "div:nth-of-type(2) li:nth-of-type(5) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(5) > a", "div:nth-of-type(2) > [role="list"] > li:nth-of-type(6)", - "div:nth-of-type(2) li:nth-of-type(6) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(6) > a", "div:nth-of-type(2) > [role="list"] > li:nth-of-type(7)", - "div:nth-of-type(2) li:nth-of-type(7) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(7) > a", "div:nth-of-type(2) > [role="list"] > li:nth-of-type(8)", - "div:nth-of-type(2) li:nth-of-type(8) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(8) > a", "div:nth-of-type(2) > [role="list"] > li:nth-of-type(9)", - "div:nth-of-type(2) li:nth-of-type(9) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(9) > a", "div:nth-of-type(2) > [role="list"] > li:nth-of-type(10)", - "div:nth-of-type(2) li:nth-of-type(10) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(10) > a", "div:nth-of-type(2) li:nth-of-type(11)", - "div:nth-of-type(2) li:nth-of-type(11) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(11) > a", "div:nth-of-type(2) li:nth-of-type(12)", - "div:nth-of-type(2) li:nth-of-type(12) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(12) > a", "div:nth-of-type(2) li:nth-of-type(13)", - "div:nth-of-type(2) li:nth-of-type(13) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(13) > a", "div:nth-of-type(2) li:nth-of-type(14)", - "div:nth-of-type(2) li:nth-of-type(14) > .text-gray-600", + "div:nth-of-type(2) li:nth-of-type(14) > a", "div:nth-of-type(2) li:nth-of-type(15)", - "div:nth-of-type(2) li:nth-of-type(15) > .text-gray-600", - "div:nth-of-type(2) .text-gray-600 > span", + "div:nth-of-type(2) li:nth-of-type(15) > a", + "div:nth-of-type(2) > [role="list"] span", ".grid > div:nth-child(3)", - "div:nth-of-type(3) > .text-gray-900", + ".grid > div:nth-of-type(3) > .font-semibold", "div:nth-of-type(3) > [role="list"]", "div:nth-of-type(3) li:nth-of-type(1)", - "div:nth-of-type(3) li:nth-of-type(1) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(1) > a", "div:nth-of-type(3) li:nth-of-type(2)", - "div:nth-of-type(3) li:nth-of-type(2) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(2) > a", "div:nth-of-type(3) li:nth-of-type(3)", - "div:nth-of-type(3) li:nth-of-type(3) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(3) > a", "div:nth-of-type(3) li:nth-of-type(4)", - "div:nth-of-type(3) li:nth-of-type(4) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(4) > a", "div:nth-of-type(3) li:nth-of-type(5)", - "div:nth-of-type(3) li:nth-of-type(5) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(5) > a", "div:nth-of-type(3) li:nth-of-type(6)", - "div:nth-of-type(3) li:nth-of-type(6) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(6) > a", "div:nth-of-type(3) li:nth-of-type(7)", - "div:nth-of-type(3) li:nth-of-type(7) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(7) > a", "div:nth-of-type(3) li:nth-of-type(8)", - "div:nth-of-type(3) li:nth-of-type(8) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(8) > a", "div:nth-of-type(3) li:nth-of-type(9)", - "div:nth-of-type(3) li:nth-of-type(9) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(9) > a", "div:nth-of-type(3) li:nth-of-type(10)", - "div:nth-of-type(3) li:nth-of-type(10) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(10) > a", "div:nth-of-type(3) li:nth-of-type(11)", - "div:nth-of-type(3) li:nth-of-type(11) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(11) > a", "div:nth-of-type(3) li:nth-of-type(12)", - "div:nth-of-type(3) li:nth-of-type(12) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(12) > a", "div:nth-of-type(3) li:nth-of-type(13)", - "div:nth-of-type(3) li:nth-of-type(13) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(13) > a", "div:nth-of-type(3) li:nth-of-type(14)", - "div:nth-of-type(3) li:nth-of-type(14) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(14) > a", "div:nth-of-type(3) li:nth-of-type(15)", - "div:nth-of-type(3) li:nth-of-type(15) > .text-gray-600", + "div:nth-of-type(3) li:nth-of-type(15) > a", "div:nth-of-type(3) .group span", ".grid > div:nth-of-type(4)", "div:nth-of-type(4) > .font-semibold", "div:nth-of-type(4) > [role="list"]", "div:nth-of-type(4) > [role="list"] > li:nth-of-type(1)", - "div:nth-of-type(4) li:nth-of-type(1) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(1) > a", "div:nth-of-type(4) > [role="list"] > li:nth-of-type(2)", - "div:nth-of-type(4) li:nth-of-type(2) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(2) > a", "div:nth-of-type(4) > [role="list"] > li:nth-of-type(3)", - "div:nth-of-type(4) li:nth-of-type(3) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(3) > a", "div:nth-of-type(4) > [role="list"] > li:nth-of-type(4)", - "div:nth-of-type(4) li:nth-of-type(4) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(4) > a", "div:nth-of-type(4) > [role="list"] > li:nth-of-type(5)", - "div:nth-of-type(4) li:nth-of-type(5) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(5) > a", "div:nth-of-type(4) > [role="list"] > li:nth-of-type(6)", - "div:nth-of-type(4) li:nth-of-type(6) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(6) > a", "div:nth-of-type(4) > [role="list"] > li:nth-of-type(7)", - "div:nth-of-type(4) li:nth-of-type(7) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(7) > a", "div:nth-of-type(4) > [role="list"] > li:nth-of-type(8)", - "div:nth-of-type(4) li:nth-of-type(8) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(8) > a", "div:nth-of-type(4) > [role="list"] > li:nth-of-type(9)", - "div:nth-of-type(4) li:nth-of-type(9) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(9) > a", "div:nth-of-type(4) > [role="list"] > li:nth-of-type(10)", - "div:nth-of-type(4) li:nth-of-type(10) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(10) > a", "div:nth-of-type(4) li:nth-of-type(11)", - "div:nth-of-type(4) li:nth-of-type(11) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(11) > a", "div:nth-of-type(4) li:nth-of-type(12)", - "div:nth-of-type(4) li:nth-of-type(12) > .text-gray-600", + "div:nth-of-type(4) li:nth-of-type(12) > a", "li:nth-of-type(12) span", ".items-centers", - ".items-centers > .text-slate-600", + ".items-centers > p", ".items-centers > .flex", ".font-semibold > a:nth-of-type(1)", ".justify-center > div", diff --git a/tests/finder.test.js b/tests/finder.test.js index 3babbaa..7e72033 100644 --- a/tests/finder.test.js +++ b/tests/finder.test.js @@ -86,3 +86,12 @@ test('duplicate:sub-nodes', () => { ` check({ html }) }) + + +test('bad-class-names', () => { + const html = ` +
+
+ ` + check({ html }) +})