Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linter): add missing typescript-eslint(_) prefix for some errors #2342

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
8 changes: 4 additions & 4 deletions crates/oxc_linter/src/rules/typescript/array_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ declare_oxc_lint!(

#[derive(Debug, Diagnostic, Error)]
pub enum ArrayTypeDiagnostic {
#[error("Array type using '{0}{2}[]' is forbidden. Use '{1}<{2}>' instead.")]
#[error("typescript-eslint(array-type): Array type using '{0}{2}[]' is forbidden. Use '{1}<{2}>' instead.")]
#[diagnostic(severity(warning))]
// readonlyPrefix className type
Generic(String, String, String, #[label] Span),

#[error(
"Array type using '{0}{2}[]' is forbidden for non-simple types. Use '{1}<{2}>' instead."
"typescript-eslint(array-type): Array type using '{0}{2}[]' is forbidden for non-simple types. Use '{1}<{2}>' instead."
)]
#[diagnostic(severity(warning))]
// readonlyPrefix className type
GenericSimple(String, String, String, #[label] Span),

#[error("Array type using '{1}<{2}>' is forbidden. Use '{0}{2}[]' instead.")]
#[error("typescript-eslint(array-type): Array type using '{1}<{2}>' is forbidden. Use '{0}{2}[]' instead.")]
#[diagnostic(severity(warning))]
// readonlyPrefix className type
Array(String, String, String, #[label] Span),

#[error("Array type using '{1}<{2}>' is forbidden for simple types. Use '{0}{2}[]' instead.")]
#[error("typescript-eslint(array-type): Array type using '{1}<{2}>' is forbidden for simple types. Use '{0}{2}[]' instead.")]
#[diagnostic(severity(warning))]
// readonlyPrefix className type
ArraySimple(String, String, String, #[label] Span),
Expand Down
8 changes: 5 additions & 3 deletions crates/oxc_linter/src/rules/typescript/ban_ts_comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ use crate::{context::LintContext, rule::Rule};

#[derive(Debug, Error, Diagnostic)]
pub enum BanTsCommentDiagnostic {
#[error("Do not use @ts-{0} because it alters compilation errors.")]
#[error(
"typescript-eslint(ban-ts-comment): Do not use @ts-{0} because it alters compilation errors."
)]
#[diagnostic(severity(warning))]
Comment(String, #[label] Span),

#[error("Include a description after the @ts-{0} directive to explain why the @ts-{0} is necessary. The description must be {1} characters or longer.")]
#[error("typescript-eslint(ban-ts-comment): Include a description after the @ts-{0} directive to explain why the @ts-{0} is necessary. The description must be {1} characters or longer.")]
#[diagnostic(severity(warning))]
CommentRequiresDescription(String, u64, #[label] Span),

#[error("The description for the @ts-{0} directive must match the {1} format.")]
#[error("typescript-eslint(ban-ts-comment): The description for the @ts-{0} directive must match the {1} format.")]
#[diagnostic(severity(warning))]
CommentDescriptionNotMatchPattern(String, String, #[label] Span),
}
Expand Down
Loading