Skip to content

Commit fb32ef6

Browse files
committed
chore: add html-eslint and fix lint errors
1 parent 427f24d commit fb32ef6

File tree

9 files changed

+96
-11
lines changed

9 files changed

+96
-11
lines changed

.eslintrc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@
22
"root": true,
33
"extends": "next/core-web-vitals",
44
"parser": "@typescript-eslint/parser",
5-
"plugins": ["@typescript-eslint", "eslint-plugin-react-compiler", "local-rules"],
5+
"plugins": [
6+
"@typescript-eslint",
7+
"eslint-plugin-react-compiler",
8+
"local-rules",
9+
"@html-eslint/eslint-plugin-react"
10+
],
611
"rules": {
712
"no-unused-vars": "off",
813
"@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}],
914
"react-hooks/exhaustive-deps": "error",
1015
"react/no-unknown-property": ["error", {"ignore": ["meta"]}],
1116
"react-compiler/react-compiler": "error",
12-
"local-rules/lint-markdown-code-blocks": "error"
17+
"local-rules/lint-markdown-code-blocks": "error",
18+
"@html-eslint/react/no-duplicate-classname": ["error", {"callees": ["cn"]}],
19+
"@html-eslint/react/classname-spacing": ["error", {"callees": ["cn"]}]
1320
},
1421
"env": {
1522
"node": true,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"@babel/core": "^7.12.9",
5151
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
5252
"@babel/preset-react": "^7.18.6",
53+
"@html-eslint/eslint-plugin-react": "^0.58.1",
5354
"@mdx-js/mdx": "^2.1.3",
5455
"@types/body-scroll-lock": "^2.6.1",
5556
"@types/classnames": "^2.2.10",

src/components/Layout/HomeContent.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function Section({children, background = null}) {
4343
'mx-auto flex flex-col w-full',
4444
background === null && 'max-w-7xl',
4545
background === 'left-card' &&
46-
'bg-gradient-left dark:bg-gradient-left-dark border-t border-primary/10 dark:border-primary-dark/10 ',
46+
'bg-gradient-left dark:bg-gradient-left-dark border-t border-primary/10 dark:border-primary-dark/10',
4747
background === 'right-card' &&
4848
'bg-gradient-right dark:bg-gradient-right-dark border-t border-primary/5 dark:border-primary-dark/5'
4949
)}
@@ -793,7 +793,7 @@ const CommunityImages = memo(function CommunityImages({isLazy}) {
793793
)}>
794794
<div
795795
className={cn(
796-
'h-auto rounded-2xl before:rounded-2xl before:absolute before:pointer-events-none before:inset-0 before:transition-opacity before:-z-1 before:shadow-lg lg:before:shadow-2xl before:opacity-0 before:group-hover:opacity-100 transition-transform ease-in-out duration-300',
796+
'h-auto rounded-2xl before:rounded-2xl before:absolute before:pointer-events-none before:inset-0 before:transition-opacity before:-z-1 before:shadow-lg lg:before:shadow-2xl before:opacity-0 before:group-hover:opacity-100 transition-transform ease-in-out duration-300',
797797
i % 2 === 0
798798
? 'rotate-2 group-hover:rotate-[-1deg] group-hover:scale-110'
799799
: 'group-hover:rotate-1 group-hover:scale-110 rotate-[-2deg]'
@@ -1325,7 +1325,7 @@ function BrowserChrome({children, hasPulse, hasRefresh, domain, path}) {
13251325
<div
13261326
ref={refreshRef}
13271327
className={cn(
1328-
'relative rounded-full flex justify-center items-center ',
1328+
'relative rounded-full flex justify-center items-center',
13291329
isPulsing && shouldAnimatePulse && 'animation-pulse-button'
13301330
)}>
13311331
{isPulsing && shouldAnimatePulse && (

src/components/Layout/TopNav/TopNav.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ export default function TopNav({
303303
<div className="flex flex-column justify-center items-center">
304304
<NextLink
305305
href="/versions"
306-
className=" flex py-2 flex-column justify-center items-center text-gray-50 dark:text-gray-30 hover:text-link hover:dark:text-link-dark hover:underline text-sm ms-1 cursor-pointer">
306+
className="flex py-2 flex-column justify-center items-center text-gray-50 dark:text-gray-30 hover:text-link hover:dark:text-link-dark hover:underline text-sm ms-1 cursor-pointer">
307307
v{siteConfig.version}
308308
</NextLink>
309309
</div>
@@ -344,7 +344,7 @@ export default function TopNav({
344344
</NavItem>
345345
</div>
346346
<div className="flex w-full md:hidden"></div>
347-
<div className="flex items-center -space-x-2.5 xs:space-x-0 ">
347+
<div className="flex items-center -space-x-2.5 xs:space-x-0">
348348
<div className="flex md:hidden">
349349
<button
350350
aria-label="Search"

src/components/MDX/BlogCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function BlogCard({title, badge, date, icon, url, children}: BlogCardProps) {
2727
href={url as string}
2828
passHref
2929
className="block h-full w-full rounded-2xl outline-none focus:outline-none focus-visible:outline focus-visible:outline-link focus:outline-offset-2 focus-visible:dark:focus:outline-link-dark">
30-
<div className="justify-between p-5 sm:p-5 cursor-pointer w-full h-full flex flex-col flex-1 shadow-secondary-button-stroke dark:shadow-secondary-button-stroke-dark hover:bg-gray-40/5 active:bg-gray-40/10 hover:dark:bg-gray-60/5 active:dark:bg-gray-60/10 rounded-2xl text-xl text-primary dark:text-primary-dark leading-relaxed">
30+
<div className="justify-between p-5 sm:p-5 cursor-pointer w-full h-full flex flex-col flex-1 shadow-secondary-button-stroke dark:shadow-secondary-button-stroke-dark hover:bg-gray-40/5 active:bg-gray-40/10 hover:dark:bg-gray-60/5 active:dark:bg-gray-60/10 rounded-2xl text-xl text-primary dark:text-primary-dark leading-relaxed">
3131
<div className="flex flex-row gap-3 w-full">
3232
<h2 className="font-semibold flex-1 text-2xl lg:text-3xl hover:underline leading-snug mb-4">
3333
{title}

src/components/MDX/CodeBlock/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default memo(function CodeBlockWrapper(props: {
3737
'rounded-lg leading-6 h-full w-full overflow-x-auto flex items-center bg-wash dark:bg-gray-95 shadow-lg text-[13.6px] overflow-hidden',
3838
!isFromPackageImport && 'my-8'
3939
)}>
40-
<div className="py-[18px] ps-5 font-normal ">
40+
<div className="py-[18px] ps-5 font-normal">
4141
<p className="sp-pre-placeholder overflow-hidden">{children}</p>
4242
</div>
4343
</pre>

src/components/MDX/Sandpack/Preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export function Preview({
210210
'z-50',
211211
// This isn't absolutely positioned so that
212212
// the errors can also expand the parent height.
213-
isExpanded ? 'sticky top-8 ' : null
213+
isExpanded ? 'sticky top-8' : null
214214
)}>
215215
<ErrorMessage error={error} />
216216
</div>

src/components/MDX/TerminalBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function TerminalBlock({level = 'info', children}: TerminalBlockProps) {
6868
</div>
6969
<div>
7070
<button
71-
className="w-full text-start text-primary-dark dark:text-primary-dark "
71+
className="w-full text-start text-primary-dark dark:text-primary-dark"
7272
onClick={() => {
7373
window.navigator.clipboard.writeText(message ?? '');
7474
setCopied(true);

yarn.lock

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,30 @@
10841084
resolved "https://registry.npmjs.org/@headlessui/react/-/react-1.7.0.tgz"
10851085
integrity sha512-/nDsijOXRwXVLpUBEiYuWguIBSIN3ZbKyah+KPUiD8bdIKtX1U/k+qLYUEr7NCQnSF2e4w1dr8me42ECuG3cvw==
10861086

1087+
"@html-eslint/core@^0.58.1":
1088+
version "0.58.1"
1089+
resolved "https://registry.yarnpkg.com/@html-eslint/core/-/core-0.58.1.tgz#f503041ae13333caf3946aff0bbd7de2b1a7f940"
1090+
integrity sha512-GHYDt2Q3ws9aa0/bmMhkv21ExQJnrjKY/iByjdBVp3lBq49wlzIzvAfcx4Bsp+RMV3oPZhzlnLhPpXLuVYt2mQ==
1091+
dependencies:
1092+
"@html-eslint/types" "^0.58.1"
1093+
html-standard "^0.0.13"
1094+
1095+
"@html-eslint/eslint-plugin-react@^0.58.1":
1096+
version "0.58.1"
1097+
resolved "https://registry.yarnpkg.com/@html-eslint/eslint-plugin-react/-/eslint-plugin-react-0.58.1.tgz#2eb7ed8e547b7b104f1fdb883c1e27a03bdffde8"
1098+
integrity sha512-Oyywt21Y0sNnZXylW9gcsryNZVjSZliROANbho3i5iqwyE7Zw9NlxiQmY9/EgkqNRB3Uqr2xyVVQpHheJj0aMA==
1099+
dependencies:
1100+
"@html-eslint/core" "^0.58.1"
1101+
1102+
"@html-eslint/types@^0.58.1":
1103+
version "0.58.1"
1104+
resolved "https://registry.yarnpkg.com/@html-eslint/types/-/types-0.58.1.tgz#98a4418ad5ed8fec0e29a0c337c6a2d9d4f10661"
1105+
integrity sha512-1F2A5XXpgfHQ8dm14E/EztyERoVldT91VGMZCJECZpidf5Cbc21vxeHLT6/POTJm0ICJOmyBlocF62i/rkoVEQ==
1106+
dependencies:
1107+
"@types/css-tree" "^2.3.11"
1108+
"@types/estree" "^1.0.6"
1109+
es-html-parser "0.3.1"
1110+
10871111
"@humanwhocodes/config-array@^0.5.0":
10881112
version "0.5.0"
10891113
resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz"
@@ -1728,6 +1752,11 @@
17281752
dependencies:
17291753
classnames "*"
17301754

1755+
"@types/css-tree@^2.3.11":
1756+
version "2.3.11"
1757+
resolved "https://registry.yarnpkg.com/@types/css-tree/-/css-tree-2.3.11.tgz#c9457a54fe8ea02d2d72ddc864c1b9c5625f10d0"
1758+
integrity sha512-aEokibJOI77uIlqoBOkVbaQGC9zII0A+JH1kcTNKW2CwyYWD8KM6qdo+4c77wD3wZOQfJuNWAr9M4hdk+YhDIg==
1759+
17311760
"@types/debounce@^1.2.1":
17321761
version "1.2.1"
17331762
resolved "https://registry.npmjs.org/@types/debounce/-/debounce-1.2.1.tgz"
@@ -1752,6 +1781,11 @@
17521781
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz"
17531782
integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==
17541783

1784+
"@types/estree@^1.0.6":
1785+
version "1.0.8"
1786+
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e"
1787+
integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==
1788+
17551789
"@types/github-slugger@^1.3.0":
17561790
version "1.3.0"
17571791
resolved "https://registry.npmjs.org/@types/github-slugger/-/github-slugger-1.3.0.tgz"
@@ -1979,6 +2013,11 @@
19792013
"@typescript-eslint/types" "5.36.2"
19802014
eslint-visitor-keys "^3.3.0"
19812015

2016+
"@vscode/l10n@^0.0.18":
2017+
version "0.0.18"
2018+
resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.18.tgz#916d3a5e960dbab47c1c56f58a7cb5087b135c95"
2019+
integrity sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==
2020+
19822021
absolute-path@^0.0.0:
19832022
version "0.0.0"
19842023
resolved "https://registry.npmjs.org/absolute-path/-/absolute-path-0.0.0.tgz"
@@ -3295,6 +3334,11 @@ es-get-iterator@^1.1.3:
32953334
isarray "^2.0.5"
32963335
stop-iteration-iterator "^1.0.0"
32973336

3337+
es-html-parser@0.3.1:
3338+
version "0.3.1"
3339+
resolved "https://registry.yarnpkg.com/es-html-parser/-/es-html-parser-0.3.1.tgz#268098fd701749f97e0b81b4615c8ecae8311388"
3340+
integrity sha512-YTEasG4xt7FEN4b6qJIPbFo/fzQ5kjRMEQ33QMqSXTvfXqAbC2rHxo32x2/1Rhq7Mlu6wI3MIpM5Kf2VHPXrUQ==
3341+
32983342
es-iterator-helpers@^1.0.19:
32993343
version "1.0.19"
33003344
resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz#117003d0e5fec237b4b5c08aded722e0c6d50ca8"
@@ -4421,6 +4465,14 @@ hosted-git-info@^2.1.4:
44214465
resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz"
44224466
integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==
44234467

4468+
html-standard@^0.0.13:
4469+
version "0.0.13"
4470+
resolved "https://registry.yarnpkg.com/html-standard/-/html-standard-0.0.13.tgz#c39742ea94fd3c6e729fd220db470ebe41d7af89"
4471+
integrity sha512-6oNfW3c1t44O7jVXu0tp4E5MbHifWlXrHlZBPt6y7vFdgLOUUh8hyzoRhfUgozlBUK6oLLYhqP1uIqbZ8ggcBA==
4472+
dependencies:
4473+
vscode-css-languageservice "^6.3.9"
4474+
vscode-languageserver-textdocument "^1.0.12"
4475+
44244476
html-void-elements@^1.0.0:
44254477
version "1.0.5"
44264478
resolved "https://registry.npmjs.org/html-void-elements/-/html-void-elements-1.0.5.tgz"
@@ -8563,6 +8615,31 @@ vfile@^5.0.0:
85638615
unist-util-stringify-position "^3.0.0"
85648616
vfile-message "^3.0.0"
85658617

8618+
vscode-css-languageservice@^6.3.9:
8619+
version "6.3.10"
8620+
resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.3.10.tgz#242365ac3ff2eb69f77ca7503a4e694135180302"
8621+
integrity sha512-eq5N9Er3fC4vA9zd9EFhyBG90wtCCuXgRSpAndaOgXMh1Wgep5lBgRIeDgjZBW9pa+332yC9+49cZMW8jcL3MA==
8622+
dependencies:
8623+
"@vscode/l10n" "^0.0.18"
8624+
vscode-languageserver-textdocument "^1.0.12"
8625+
vscode-languageserver-types "3.17.5"
8626+
vscode-uri "^3.1.0"
8627+
8628+
vscode-languageserver-textdocument@^1.0.12:
8629+
version "1.0.12"
8630+
resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz#457ee04271ab38998a093c68c2342f53f6e4a631"
8631+
integrity sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==
8632+
8633+
vscode-languageserver-types@3.17.5:
8634+
version "3.17.5"
8635+
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz#3273676f0cf2eab40b3f44d085acbb7f08a39d8a"
8636+
integrity sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==
8637+
8638+
vscode-uri@^3.1.0:
8639+
version "3.1.0"
8640+
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.1.0.tgz#dd09ec5a66a38b5c3fffc774015713496d14e09c"
8641+
integrity sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==
8642+
85668643
w3c-keyname@^2.2.4:
85678644
version "2.2.4"
85688645
resolved "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.4.tgz"

0 commit comments

Comments
 (0)