+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

doc(website): Run cargo lintdoc #3567

Merged
merged 4 commits into from
Nov 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/rome_cli/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub(crate) fn init(mut session: CliSession) -> Result<(), Termination> {
"<Italic>"rome ci"</Italic>" checks for lint errors and verifies formatting. Run " <Italic>"rome --help"</Italic>" for a full list of commands and options.

"<Dim>"3."</Dim>" "<Emphasis>"Read the documentation"</Emphasis>"
Our website serves as a comprehensive source of guides and documentation: "<Hyperlink href="https://rome.tools/docs">"https://rome.tools/docs"</Hyperlink>"
Our website serves as a comprehensive source of guides and documentation: "<Hyperlink href="https://docs.rome.tools">"https://docs.rome.tools"</Hyperlink>"

"<Dim>"4."</Dim>" "<Emphasis>"Get involved in the community"</Emphasis>"
Ask questions, get support, or contribute by participating on GitHub ("<Hyperlink href="https://github.com/rome/tools">"https://github.com/rome/tools"</Hyperlink>"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Next Steps ━━━━━━━━━━━━━━━━━━━━━━━
rome ci checks for lint errors and verifies formatting. Run rome --help for a full list of commands and options.

3. Read the documentation
Our website serves as a comprehensive source of guides and documentation: https://rome.tools/docs
Our website serves as a comprehensive source of guides and documentation: https://docs.rome.tools

4. Get involved in the community
Ask questions, get support, or contribute by participating on GitHub (https://github.com/rome/tools),
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_diagnostics/src/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua";

let expected = markup! {
"file_name "<Hyperlink href="https://rome.tools/docs/lint/rules/noArguments">"lint/correctness/noArguments"</Hyperlink>" "<Inverse>" FIXABLE "</Inverse>" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n"
"file_name "<Hyperlink href="https://docs.rome.tools/lint/rules/noArguments">"lint/correctness/noArguments"</Hyperlink>" "<Inverse>" FIXABLE "</Inverse>" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n"
"\n"
<Emphasis><Error>" ✖"</Error></Emphasis>" "<Error>"message"</Error>"\n"
" \n"
Expand Down
126 changes: 63 additions & 63 deletions crates/rome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,79 +10,79 @@
define_dategories! {
// Lint categories
// correctness
"lint/correctness/noArguments": "https://rome.tools/docs/lint/rules/noArguments",
"lint/correctness/noAsyncPromiseExecutor": "https://rome.tools/docs/lint/rules/noAsyncPromiseExecutor",
"lint/correctness/noCatchAssign": "https://rome.tools/docs/lint/rules/noCatchAssign",
"lint/correctness/noCommentText": "https://rome.tools/docs/lint/rules/noCommentText",
"lint/correctness/noCompareNegZero": "https://rome.tools/docs/lint/rules/noCompareNegZero",
"lint/correctness/noDelete": "https://rome.tools/docs/lint/rules/noDelete",
"lint/correctness/noDoubleEquals": "https://rome.tools/docs/lint/rules/noDoubleEquals",
"lint/correctness/noDupeArgs": "https://rome.tools/docs/lint/rules/noDupeArgs",
"lint/correctness/noEmptyPattern": "https://rome.tools/docs/lint/rules/noEmptyPattern",
"lint/correctness/noFunctionAssign": "https://rome.tools/docs/lint/rules/noFunctionAssign",
"lint/correctness/noImportAssign": "https://rome.tools/docs/lint/rules/noImportAssign",
"lint/correctness/noLabelVar": "https://rome.tools/docs/lint/rules/noLabelVar",
"lint/correctness/noMultipleSpacesInRegularExpressionLiterals": "https://rome.tools/docs/lint/rules/noMultipleSpacesInRegularExpressionLiterals",
"lint/correctness/noShadowRestrictedNames": "https://rome.tools/docs/lint/rules/noShadowRestrictedNames",
"lint/correctness/noSparseArray": "https://rome.tools/docs/lint/rules/noSparseArray",
"lint/correctness/noUnnecessaryContinue": "https://rome.tools/docs/lint/rules/noUnnecessaryContinue",
"lint/correctness/noUnsafeNegation": "https://rome.tools/docs/lint/rules/noUnsafeNegation",
"lint/correctness/useSingleCaseStatement": "https://rome.tools/docs/lint/rules/useSingleCaseStatement",
"lint/correctness/useWhile": "https://rome.tools/docs/lint/rules/useWhile",
"lint/correctness/noNewSymbol": "https://rome.tools/docs/lint/rules/noNewSymbol",
"lint/correctness/noUselessFragments": "https://rome.tools/docs/lint/rules/noUselessFragments",
"lint/correctness/noUnusedVariables": "https://rome.tools/docs/lint/rules/noUnusedVariables",
"lint/correctness/noUnreachable": "https://rome.tools/docs/lint/rules/noUnreachable",
"lint/correctness/noRestrictedGlobals": "https://rome.tools/docs/lint/rules/noRestrictedGlobals",
"lint/correctness/noUndeclaredVariables": "https://rome.tools/docs/lint/rules/noUndeclaredVariables",
"lint/correctness/useValidTypeof": "https://rome.tools/docs/lint/rules/useValidTypeof",
"lint/correctness/noVoidElementsWithChildren": "https://rome.tools/docs/lint/rules/noVoidElementsWithChildren",
"lint/correctness/noArrayIndexKey": "https://rome.tools/docs/lint/rules/noArrayIndexKey",
"lint/correctness/noChildrenProp": "https://rome.tools/docs/lint/rules/noChildrenProp",
"lint/correctness/noRenderReturnValue": "https://rome.tools/docs/lint/rules/noRenderReturnValue",
"lint/correctness/noDebugger": "https://rome.tools/docs/lint/rules/noDebugger",
"lint/correctness/noArguments": "https://docs.rome.tools/lint/rules/noArguments",
"lint/correctness/noAsyncPromiseExecutor": "https://docs.rome.tools/lint/rules/noAsyncPromiseExecutor",
"lint/correctness/noCatchAssign": "https://docs.rome.tools/lint/rules/noCatchAssign",
"lint/correctness/noCommentText": "https://docs.rome.tools/lint/rules/noCommentText",
"lint/correctness/noCompareNegZero": "https://docs.rome.tools/lint/rules/noCompareNegZero",
"lint/correctness/noDelete": "https://docs.rome.tools/lint/rules/noDelete",
"lint/correctness/noDoubleEquals": "https://docs.rome.tools/lint/rules/noDoubleEquals",
"lint/correctness/noDupeArgs": "https://docs.rome.tools/lint/rules/noDupeArgs",
"lint/correctness/noEmptyPattern": "https://docs.rome.tools/lint/rules/noEmptyPattern",
"lint/correctness/noFunctionAssign": "https://docs.rome.tools/lint/rules/noFunctionAssign",
"lint/correctness/noImportAssign": "https://docs.rome.tools/lint/rules/noImportAssign",
"lint/correctness/noLabelVar": "https://docs.rome.tools/lint/rules/noLabelVar",
"lint/correctness/noMultipleSpacesInRegularExpressionLiterals": "https://docs.rome.tools/lint/rules/noMultipleSpacesInRegularExpressionLiterals",
"lint/correctness/noShadowRestrictedNames": "https://docs.rome.tools/lint/rules/noShadowRestrictedNames",
"lint/correctness/noSparseArray": "https://docs.rome.tools/lint/rules/noSparseArray",
"lint/correctness/noUnnecessaryContinue": "https://docs.rome.tools/lint/rules/noUnnecessaryContinue",
"lint/correctness/noUnsafeNegation": "https://docs.rome.tools/lint/rules/noUnsafeNegation",
"lint/correctness/useSingleCaseStatement": "https://docs.rome.tools/lint/rules/useSingleCaseStatement",
"lint/correctness/useWhile": "https://docs.rome.tools/lint/rules/useWhile",
"lint/correctness/noNewSymbol": "https://docs.rome.tools/lint/rules/noNewSymbol",
"lint/correctness/noUselessFragments": "https://docs.rome.tools/lint/rules/noUselessFragments",
"lint/correctness/noUnusedVariables": "https://docs.rome.tools/lint/rules/noUnusedVariables",
"lint/correctness/noUnreachable": "https://docs.rome.tools/lint/rules/noUnreachable",
"lint/correctness/noRestrictedGlobals": "https://docs.rome.tools/lint/rules/noRestrictedGlobals",
"lint/correctness/noUndeclaredVariables": "https://docs.rome.tools/lint/rules/noUndeclaredVariables",
"lint/correctness/useValidTypeof": "https://docs.rome.tools/lint/rules/useValidTypeof",
"lint/correctness/noVoidElementsWithChildren": "https://docs.rome.tools/lint/rules/noVoidElementsWithChildren",
"lint/correctness/noArrayIndexKey": "https://docs.rome.tools/lint/rules/noArrayIndexKey",
"lint/correctness/noChildrenProp": "https://docs.rome.tools/lint/rules/noChildrenProp",
"lint/correctness/noRenderReturnValue": "https://docs.rome.tools/lint/rules/noRenderReturnValue",
"lint/correctness/noDebugger": "https://docs.rome.tools/lint/rules/noDebugger",

// style group
"lint/style/noNegationElse": "https://rome.tools/docs/lint/rules/noNegationElse",
"lint/style/noShoutyConstants": "https://rome.tools/docs/lint/rules/noShoutyConstants",
"lint/style/useSelfClosingElements": "https://rome.tools/docs/lint/rules/useSelfClosingElements",
"lint/style/useShorthandArrayType": "https://rome.tools/docs/lint/rules/useShorthandArrayType",
"lint/style/useFragmentSyntax": "https://rome.tools/docs/lint/rules/useFragmentSyntax",
"lint/style/useTemplate": "https://rome.tools/docs/lint/rules/useTemplate",
"lint/style/useSingleVarDeclarator": "https://rome.tools/docs/lint/rules/useSingleVarDeclarator",
"lint/style/useOptionalChain": "https://rome.tools/docs/lint/rules/useOptionalChain",
"lint/style/useBlockStatements": "https://rome.tools/docs/lint/rules/useBlockStatements",
"lint/style/noImplicitBoolean": "https://rome.tools/docs/lint/rules/noImplicitBoolean",
"lint/style/noUnusedTemplateLiteral": "https://rome.tools/docs/lint/rules/noUnusedTemplateLiteral",
"lint/style/noNegationElse": "https://docs.rome.tools/lint/rules/noNegationElse",
"lint/style/noShoutyConstants": "https://docs.rome.tools/lint/rules/noShoutyConstants",
"lint/style/useSelfClosingElements": "https://docs.rome.tools/lint/rules/useSelfClosingElements",
"lint/style/useShorthandArrayType": "https://docs.rome.tools/lint/rules/useShorthandArrayType",
"lint/style/useFragmentSyntax": "https://docs.rome.tools/lint/rules/useFragmentSyntax",
"lint/style/useTemplate": "https://docs.rome.tools/lint/rules/useTemplate",
"lint/style/useSingleVarDeclarator": "https://docs.rome.tools/lint/rules/useSingleVarDeclarator",
"lint/style/useOptionalChain": "https://docs.rome.tools/lint/rules/useOptionalChain",
"lint/style/useBlockStatements": "https://docs.rome.tools/lint/rules/useBlockStatements",
"lint/style/noImplicitBoolean": "https://docs.rome.tools/lint/rules/noImplicitBoolean",
"lint/style/noUnusedTemplateLiteral": "https://docs.rome.tools/lint/rules/noUnusedTemplateLiteral",

// complexity
"lint/complexity/useSimplifiedLogicExpression": "https://rome.tools/docs/lint/rules/useSimplifiedLogicExpression",
"lint/complexity/noExtraBooleanCast": "https://rome.tools/docs/lint/rules/noExtraBooleanCast",
"lint/complexity/useSimplifiedLogicExpression": "https://docs.rome.tools/lint/rules/useSimplifiedLogicExpression",
"lint/complexity/noExtraBooleanCast": "https://docs.rome.tools/lint/rules/noExtraBooleanCast",

// a11y group
"lint/a11y/noAutofocus": "https://rome.tools/docs/lint/rules/noAutofocus",
"lint/a11y/noPositiveTabindex": "https://rome.tools/docs/lint/rules/noPositiveTabindex",
"lint/a11y/useKeyWithMouseEvents": "https://rome.tools/docs/lint/rules/useKeyWithMouseEvents",
"lint/a11y/useAnchorContent": "https://rome.tools/docs/lint/rules/useAnchorContent",
"lint/a11y/useBlankTarget": "https://rome.tools/docs/lint/rules/useBlankTarget",
"lint/a11y/useValidAnchor": "https://rome.tools/docs/lint/rules/useValidAnchor",
"lint/a11y/useKeyWithClickEvents": "https://rome.tools/docs/lint/rules/useKeyWithClickEvents",
"lint/a11y/useButtonType": "https://rome.tools/docs/lint/rules/useButtonType",
"lint/a11y/useAltText": "https://rome.tools/docs/lint/rules/useAltText",
"lint/a11y/noAutofocus": "https://docs.rome.tools/lint/rules/noAutofocus",
"lint/a11y/noPositiveTabindex": "https://docs.rome.tools/lint/rules/noPositiveTabindex",
"lint/a11y/useKeyWithMouseEvents": "https://docs.rome.tools/lint/rules/useKeyWithMouseEvents",
"lint/a11y/useAnchorContent": "https://docs.rome.tools/lint/rules/useAnchorContent",
"lint/a11y/useBlankTarget": "https://docs.rome.tools/lint/rules/useBlankTarget",
"lint/a11y/useValidAnchor": "https://docs.rome.tools/lint/rules/useValidAnchor",
"lint/a11y/useKeyWithClickEvents": "https://docs.rome.tools/lint/rules/useKeyWithClickEvents",
"lint/a11y/useButtonType": "https://docs.rome.tools/lint/rules/useButtonType",
"lint/a11y/useAltText": "https://docs.rome.tools/lint/rules/useAltText",
// security
"lint/security/noDangerouslySetInnerHtml": "https://rome.tools/docs/lint/rules/noDangerouslySetInnerHtml",
"lint/security/noDangerouslySetInnerHtmlWithChildren": "https://rome.tools/docs/lint/rules/noDangerouslySetInnerHtmlWithChildren",
"lint/security/noDangerouslySetInnerHtml": "https://docs.rome.tools/lint/rules/noDangerouslySetInnerHtml",
"lint/security/noDangerouslySetInnerHtmlWithChildren": "https://docs.rome.tools/lint/rules/noDangerouslySetInnerHtmlWithChildren",


// nursery
"lint/nursery/useFlatMap": "https://rome.tools/docs/lint/rules/useFlatMap",
"lint/nursery/noConstAssign": "https://rome.tools/docs/lint/rules/noConstAssign",
"lint/nursery/noExplicitAny": "https://rome.tools/docs/lint/rules/noExplicitAny",
"lint/nursery/useValidForDirection": "https://rome.tools/docs/lint/rules/useValidForDirection",
"lint/nursery/noInvalidConstructorSuper": "https://rome.tools/docs/lint/rules/noInvalidConstructorSuper",
"lint/nursery/useExhaustiveDependencies": "https://rome.tools/docs/lint/rules/useExhaustiveDependencies",
"lint/nursery/useCamelCase": "https://rome.tools/docs/lint/rules/useCamelCase",
"lint/nursery/noBannedTypes":"https://rome.tools/docs/lint/rules/noBannedTypes",
"lint/nursery/useFlatMap": "https://docs.rome.tools/lint/rules/useFlatMap",
"lint/nursery/noConstAssign": "https://docs.rome.tools/lint/rules/noConstAssign",
"lint/nursery/noExplicitAny": "https://docs.rome.tools/lint/rules/noExplicitAny",
"lint/nursery/useValidForDirection": "https://docs.rome.tools/lint/rules/useValidForDirection",
"lint/nursery/noInvalidConstructorSuper": "https://docs.rome.tools/lint/rules/noInvalidConstructorSuper",
"lint/nursery/useExhaustiveDependencies": "https://docs.rome.tools/lint/rules/useExhaustiveDependencies",
"lint/nursery/useCamelCase": "https://docs.rome.tools/lint/rules/useCamelCase",
"lint/nursery/noBannedTypes":"https://docs.rome.tools/lint/rules/noBannedTypes",

;

Expand Down
2 changes: 1 addition & 1 deletion website/docs/src/lint/rules/noArguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function f() {
}
```

{% raw %}<pre class="language-text"><code class="language-text">correctness/noArguments.js:2:16 <a href="https://rome.tools/lint/rules/noArguments">lint/correctness/noArguments</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{% raw %}<pre class="language-text"><code class="language-text">correctness/noArguments.js:2:16 <a href="https://docs.rome.tools/lint/rules/noArguments">lint/correctness/noArguments</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

<strong><span style="color: Tomato;"> </span></strong><strong><span style="color: Tomato;">✖</span></strong> <span style="color: Tomato;">Use the </span><span style="color: Tomato;"><strong>rest parameters</strong></span><span style="color: Tomato;"> instead of </span><span style="color: Tomato;"><strong>arguments</strong></span><span style="color: Tomato;">.</span>

Expand Down
10 changes: 5 additions & 5 deletions website/docs/src/lint/rules/noArrayIndexKey.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Check out Robin Pokorny’s article for an
If you choose not to assign an explicit key to list items then React will default to using indexes as keys.


Source [React documentation](https://reactjs.org/lists-and-keys.html#keys)
Source [React documentation](https://reactjs.org/docs/lists-and-keys.html#keys)

## Examples

Expand All @@ -27,7 +27,7 @@ something.forEach((Element, index) => {
});
```

{% raw %}<pre class="language-text"><code class="language-text">correctness/noArrayIndexKey.js:2:21 <a href="https://rome.tools/lint/rules/noArrayIndexKey">lint/correctness/noArrayIndexKey</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{% raw %}<pre class="language-text"><code class="language-text">correctness/noArrayIndexKey.js:2:21 <a href="https://docs.rome.tools/lint/rules/noArrayIndexKey">lint/correctness/noArrayIndexKey</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

<strong><span style="color: Tomato;"> </span></strong><strong><span style="color: Tomato;">✖</span></strong> <span style="color: Tomato;">Avoid using the index of an array as key property in an element.</span>

Expand All @@ -46,7 +46,7 @@ something.forEach((Element, index) => {

<strong><span style="color: rgb(38, 148, 255);"> </span></strong><strong><span style="color: rgb(38, 148, 255);">ℹ</span></strong> <span style="color: rgb(38, 148, 255);">The order of the items may change, and this also affects performances and component state.</span>

<strong><span style="color: rgb(38, 148, 255);"> </span></strong><strong><span style="color: rgb(38, 148, 255);">ℹ</span></strong> <span style="color: rgb(38, 148, 255);">Check the </span><span style="color: rgb(38, 148, 255);"><a href="https://reactjs.org/lists-and-keys.html#keys">React documentation</a></span><span style="color: rgb(38, 148, 255);">. </span>
<strong><span style="color: rgb(38, 148, 255);"> </span></strong><strong><span style="color: rgb(38, 148, 255);">ℹ</span></strong> <span style="color: rgb(38, 148, 255);">Check the </span><span style="color: rgb(38, 148, 255);"><a href="https://reactjs.org/docs/lists-and-keys.html#keys">React documentation</a></span><span style="color: rgb(38, 148, 255);">. </span>

</code></pre>{% endraw %}

Expand All @@ -56,7 +56,7 @@ React.Children.map(this.props.children, (child, index) => (
))
```

{% raw %}<pre class="language-text"><code class="language-text">correctness/noArrayIndexKey.js:2:38 <a href="https://rome.tools/lint/rules/noArrayIndexKey">lint/correctness/noArrayIndexKey</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{% raw %}<pre class="language-text"><code class="language-text">correctness/noArrayIndexKey.js:2:38 <a href="https://docs.rome.tools/lint/rules/noArrayIndexKey">lint/correctness/noArrayIndexKey</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

<strong><span style="color: Tomato;"> </span></strong><strong><span style="color: Tomato;">✖</span></strong> <span style="color: Tomato;">Avoid using the index of an array as key property in an element.</span>

Expand All @@ -75,7 +75,7 @@ React.Children.map(this.props.children, (child, index) => (

<strong><span style="color: rgb(38, 148, 255);"> </span></strong><strong><span style="color: rgb(38, 148, 255);">ℹ</span></strong> <span style="color: rgb(38, 148, 255);">The order of the items may change, and this also affects performances and component state.</span>

<strong><span style="color: rgb(38, 148, 255);"> </span></strong><strong><span style="color: rgb(38, 148, 255);">ℹ</span></strong> <span style="color: rgb(38, 148, 255);">Check the </span><span style="color: rgb(38, 148, 255);"><a href="https://reactjs.org/lists-and-keys.html#keys">React documentation</a></span><span style="color: rgb(38, 148, 255);">. </span>
<strong><span style="color: rgb(38, 148, 255);"> </span></strong><strong><span style="color: rgb(38, 148, 255);">ℹ</span></strong> <span style="color: rgb(38, 148, 255);">Check the </span><span style="color: rgb(38, 148, 255);"><a href="https://reactjs.org/docs/lists-and-keys.html#keys">React documentation</a></span><span style="color: rgb(38, 148, 255);">. </span>

</code></pre>{% endraw %}

Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载