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 .github/generated/ast_changes_watch_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ src:
- 'crates/oxc_syntax/src/serialize.rs'
- 'crates/oxc_syntax/src/symbol.rs'
- 'crates/oxc_traverse/src/generated/scopes_collector.rs'
- 'napi/oxlint2/src-js/generated/constants.mjs'
- 'napi/oxlint2/src/generated/raw_transfer_constants.rs'
- 'napi/oxlint/src-js/generated/constants.mjs'
- 'napi/oxlint/src/generated/raw_transfer_constants.rs'
- 'napi/parser/generated/constants.mjs'
- 'napi/parser/generated/deserialize/js.mjs'
- 'napi/parser/generated/deserialize/ts.mjs'
Expand Down
2 changes: 1 addition & 1 deletion apps/oxlint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn lint(mut external_linter: Option<ExternalLinter>) -> CliRunResult {

#[expect(clippy::print_stderr)]
if command.experimental_js_plugins {
// If no `ExternalLinter`, this function was not called by `napi/oxlint2`
// If no `ExternalLinter`, this function was not called by `napi/oxlint`
if external_linter.is_none() {
eprintln!("ERROR: JS plugins are not supported at present");
return CliRunResult::InvalidOptionConfig;
Expand Down
2 changes: 1 addition & 1 deletion apps/oxlint/src/raw_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{
use oxc_allocator::Allocator;
use oxc_linter::RuntimeFileSystem;

/// File system used by `oxlint2`.
/// File system used when JS plugins are in use.
///
/// Identical to `OsFileSystem`, except that `read_to_arena_str` reads the file's contents into
/// start of the allocator, instead of the end. This conforms to what raw transfer needs.
Expand Down
4 changes: 2 additions & 2 deletions dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"**/CHANGELOG.md",
"pnpm-workspace.yaml",
"pnpm-lock.yaml",
"napi/oxlint2/src-js/bindings.js",
"napi/oxlint2/src-js/bindings.d.ts",
"napi/oxlint/src-js/bindings.js",
"napi/oxlint/src-js/bindings.d.ts",
"napi/{transform,minify,playground}/index.js",
"napi/{parser,transform,minify,playground}/index.d.ts",
"napi/{parser,transform,minify,playground}/*.wasi-browser.js",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions napi/oxlint2/package.json → napi/oxlint/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "oxlint2",
"name": "oxlint",
"version": "0.1.0",
"bin": "dist/index.js",
"type": "module",
Expand All @@ -24,7 +24,7 @@
"repository": {
"type": "git",
"url": "https://github.com/oxc-project/oxc.git",
"directory": "napi/oxlint2"
"directory": "napi/oxlint"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
Expand Down
File renamed without changes.
File renamed without changes.
48 changes: 24 additions & 24 deletions napi/oxlint2/src-js/bindings.js → napi/oxlint/src-js/bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-android-arm64')
return require('oxlint-android-arm64')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -90,7 +90,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-android-arm-eabi')
return require('oxlint-android-arm-eabi')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -105,7 +105,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-win32-x64-msvc')
return require('oxlint-win32-x64-msvc')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -116,7 +116,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-win32-ia32-msvc')
return require('oxlint-win32-ia32-msvc')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -127,7 +127,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-win32-arm64-msvc')
return require('oxlint-win32-arm64-msvc')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -141,7 +141,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-darwin-universal')
return require('oxlint-darwin-universal')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -152,7 +152,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-darwin-x64')
return require('oxlint-darwin-x64')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -163,7 +163,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-darwin-arm64')
return require('oxlint-darwin-arm64')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -178,7 +178,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-freebsd-x64')
return require('oxlint-freebsd-x64')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -189,7 +189,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-freebsd-arm64')
return require('oxlint-freebsd-arm64')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -205,7 +205,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-x64-musl')
return require('oxlint-linux-x64-musl')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -216,7 +216,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-x64-gnu')
return require('oxlint-linux-x64-gnu')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -229,7 +229,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-arm64-musl')
return require('oxlint-linux-arm64-musl')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -240,7 +240,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-arm64-gnu')
return require('oxlint-linux-arm64-gnu')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -253,7 +253,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-arm-musleabihf')
return require('oxlint-linux-arm-musleabihf')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -264,7 +264,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-arm-gnueabihf')
return require('oxlint-linux-arm-gnueabihf')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -277,7 +277,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-riscv64-musl')
return require('oxlint-linux-riscv64-musl')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -288,7 +288,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-riscv64-gnu')
return require('oxlint-linux-riscv64-gnu')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -300,7 +300,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-ppc64-gnu')
return require('oxlint-linux-ppc64-gnu')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -311,7 +311,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-s390x-gnu')
return require('oxlint-linux-s390x-gnu')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -326,7 +326,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-arm64-ohos')
return require('oxlint-linux-arm64-ohos')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -337,7 +337,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-x64-ohos')
return require('oxlint-linux-x64-ohos')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -348,7 +348,7 @@ function requireNative() {
loadErrors.push(e)
}
try {
return require('oxlint2-linux-arm-ohos')
return require('oxlint-linux-arm-ohos')
} catch (e) {
loadErrors.push(e)
}
Expand All @@ -372,7 +372,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
}
if (!nativeBinding) {
try {
nativeBinding = require('oxlint2-wasm32-wasi')
nativeBinding = require('oxlint-wasm32-wasi')
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
loadErrors.push(err)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`oxlint2 CLI > should have UTF-16 spans in AST 1`] = `
exports[`oxlint CLI > should have UTF-16 spans in AST 1`] = `
"
! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html\\eslint(no-debugger)]8;;\\: \`debugger\` statement is not allowed
,-[index.js:1:1]
Expand Down Expand Up @@ -55,7 +55,7 @@ Found 3 warnings and 3 errors.
Finished in Xms on 1 file using X threads."
`;

exports[`oxlint2 CLI > should lint a directory with errors 1`] = `
exports[`oxlint CLI > should lint a directory with errors 1`] = `
"
x ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html\\eslint(no-debugger)]8;;\\: \`debugger\` statement is not allowed
,-[index.js:1:1]
Expand All @@ -68,12 +68,12 @@ Found 0 warnings and 1 error.
Finished in Xms on 1 file using X threads."
`;

exports[`oxlint2 CLI > should lint a directory without errors 1`] = `
exports[`oxlint CLI > should lint a directory without errors 1`] = `
"Found 0 warnings and 0 errors.
Finished in Xms on 1 file using X threads."
`;

exports[`oxlint2 CLI > should load a custom plugin 1`] = `
exports[`oxlint CLI > should load a custom plugin 1`] = `
"
x basic-custom-plugin(no-debugger): Unexpected Debugger Statement
,-[index.js:1:1]
Expand All @@ -92,7 +92,7 @@ Found 1 warning and 1 error.
Finished in Xms on 1 file using X threads."
`;

exports[`oxlint2 CLI > should load a custom plugin when configured in overrides 1`] = `
exports[`oxlint CLI > should load a custom plugin when configured in overrides 1`] = `
"
x basic-custom-plugin(no-debugger): Unexpected Debugger Statement
,-[index.js:1:1]
Expand All @@ -111,7 +111,7 @@ Found 1 warning and 1 error.
Finished in Xms on 1 file using X threads."
`;

exports[`oxlint2 CLI > should load a custom plugin with multiple files 1`] = `
exports[`oxlint CLI > should load a custom plugin with multiple files 1`] = `
"
x basic-custom-plugin(no-debugger): Unexpected Debugger Statement
,-[files/01.js:1:1]
Expand Down Expand Up @@ -377,7 +377,7 @@ Found 20 warnings and 20 errors.
Finished in Xms on 20 files using X threads."
`;

exports[`oxlint2 CLI > should receive data via \`context\` 1`] = `
exports[`oxlint CLI > should receive data via \`context\` 1`] = `
"
x context-plugin(log-context): id: context-plugin/log-context
,-[files/1.js:1:1]
Expand Down Expand Up @@ -419,29 +419,29 @@ Found 0 warnings and 6 errors.
Finished in Xms on 2 files using X threads."
`;

exports[`oxlint2 CLI > should report an error if a a rule is not found within a custom plugin (via overrides) 1`] = `
exports[`oxlint CLI > should report an error if a a rule is not found within a custom plugin (via overrides) 1`] = `
"Failed to build configuration.

x Rule 'missing' not found in plugin 'basic-custom-plugin'
"
`;

exports[`oxlint2 CLI > should report an error if a custom plugin cannot be loaded 1`] = `
exports[`oxlint CLI > should report an error if a custom plugin cannot be loaded 1`] = `
"Failed to parse configuration file.

x Failed to load external plugin: ./test_plugin
| Cannot find module './test_plugin'
"
`;

exports[`oxlint2 CLI > should report an error if a rule is not found within a custom plugin 1`] = `
exports[`oxlint CLI > should report an error if a rule is not found within a custom plugin 1`] = `
"Failed to parse configuration file.

x Rule 'unknown-rule' not found in plugin 'basic-custom-plugin'
"
`;

exports[`oxlint2 CLI > should report the correct severity when using a custom plugin 1`] = `
exports[`oxlint CLI > should report the correct severity when using a custom plugin 1`] = `
"
! basic-custom-plugin(no-debugger): Unexpected Debugger Statement
,-[index.js:1:1]
Expand All @@ -460,7 +460,7 @@ Found 2 warnings and 0 errors.
Finished in Xms on 1 file using X threads."
`;

exports[`oxlint2 CLI > should respect disable directives for custom plugin rules 1`] = `
exports[`oxlint CLI > should respect disable directives for custom plugin rules 1`] = `
"
x test-plugin(no-var): Use let or const instead of var
,-[index.js:1:1]
Expand Down Expand Up @@ -505,7 +505,7 @@ Found 0 warnings and 5 errors.
Finished in Xms on 1 file using X threads."
`;

exports[`oxlint2 CLI > should work with multiple rules 1`] = `
exports[`oxlint CLI > should work with multiple rules 1`] = `
"
x basic-custom-plugin(no-debugger): Unexpected Debugger Statement
,-[index.js:1:1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function normalizeOutput(output: string): string {
.replace(/using \d+ threads./, 'using X threads.');
}

describe('oxlint2 CLI', () => {
describe('oxlint CLI', () => {
it('should lint a directory without errors', async () => {
const { stdout, exitCode } = await runOxlint('test/fixtures/built_in_no_errors');
expect(exitCode).toBe(0);
Expand Down
File renamed without changes.
Loading
Loading