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
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/eslint/no_var.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ pub struct NoVar;
declare_oxc_lint!(
/// ### What it does
///
/// ECMAScript 6 allows programmers to create variables with block scope
/// ECMAScript 2015 allows programmers to create variables with block scope
/// instead of function scope using the `let` and `const` keywords. Block
/// scope is common in many other programming languages and helps
/// programmers avoid mistakes.
///
/// ### Why is this bad?
///
/// Using `var` in an es6 environment triggers this error
/// Using `var` in an ES2015 environment triggers this error
///
/// ### Examples
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ declare_oxc_lint!(
///
/// ### Why is this bad?
///
/// With JavaScript ES6, a new syntax was added for creating variables from an array index or object property,
/// With JavaScript ES2015, a new syntax was added for creating variables from an array index or object property,
/// called destructuring. This rule enforces usage of destructuring
/// instead of accessing a property through a member expression.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ declare_oxc_lint!(
///
/// The parseInt() and Number.parseInt() functions can be used to turn binary, octal, and
/// hexadecimal strings into integers. As binary, octal, and hexadecimal literals are supported
/// in ES6, this rule encourages use of those numeric literals instead of parseInt() or
/// in ES2015, this rule encourages use of those numeric literals instead of parseInt() or
/// Number.parseInt().
///
/// ### Examples
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{

fn implements_on_classes_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("`@implements` used on a non-constructor function")
.with_help("Add `@class` tag or use ES6 class syntax.")
.with_help("Add `@class` tag or use class syntax.")
.with_label(span)
}

Expand All @@ -27,7 +27,7 @@ declare_oxc_lint!(
/// ### Why is this bad?
///
/// Constructor functions should be
/// whether marked with `@class`, `@constructs`, or being an ES6 class constructor.
/// whether marked with `@class`, `@constructs`, or being a class constructor.
///
/// ### Examples
///
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/jsdoc/no_defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ declare_oxc_lint!(
/// ### Why is this bad?
///
/// The rule is intended to prevent the indication of defaults on tags
/// where this would be redundant with ES6 default parameters.
/// where this would be redundant with ES2015 default parameters.
///
/// ### Examples
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{AstNode, context::LintContext, rule::Rule};
fn bad_array_method_on_arguments_diagnostic(method_name: &str, span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Bad array method on arguments")
.with_help(format!(
"The 'arguments' object does not have a '{method_name}()' method. If you intended to use an array method, consider converting the 'arguments' object to an array or using an ES6 rest parameter instead."
"The 'arguments' object does not have a '{method_name}()' method. If you intended to use an array method, consider converting the 'arguments' object to an array or using an ES2015 rest parameter instead."
))
.with_label(span)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/react/no_is_mounted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ pub struct NoIsMounted;
declare_oxc_lint!(
/// ### What it does
///
/// This rule prevents using isMounted in ES6 classes
/// This rule prevents using isMounted in classes
///
/// ### Why is this bad?
///
/// isMounted is an anti-pattern, is not available when using ES6 classes,
/// isMounted is an anti-pattern, is not available when using classes,
/// and it is on its way to being officially deprecated.///
///
/// ### Examples
Expand Down
8 changes: 5 additions & 3 deletions crates/oxc_linter/src/rules/react/prefer_es6_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ use crate::{
};

fn unexpected_es6_class_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Components should use createClass instead of ES6 class.").with_label(span)
OxcDiagnostic::warn("Components should use createClass instead of an ES2015 class.")
.with_label(span)
}

fn expected_es6_class_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Components should use ES6 class instead of createClass.").with_label(span)
OxcDiagnostic::warn("Components should use an ES2015 class instead of createClass.")
.with_label(span)
}

#[derive(Debug, Default, Clone)]
Expand All @@ -27,7 +29,7 @@ declare_oxc_lint!(
/// ### What it does
///
/// React offers you two ways to create traditional components: using the ES5
/// create-react-class module or the new ES6 class system.
/// create-react-class module or the new ES2015 class system.
///
/// ### Why is this bad?
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct RequireRenderReturn;
declare_oxc_lint!(
/// ### What it does
///
/// Enforce ES5 or ES6 class for returning value in render function
/// Enforce ES5 or ES2015 class for returning value in render function
///
/// ### Why is this bad?
///
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/typescript/no_this_alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{

fn no_this_alias_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Unexpected aliasing of 'this' to local variable.")
.with_help("Assigning a variable to this instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well.")
.with_help("Assigning a variable to this instead of properly using arrow lambdas may be a symptom of pre-ES2015 practices or not managing scope well.")
.with_label(span)
}

Expand Down Expand Up @@ -69,7 +69,7 @@ declare_oxc_lint!(
///
/// ### Why is this bad?
///
/// Assigning a variable to `this` instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well.
/// Assigning a variable to `this` instead of properly using arrow lambdas may be a symptom of pre-ES2015 practices or not managing scope well.
NoThisAlias,
typescript,
correctness,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source: crates/oxc_linter/src/tester.rs
· ───────────
4 │ */
╰────
help: Add `@class` tag or use ES6 class syntax.
help: Add `@class` tag or use class syntax.

⚠ eslint-plugin-jsdoc(implements-on-classes): `@implements` used on a non-constructor function
╭─[implements_on_classes.tsx:3:13]
Expand All @@ -17,7 +17,7 @@ source: crates/oxc_linter/src/tester.rs
· ───────────
4 │ */
╰────
help: Add `@class` tag or use ES6 class syntax.
help: Add `@class` tag or use class syntax.

⚠ eslint-plugin-jsdoc(implements-on-classes): `@implements` used on a non-constructor function
╭─[implements_on_classes.tsx:4:13]
Expand All @@ -26,4 +26,4 @@ source: crates/oxc_linter/src/tester.rs
· ───────────
5 │ */
╰────
help: Add `@class` tag or use ES6 class syntax.
help: Add `@class` tag or use class syntax.
Loading
Loading