这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit 2c6bd9e

Browse files
committed
docs(linter): always refer as "ES2015" instead of "ES6" (#15411)
It is now more common to refer ES6 / ES2015 as "ES2015" than "ES6". This PR updates multiple places to use "ES2015" instead of "ES6". It also removes some redundant "ES6" when it is not important anymore in context of those sentences.
1 parent a0c5203 commit 2c6bd9e

14 files changed

+65
-63
lines changed

crates/oxc_linter/src/rules/eslint/no_var.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ pub struct NoVar;
2424
declare_oxc_lint!(
2525
/// ### What it does
2626
///
27-
/// ECMAScript 6 allows programmers to create variables with block scope
27+
/// ECMAScript 2015 allows programmers to create variables with block scope
2828
/// instead of function scope using the `let` and `const` keywords. Block
2929
/// scope is common in many other programming languages and helps
3030
/// programmers avoid mistakes.
3131
///
3232
/// ### Why is this bad?
3333
///
34-
/// Using `var` in an es6 environment triggers this error
34+
/// Using `var` in an ES2015 environment triggers this error
3535
///
3636
/// ### Examples
3737
///

crates/oxc_linter/src/rules/eslint/prefer_destructuring.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ declare_oxc_lint!(
5656
///
5757
/// ### Why is this bad?
5858
///
59-
/// With JavaScript ES6, a new syntax was added for creating variables from an array index or object property,
59+
/// With JavaScript ES2015, a new syntax was added for creating variables from an array index or object property,
6060
/// called destructuring. This rule enforces usage of destructuring
6161
/// instead of accessing a property through a member expression.
6262
///

crates/oxc_linter/src/rules/eslint/prefer_numeric_literals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ declare_oxc_lint!(
3838
///
3939
/// The parseInt() and Number.parseInt() functions can be used to turn binary, octal, and
4040
/// hexadecimal strings into integers. As binary, octal, and hexadecimal literals are supported
41-
/// in ES6, this rule encourages use of those numeric literals instead of parseInt() or
41+
/// in ES2015, this rule encourages use of those numeric literals instead of parseInt() or
4242
/// Number.parseInt().
4343
///
4444
/// ### Examples

crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212

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

@@ -27,7 +27,7 @@ declare_oxc_lint!(
2727
/// ### Why is this bad?
2828
///
2929
/// Constructor functions should be
30-
/// whether marked with `@class`, `@constructs`, or being an ES6 class constructor.
30+
/// whether marked with `@class`, `@constructs`, or being a class constructor.
3131
///
3232
/// ### Examples
3333
///

crates/oxc_linter/src/rules/jsdoc/no_defaults.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ declare_oxc_lint!(
2828
/// ### Why is this bad?
2929
///
3030
/// The rule is intended to prevent the indication of defaults on tags
31-
/// where this would be redundant with ES6 default parameters.
31+
/// where this would be redundant with ES2015 default parameters.
3232
///
3333
/// ### Examples
3434
///

crates/oxc_linter/src/rules/oxc/bad_array_method_on_arguments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{AstNode, context::LintContext, rule::Rule};
88
fn bad_array_method_on_arguments_diagnostic(method_name: &str, span: Span) -> OxcDiagnostic {
99
OxcDiagnostic::warn("Bad array method on arguments")
1010
.with_help(format!(
11-
"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."
11+
"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."
1212
))
1313
.with_label(span)
1414
}

crates/oxc_linter/src/rules/react/no_is_mounted.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ pub struct NoIsMounted;
2121
declare_oxc_lint!(
2222
/// ### What it does
2323
///
24-
/// This rule prevents using isMounted in ES6 classes
24+
/// This rule prevents using isMounted in classes
2525
///
2626
/// ### Why is this bad?
2727
///
28-
/// isMounted is an anti-pattern, is not available when using ES6 classes,
28+
/// isMounted is an anti-pattern, is not available when using classes,
2929
/// and it is on its way to being officially deprecated.///
3030
///
3131
/// ### Examples

crates/oxc_linter/src/rules/react/prefer_es6_class.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ use crate::{
1111
};
1212

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

1718
fn expected_es6_class_diagnostic(span: Span) -> OxcDiagnostic {
18-
OxcDiagnostic::warn("Components should use ES6 class instead of createClass.").with_label(span)
19+
OxcDiagnostic::warn("Components should use an ES2015 class instead of createClass.")
20+
.with_label(span)
1921
}
2022

2123
#[derive(Debug, Default, Clone)]
@@ -27,7 +29,7 @@ declare_oxc_lint!(
2729
/// ### What it does
2830
///
2931
/// React offers you two ways to create traditional components: using the ES5
30-
/// create-react-class module or the new ES6 class system.
32+
/// create-react-class module or the new ES2015 class system.
3133
///
3234
/// ### Why is this bad?
3335
///

crates/oxc_linter/src/rules/react/require_render_return.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct RequireRenderReturn;
2626
declare_oxc_lint!(
2727
/// ### What it does
2828
///
29-
/// Enforce ES5 or ES6 class for returning value in render function
29+
/// Enforce ES5 or ES2015 class for returning value in render function
3030
///
3131
/// ### Why is this bad?
3232
///

crates/oxc_linter/src/rules/typescript/no_this_alias.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::{
1818

1919
fn no_this_alias_diagnostic(span: Span) -> OxcDiagnostic {
2020
OxcDiagnostic::warn("Unexpected aliasing of 'this' to local variable.")
21-
.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.")
21+
.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.")
2222
.with_label(span)
2323
}
2424

@@ -69,7 +69,7 @@ declare_oxc_lint!(
6969
///
7070
/// ### Why is this bad?
7171
///
72-
/// Assigning a variable to `this` instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well.
72+
/// Assigning a variable to `this` instead of properly using arrow lambdas may be a symptom of pre-ES2015 practices or not managing scope well.
7373
NoThisAlias,
7474
typescript,
7575
correctness,

0 commit comments

Comments
 (0)