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
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,7 @@ pub struct StaticBlock<'a> {
pub scope_id: Cell<Option<ScopeId>>,
}

/// ES6 Module Declaration
/// ES Module Declaration
///
/// An ESM import or export statement.
///
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/eslint/no_unused_vars/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ declare_oxc_lint!(
///
/// The original ESLint rule recognizes `/* exported variableName */`
/// comments as a way to indicate that a variable is used in another script
/// and should not be considered unused. Since ES6 modules are now a TC39
/// and should not be considered unused. Since ES modules are now a TC39
/// standard, Oxlint does not support this feature.
///
/// ### Examples
Expand Down Expand Up @@ -183,7 +183,7 @@ declare_oxc_lint!(
/// ```js
/// /* exported global_var */
///
/// // Not respected, use ES6 modules instead.
/// // Not respected, use ES modules instead.
/// var global_var = 42;
/// ```
NoUnusedVars,
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 @@ -21,7 +21,7 @@ fn no_absolute_path_diagnostic(span: Span) -> OxcDiagnostic {
#[derive(Debug, Clone, JsonSchema)]
#[serde(rename_all = "camelCase", default)]
pub struct NoAbsolutePath {
/// If set to `true`, dependency paths for ES6-style import statements will be resolved:
/// If set to `true`, dependency paths for ES module import statements will be resolved:
///
/// ```js
/// import foo from '/foo'; // reported
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/import/no_amd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare_oxc_lint!(
///
/// AMD (Asynchronous Module Definition) is an older module format
/// that is less common in modern JavaScript development, especially
/// with the widespread use of ES6 modules and CommonJS in Node.js.
/// with the widespread use of ES modules and CommonJS in Node.js.
/// AMD introduces unnecessary complexity and is often considered outdated.
/// This rule enforces the use of more modern module systems to improve
/// maintainability and consistency across the codebase.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ declare_oxc_lint!(
///
/// ### Why is this bad?
///
/// With both CommonJS' require and the ES6 modules' import syntax,
/// With both CommonJS' require and the ES modules' import syntax,
/// it is possible to import a module but not to use its result.
/// This can be done explicitly by not assigning the module to a variable.
/// Doing so can mean either of the following things:
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/typescript/no_var_requires.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{

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

Expand All @@ -26,7 +26,7 @@ declare_oxc_lint!(
///
/// ### Why is this bad?
///
/// 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.
/// 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.
///
/// ```typescript
/// var foo = require('foo');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl std::ops::Deref for TripleSlashReference {
declare_oxc_lint!(
/// ### What it does
///
/// Disallow certain triple slash directives in favor of ES6-style import declarations.
/// Disallow certain triple slash directives in favor of ES module import declarations.
///
/// ### Why is this bad?
///
Expand Down
26 changes: 13 additions & 13 deletions crates/oxc_linter/src/snapshots/typescript_no_var_requires.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,77 +6,77 @@ source: crates/oxc_linter/src/tester.rs
1 │ var foo = require('foo');
· ──────────────
╰────
help: Use ES6 style imports or import instead.
help: Use ES module imports or `import = require` instead.

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

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

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

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

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

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

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

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

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

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

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

⚠ typescript-eslint(no-var-requires): Require statement not part of import statement.
╭─[no_var_requires.tsx:3:39]
Expand All @@ -94,4 +94,4 @@ source: crates/oxc_linter/src/tester.rs
· ───────────────────
4 │
╰────
help: Use ES6 style imports or import instead.
help: Use ES module imports or `import = require` instead.
2 changes: 1 addition & 1 deletion crates/oxc_span/src/source_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub enum Language {
pub enum ModuleKind {
/// Regular JS script or CommonJS file
Script = 0,
/// ES6 Module
/// ES Module
Module = 1,
/// Consider the file a "module" if ESM syntax is present, or else consider it a "script".
///
Expand Down
2 changes: 1 addition & 1 deletion napi/minify/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export interface MangleOptionsKeepNames {
export declare function minify(filename: string, sourceText: string, options?: MinifyOptions | undefined | null): MinifyResult

export interface MinifyOptions {
/** Use when minifying an ES6 module. */
/** Use when minifying an ES module. */
module?: boolean
compress?: boolean | CompressOptions
mangle?: boolean | MangleOptions
Expand Down
2 changes: 1 addition & 1 deletion napi/minify/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ impl From<&CodegenOptions> for oxc_codegen::CodegenOptions {
#[napi(object)]
#[derive(Default)]
pub struct MinifyOptions {
/// Use when minifying an ES6 module.
/// Use when minifying an ES module.
pub module: Option<bool>,

pub compress: Option<Either<bool, CompressOptions>>,
Expand Down
Loading