Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use oxc_diagnostics::OxcDiagnostic;
use schemars::JsonSchema;
use serde_json::Value;

/// See [ESLint - no-unused-vars config schema](https://github.com/eslint/eslint/blob/53b1ff047948e36682fade502c949f4e371e53cd/lib/rules/no-unused-vars.js#L61)
// See [ESLint - no-unused-vars config schema](https://github.com/eslint/eslint/blob/53b1ff047948e36682fade502c949f4e371e53cd/lib/rules/no-unused-vars.js#L61)
#[derive(Debug, Clone, JsonSchema)]
#[serde(rename_all = "camelCase")]
#[must_use]
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/import/max_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn max_dependencies_diagnostic<S: Into<Cow<'static, str>>>(
.with_label(span)
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/max-dependencies.md>
// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/max-dependencies.md>
#[derive(Debug, Default, Clone)]
pub struct MaxDependencies(Box<MaxDependenciesConfig>);

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/import/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn named_diagnostic(imported_name: &str, module_name: &str, span: Span) -> OxcDi
.with_label(span)
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/named.md>
// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/named.md>
#[derive(Debug, Default, Clone)]
pub struct Named;

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/import/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn assignment(span: Span, namespace_name: &str) -> OxcDiagnostic {
.with_label(span)
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/namespace.md>
// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/namespace.md>
#[derive(Debug, Default, Clone, JsonSchema, Deserialize)]
#[serde(rename_all = "camelCase", default)]
pub struct Namespace {
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/import/no_absolute_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn no_absolute_path_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Do not import modules using an absolute path").with_label(span)
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.31.0/docs/rules/no-absolute-path.md>
// <https://github.com/import-js/eslint-plugin-import/blob/v2.31.0/docs/rules/no-absolute-path.md>
#[derive(Debug, Clone, JsonSchema, Deserialize)]
#[serde(rename_all = "camelCase", default)]
pub struct NoAbsolutePath {
Expand Down
1 change: 1 addition & 0 deletions crates/oxc_linter/src/rules/import/no_commonjs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ fn is_conditional(parent_node: &AstNode, ctx: &LintContext) -> bool {
}
}
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-commonjs.md>
impl Rule for NoCommonjs {
fn from_configuration(value: serde_json::Value) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/import/no_cycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn no_cycle_diagnostic(span: Span, paths: &str) -> OxcDiagnostic {
.with_label(span)
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-cycle.md>
// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-cycle.md>
#[derive(Debug, Clone, JsonSchema, Deserialize)]
#[serde(rename_all = "camelCase", default)]
pub struct NoCycle {
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/import/no_duplicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ where
.with_help("Merge these imports into a single import statement")
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-duplicates.md>
// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-duplicates.md>
#[derive(Debug, Default, Clone, JsonSchema, Deserialize)]
#[serde(rename_all = "camelCase", default)]
pub struct NoDuplicates {
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/import/no_mutable_exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn no_mutable_exports_diagnostic(span: Span, kind: VariableDeclarationKind) -> O
.with_label(span)
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.31.0/docs/rules/no-mutable-exports.md>
// <https://github.com/import-js/eslint-plugin-import/blob/v2.31.0/docs/rules/no-mutable-exports.md>
#[derive(Debug, Default, Clone)]
pub struct NoMutableExports;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn no_named_as_default_diagnostic(
.with_label(span)
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-named-as-default-member.md>
// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-named-as-default-member.md>
#[derive(Debug, Default, Clone)]
pub struct NoNamedAsDefault;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn no_named_as_default_member_diagnostic(
.with_label(span)
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-named-as-default-member.md>
// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-named-as-default-member.md>
#[derive(Debug, Default, Clone)]
pub struct NoNamedAsDefaultMember;

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn no_jasmine_globals_diagnostic(
.with_label(span)
}

/// <https://github.com/jest-community/eslint-plugin-jest/blob/v28.9.0/docs/rules/no-jasmine-globals.md>
// <https://github.com/jest-community/eslint-plugin-jest/blob/v28.9.0/docs/rules/no-jasmine-globals.md>
#[derive(Debug, Default, Clone)]
pub struct NoJasmineGlobals;

Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/jest/no_mocks_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn no_mocks_import_diagnostic(span: Span) -> OxcDiagnostic {
.with_label(span)
}

/// <https://github.com/jest-community/eslint-plugin-jest/blob/v28.9.0/docs/rules/no-mocks-import.md>
// <https://github.com/jest-community/eslint-plugin-jest/blob/v28.9.0/docs/rules/no-mocks-import.md>
#[derive(Debug, Default, Clone)]
pub struct NoMocksImport;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Deref for ConsistentTypeImports {
}
}

/// <https://github.com/typescript-eslint/typescript-eslint/blob/v8.9.0/packages/eslint-plugin/docs/rules/consistent-type-imports.mdx>
// <https://github.com/typescript-eslint/typescript-eslint/blob/v8.9.0/packages/eslint-plugin/docs/rules/consistent-type-imports.mdx>
#[derive(Debug, Clone, JsonSchema, Deserialize)]
#[serde(rename_all = "camelCase", default)]
pub struct ConsistentTypeImportsConfig {
Expand Down
12 changes: 11 additions & 1 deletion tasks/website_linter/src/rules/doc_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,18 @@ const source = `{}`;{}
// rule configuration
if let Some(Schema::Object(schema)) = resolved {
let config_section = self.rule_config(schema);
// Pull rule configuration description from the schema metadata, if present.
// The schemars `SchemaObject` may contain a `metadata` block with an
// optional `description` field. If present, include it above the
// configuration listing so readers see the intent for the config.
let section_description = schema
.metadata
.as_ref()
.and_then(|m| m.description.as_ref())
.map(|desc| format!("\n{desc}\n"))
.unwrap_or_default();
if !config_section.trim().is_empty() {
writeln!(self.page, "\n## Configuration\n{config_section}")?;
writeln!(self.page, "\n## Configuration\n{section_description}{config_section}")?;
}
}

Expand Down
Loading