Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(linter): added support to run in Node.JS legacy versions #8648

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

luizwbr
Copy link
Contributor

@luizwbr luizwbr commented Jan 21, 2025

With a few adjustments It is possible to run oxlint in projects which use legacy Node.js versions, such as 8.x.x. Basically this is possible by removing spread operator in 'binpath' environment assemble and changing a catch command to inform an error variable.

Without this modification, we got always this error:

node_modules/oxlint/bin/oxlint:23
  } catch {
          ^

SyntaxError: Unexpected token {
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

Copy link

graphite-app bot commented Jan 21, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@luizwbr luizwbr changed the title linter: Added support to run in Node.JS legacy versions - 8.2.x Added support to run linter in Node.JS legacy versions - 8.2.x Jan 21, 2025
@luizwbr luizwbr changed the title Added support to run linter in Node.JS legacy versions - 8.2.x linter: added support to run in Node.JS legacy versions Jan 21, 2025
@luizwbr luizwbr changed the title linter: added support to run in Node.JS legacy versions feat: added support to run in Node.JS legacy versions Jan 21, 2025
@luizwbr luizwbr changed the title feat: added support to run in Node.JS legacy versions feat(linter): added support to run in Node.JS legacy versions Jan 21, 2025
@github-actions github-actions bot added the C-enhancement Category - New feature or request label Jan 21, 2025
@Sysix
Copy link
Collaborator

Sysix commented Jan 21, 2025

Hello 👋
I do not know if the team wants to support this, but you have 2 problems with this current state:

  • do not bump the version, the CI will auto bump it
  • you forgot to update engines inside package.json

npm/oxlint/bin/oxlint Outdated Show resolved Hide resolved
npm/oxlint/bin/oxlint Outdated Show resolved Hide resolved
@luizwbr
Copy link
Contributor Author

luizwbr commented Jan 23, 2025

Hello 👋 I do not know if the team wants to support this, but you have 2 problems with this current state:

  • do not bump the version, the CI will auto bump it
  • you forgot to update engines inside package.json

All done!

@Boshen
Copy link
Member

Boshen commented Jan 23, 2025

Thank you!

@Boshen Boshen merged commit 79ba9b5 into oxc-project:main Jan 23, 2025
14 checks passed
Boshen added a commit that referenced this pull request Jan 24, 2025
## [0.15.8] - 2025-01-24

### Features

- 79ba9b5 linter: Added support to run in Node.JS legacy versions
(#8648) (Luiz Felipe Weber)
- dcaebe6 linter: Add "strict" option to `promise/prefer-await-to-then`
rule (#8674) (Neil Fisher)
- 4ae568e linter: Add DiagnosticResult to the Reporters for receiving a
sub part result (#8666) (Alexander S.)
- 8a0eb2a oxlint: Add stylish formatter (#8607) (Andrew Powell)

### Bug Fixes

- 40316af linter: Fix github `endColumn` output (#8647) (Alexander S.)
- dc912fa linter: Added missing $schema property to default config
(#8625) (Tapan Prakash)

### Refactor

- a3dc4c3 crates: Clean up snapshot files (#8680) (Boshen)
- e66da9f isolated_declarations, linter, minifier, prettier, semantic,
transformer: Remove unnecessary `ref` / `ref mut` syntax (#8643)
(overlookmotel)
- 23b49a6 linter: Use `cow_to_ascii_lowercase` instead
`cow_to_lowercase` (#8678) (Boshen)
- b8d9a51 span: Deal only in owned `Atom`s (#8641) (overlookmotel)
- ac4f98e span: Derive `Copy` on `Atom` (#8596) (branchseer)
- 259a47b vscode: Move commands and `findBinary` to separate files
(#8605) (Alexander S.)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants