mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-02 11:47:23 +02:00
2 lines
No EOL
5.3 KiB
JavaScript
2 lines
No EOL
5.3 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[87472],{59273:(e,t,n)=>{n.d(t,{A:()=>a});var s=n(62540),r=n(63696),i=n(52711),l=n(49519);let o=r.forwardRef(function({name:e,children:t},n){let o=function(e){let t=e;for(;(0,r.isValidElement)(t);)[t]=r.Children.toArray(t.props.children);if("string"!=typeof t)throw Error(`Could not extract APITable row name from JSX tree:
|
|
${JSON.stringify(e,null,2)}`);return t}(t),a=e?`${e}-${o}`:o,c=`#${a}`,d=(0,l.W6)();return(0,i.A)().collectAnchor(a),(0,s.jsx)("tr",{id:a,tabIndex:0,ref:d.location.hash===c?n:void 0,onClick:e=>{"A"!==e.target.tagName.toUpperCase()&&d.push(c)},onKeyDown:e=>{"Enter"===e.key&&d.push(c)},children:t.props.children})});function a({children:e,name:t}){if("table"!==e.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[n,i]=r.Children.toArray(e.props.children),l=(0,r.useRef)(null);(0,r.useEffect)(()=>{var e;null===(e=l.current)||void 0===e||e.focus()},[l]);let a=r.Children.map(i.props.children,e=>(0,s.jsx)(o,{name:t,ref:l,children:e}));return(0,s.jsxs)("table",{className:"apiTable_e8hp",children:[n,(0,s.jsx)("tbody",{children:a})]})}},11844:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>s,toc:()=>d});let s=JSON.parse('{"id":"api/misc/eslint-plugin/no-html-links","title":"no-html-links","description":"Ensure that the Docusaurus ` component is used instead of ` tags.","source":"@site/docs/api/misc/eslint-plugin/no-html-links.mdx","sourceDirName":"api/misc/eslint-plugin","slug":"/api/misc/@docusaurus/eslint-plugin/no-html-links","permalink":"/docs/api/misc/@docusaurus/eslint-plugin/no-html-links","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/misc/eslint-plugin/no-html-links.mdx","tags":[],"version":"current","lastUpdatedBy":"dependabot[bot]","lastUpdatedAt":1726738176000,"frontMatter":{"slug":"/api/misc/@docusaurus/eslint-plugin/no-html-links"},"sidebar":"api","previous":{"title":"\u{1F4E6} eslint-plugin","permalink":"/docs/api/misc/@docusaurus/eslint-plugin"},"next":{"title":"no-untranslated-text","permalink":"/docs/api/misc/@docusaurus/eslint-plugin/no-untranslated-text"}}');var r=n(62540),i=n(43023),l=n(59273);let o={slug:"/api/misc/@docusaurus/eslint-plugin/no-html-links"},a="no-html-links",c={},d=[{value:"Rule Details",id:"details",level:2},{value:"Rule Configuration",id:"configuration",level:2}];function u(e){let t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"no-html-links",children:"no-html-links"})}),"\n","\n",(0,r.jsxs)(t.p,{children:["Ensure that the Docusaurus ",(0,r.jsx)(t.a,{href:"/docs/docusaurus-core#link",children:(0,r.jsx)(t.code,{children:"<Link>"})})," component is used instead of ",(0,r.jsx)(t.code,{children:"<a>"})," tags."]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"<Link>"})," component has prefetching and preloading built-in. It also does build-time broken link detection, and helps Docusaurus understand your site's structure better."]}),"\n",(0,r.jsx)(t.h2,{id:"details",children:"Rule Details"}),"\n",(0,r.jsxs)(t.p,{children:["Examples of ",(0,r.jsx)(t.strong,{children:"incorrect"})," code for this rule:"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-html",children:'<a href="/page">go to page!</a>\n\n<a href="https://twitter.com/docusaurus" target="_blank">Twitter</a>\n'})}),"\n",(0,r.jsxs)(t.p,{children:["Examples of ",(0,r.jsx)(t.strong,{children:"correct"})," code for this rule:"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:'import Link from \'@docusaurus/Link\'\n\n<Link to="/page">go to page!</Link>\n\n<Link to="https://twitter.com/docusaurus">Twitter</Link>\n'})}),"\n",(0,r.jsx)(t.h2,{id:"configuration",children:"Rule Configuration"}),"\n",(0,r.jsx)(t.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(l.A,{children:(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Option"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Default"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"ignoreFullyResolved"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"boolean"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"false"})}),(0,r.jsxs)(t.td,{children:["Set to true will not report any ",(0,r.jsx)(t.code,{children:"<a>"})," tags with absolute URLs including a protocol."]})]})})]})})]})}function h(e={}){let{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},43023:(e,t,n)=>{n.d(t,{R:()=>l,x:()=>o});var s=n(63696);let r={},i=s.createContext(r);function l(e){let t=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),s.createElement(i.Provider,{value:t},e.children)}}}]); |