Skip to content

Commit

Permalink
docs(linter): document rules (#6983)
Browse files Browse the repository at this point in the history
closes #6370
  • Loading branch information
Boshen committed Oct 28, 2024
1 parent 46e5360 commit 4551baa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
18 changes: 17 additions & 1 deletion crates/oxc_linter/src/config/oxlintrc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,23 @@ use crate::{options::LintPlugins, utils::read_to_string};
pub struct Oxlintrc {
pub plugins: LintPlugins,
pub categories: OxlintCategories,
/// See [Oxlint Rules](https://oxc.rs/docs/guide/usage/linter/rules.html).
/// Example
///
/// `.oxlintrc.json`
///
/// ```json
/// {
/// "$schema": "./node_modules/oxlint/configuration_schema.json",
/// "rules": {
/// "eqeqeq": "warn",
/// "import/no-cycle": "error",
/// "prefer-const": ["error", { "ignoreReadBeforeAssign": true }]
/// }
/// }
/// ```
///
/// See [Oxlint Rules](https://oxc.rs/docs/guide/usage/linter/rules.html) for the list of
/// rules.
pub rules: OxlintRules,
pub settings: OxlintSettings,
/// Environments enable and disable collections of global variables.
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/snapshots/schema_json.snap
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ expression: json
]
},
"rules": {
"description": "See [Oxlint Rules](https://oxc.rs/docs/guide/usage/linter/rules.html).",
"description": "Example\n\n`.oxlintrc.json`\n\n```json { \"$schema\": \"./node_modules/oxlint/configuration_schema.json\", \"rules\": { \"eqeqeq\": \"warn\", \"import/no-cycle\": \"error\", \"prefer-const\": [\"error\", { \"ignoreReadBeforeAssign\": true }] } } ```\n\nSee [Oxlint Rules](https://oxc.rs/docs/guide/usage/linter/rules.html) for the list of rules.",
"default": {},
"allOf": [
{
Expand Down
2 changes: 1 addition & 1 deletion npm/oxlint/configuration_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
]
},
"rules": {
"description": "See [Oxlint Rules](https://oxc.rs/docs/guide/usage/linter/rules.html).",
"description": "Example\n\n`.oxlintrc.json`\n\n```json { \"$schema\": \"./node_modules/oxlint/configuration_schema.json\", \"rules\": { \"eqeqeq\": \"warn\", \"import/no-cycle\": \"error\", \"prefer-const\": [\"error\", { \"ignoreReadBeforeAssign\": true }] } } ```\n\nSee [Oxlint Rules](https://oxc.rs/docs/guide/usage/linter/rules.html) for the list of rules.",
"default": {},
"allOf": [
{
Expand Down

0 comments on commit 4551baa

Please sign in to comment.