Skip to content

Commit 3dc24b5

Browse files
committed
docs(linter,minifier): always refer as "ES Modules" instead of "ES6 Modules" (#15409)
Nowadays, we normally call them "ES Modules" instead of "ES6 Modules". I made that consistent through the docs.
1 parent 2ad77fb commit 3dc24b5

File tree

11 files changed

+25
-25
lines changed

11 files changed

+25
-25
lines changed

crates/oxc_ast/src/ast/js.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2309,7 +2309,7 @@ pub struct StaticBlock<'a> {
23092309
pub scope_id: Cell<Option<ScopeId>>,
23102310
}
23112311

2312-
/// ES6 Module Declaration
2312+
/// ES Module Declaration
23132313
///
23142314
/// An ESM import or export statement.
23152315
///

crates/oxc_linter/src/rules/eslint/no_unused_vars/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ declare_oxc_lint!(
8888
///
8989
/// The original ESLint rule recognizes `/* exported variableName */`
9090
/// comments as a way to indicate that a variable is used in another script
91-
/// and should not be considered unused. Since ES6 modules are now a TC39
91+
/// and should not be considered unused. Since ES modules are now a TC39
9292
/// standard, Oxlint does not support this feature.
9393
///
9494
/// ### Examples
@@ -183,7 +183,7 @@ declare_oxc_lint!(
183183
/// ```js
184184
/// /* exported global_var */
185185
///
186-
/// // Not respected, use ES6 modules instead.
186+
/// // Not respected, use ES modules instead.
187187
/// var global_var = 42;
188188
/// ```
189189
NoUnusedVars,

crates/oxc_linter/src/rules/import/no_absolute_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn no_absolute_path_diagnostic(span: Span) -> OxcDiagnostic {
2121
#[derive(Debug, Clone, JsonSchema)]
2222
#[serde(rename_all = "camelCase", default)]
2323
pub struct NoAbsolutePath {
24-
/// If set to `true`, dependency paths for ES6-style import statements will be resolved:
24+
/// If set to `true`, dependency paths for ES module import statements will be resolved:
2525
///
2626
/// ```js
2727
/// import foo from '/foo'; // reported

crates/oxc_linter/src/rules/import/no_amd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ declare_oxc_lint!(
2626
///
2727
/// AMD (Asynchronous Module Definition) is an older module format
2828
/// that is less common in modern JavaScript development, especially
29-
/// with the widespread use of ES6 modules and CommonJS in Node.js.
29+
/// with the widespread use of ES modules and CommonJS in Node.js.
3030
/// AMD introduces unnecessary complexity and is often considered outdated.
3131
/// This rule enforces the use of more modern module systems to improve
3232
/// maintainability and consistency across the codebase.

crates/oxc_linter/src/rules/import/no_unassigned_import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ declare_oxc_lint!(
4444
///
4545
/// ### Why is this bad?
4646
///
47-
/// With both CommonJS' require and the ES6 modules' import syntax,
47+
/// With both CommonJS' require and the ES modules' import syntax,
4848
/// it is possible to import a module but not to use its result.
4949
/// This can be done explicitly by not assigning the module to a variable.
5050
/// Doing so can mean either of the following things:

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

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

1313
fn no_var_requires_diagnostic(span: Span) -> OxcDiagnostic {
1414
OxcDiagnostic::warn("Require statement not part of import statement.")
15-
.with_help("Use ES6 style imports or import instead.")
15+
.with_help("Use ES module imports or `import = require` instead.")
1616
.with_label(span)
1717
}
1818

@@ -26,7 +26,7 @@ declare_oxc_lint!(
2626
///
2727
/// ### Why is this bad?
2828
///
29-
/// In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports.
29+
/// In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES module imports or import foo = require("foo") imports.
3030
///
3131
/// ```typescript
3232
/// var foo = require('foo');

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl std::ops::Deref for TripleSlashReference {
6767
declare_oxc_lint!(
6868
/// ### What it does
6969
///
70-
/// Disallow certain triple slash directives in favor of ES6-style import declarations.
70+
/// Disallow certain triple slash directives in favor of ES module import declarations.
7171
///
7272
/// ### Why is this bad?
7373
///

crates/oxc_linter/src/snapshots/typescript_no_var_requires.snap

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,77 +6,77 @@ source: crates/oxc_linter/src/tester.rs
66
1var foo = require('foo');
77
· ──────────────
88
╰────
9-
help: Use ES6 style imports or import instead.
9+
help: Use ES module imports or `import = require` instead.
1010

1111
typescript-eslint(no-var-requires): Require statement not part of import statement.
1212
╭─[no_var_requires.tsx:1:13]
1313
1const foo = require('foo');
1414
· ──────────────
1515
╰────
16-
help: Use ES6 style imports or import instead.
16+
help: Use ES module imports or `import = require` instead.
1717

1818
typescript-eslint(no-var-requires): Require statement not part of import statement.
1919
╭─[no_var_requires.tsx:1:11]
2020
1let foo = require('foo');
2121
· ──────────────
2222
╰────
23-
help: Use ES6 style imports or import instead.
23+
help: Use ES module imports or `import = require` instead.
2424

2525
typescript-eslint(no-var-requires): Require statement not part of import statement.
2626
╭─[no_var_requires.tsx:1:17]
2727
1let foo = trick(require('foo'));
2828
· ──────────────
2929
╰────
30-
help: Use ES6 style imports or import instead.
30+
help: Use ES module imports or `import = require` instead.
3131

3232
typescript-eslint(no-var-requires): Require statement not part of import statement.
3333
╭─[no_var_requires.tsx:1:11]
3434
1var foo = require?.('foo');
3535
· ────────────────
3636
╰────
37-
help: Use ES6 style imports or import instead.
37+
help: Use ES module imports or `import = require` instead.
3838

3939
typescript-eslint(no-var-requires): Require statement not part of import statement.
4040
╭─[no_var_requires.tsx:1:13]
4141
1const foo = require?.('foo');
4242
· ────────────────
4343
╰────
44-
help: Use ES6 style imports or import instead.
44+
help: Use ES module imports or `import = require` instead.
4545

4646
typescript-eslint(no-var-requires): Require statement not part of import statement.
4747
╭─[no_var_requires.tsx:1:11]
4848
1let foo = require?.('foo');
4949
· ────────────────
5050
╰────
51-
help: Use ES6 style imports or import instead.
51+
help: Use ES module imports or `import = require` instead.
5252

5353
typescript-eslint(no-var-requires): Require statement not part of import statement.
5454
╭─[no_var_requires.tsx:1:17]
5555
1let foo = trick(require?.('foo'));
5656
· ────────────────
5757
╰────
58-
help: Use ES6 style imports or import instead.
58+
help: Use ES module imports or `import = require` instead.
5959

6060
typescript-eslint(no-var-requires): Require statement not part of import statement.
6161
╭─[no_var_requires.tsx:1:19]
6262
1let foo = trick?.(require('foo'));
6363
· ──────────────
6464
╰────
65-
help: Use ES6 style imports or import instead.
65+
help: Use ES module imports or `import = require` instead.
6666

6767
typescript-eslint(no-var-requires): Require statement not part of import statement.
6868
╭─[no_var_requires.tsx:1:13]
6969
1const foo = require('./foo.json') as Foo;
7070
· ─────────────────────
7171
╰────
72-
help: Use ES6 style imports or import instead.
72+
help: Use ES module imports or `import = require` instead.
7373

7474
typescript-eslint(no-var-requires): Require statement not part of import statement.
7575
╭─[no_var_requires.tsx:1:18]
7676
1const foo: Foo = require('./foo.json').default;
7777
· ─────────────────────
7878
╰────
79-
help: Use ES6 style imports or import instead.
79+
help: Use ES module imports or `import = require` instead.
8080

8181
typescript-eslint(no-var-requires): Require statement not part of import statement.
8282
╭─[no_var_requires.tsx:2:51]
@@ -85,7 +85,7 @@ source: crates/oxc_linter/src/tester.rs
8585
· ───────────────────
8686
3configValidator.addSchema(require('./a.json'));
8787
╰────
88-
help: Use ES6 style imports or import instead.
88+
help: Use ES module imports or `import = require` instead.
8989

9090
typescript-eslint(no-var-requires): Require statement not part of import statement.
9191
╭─[no_var_requires.tsx:3:39]
@@ -94,4 +94,4 @@ source: crates/oxc_linter/src/tester.rs
9494
· ───────────────────
9595
4
9696
╰────
97-
help: Use ES6 style imports or import instead.
97+
help: Use ES module imports or `import = require` instead.

crates/oxc_span/src/source_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub enum Language {
5151
pub enum ModuleKind {
5252
/// Regular JS script or CommonJS file
5353
Script = 0,
54-
/// ES6 Module
54+
/// ES Module
5555
Module = 1,
5656
/// Consider the file a "module" if ESM syntax is present, or else consider it a "script".
5757
///

napi/minify/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export interface MangleOptionsKeepNames {
129129
export declare function minify(filename: string, sourceText: string, options?: MinifyOptions | undefined | null): MinifyResult
130130

131131
export interface MinifyOptions {
132-
/** Use when minifying an ES6 module. */
132+
/** Use when minifying an ES module. */
133133
module?: boolean
134134
compress?: boolean | CompressOptions
135135
mangle?: boolean | MangleOptions

0 commit comments

Comments
 (0)