Skip to content

Migrate to oxlint and oxfmt v2#2130

Open
kibertoad wants to merge 2 commits intohandlebars-lang:masterfrom
kibertoad:feat/ox2
Open

Migrate to oxlint and oxfmt v2#2130
kibertoad wants to merge 2 commits intohandlebars-lang:masterfrom
kibertoad:feat/ox2

Conversation

@kibertoad
Copy link
Contributor

This preserves original formatting and style rules to a maximum extent possible, while introducing new ones and speeding up the check process dramatically.

@kibertoad
Copy link
Contributor Author

@jaylinski I think I messed up my branch in the previous attempt a little bit, this should be the good clean one

@kibertoad kibertoad changed the title Migrate to oxlint and oxfmt Migrate to oxlint and oxfmt v2 Mar 3, 2026
@jaylinski jaylinski requested a review from Copilot March 4, 2026 20:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the repository’s linting/formatting workflow from ESLint + Prettier to oxlint + oxfmt, updating configuration and reformatting affected code/docs to match the new tooling while aiming to preserve existing style rules.

Changes:

  • Replace ESLint/Prettier tooling with oxlint/oxfmt (new configs, updated scripts, updated lint-staged).
  • Remove per-directory ESLint config files and consolidate behavior via .oxlintrc.json overrides.
  • Apply repo-wide formatting updates across TS typings, docs/markdown, HTML fixtures, and small JS modernizations.

Reviewed changes

Copilot reviewed 38 out of 41 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
types/test.ts Formatting-only updates to TS type tests/examples.
types/index.d.ts Formatting-only updates to published typings.
tests/integration/webpack-test/src/.eslintrc.js Remove legacy ESLint config (now handled via oxlint).
tests/integration/webpack-test/package.json JSON reordering to match formatter output.
tests/integration/webpack-babel-test/src/.eslintrc.js Remove legacy ESLint config (now handled via oxlint).
tests/integration/webpack-babel-test/package.json JSON reordering to match formatter output.
tests/integration/webpack-babel-test/.babelrc Formatting normalization.
tests/integration/rollup-test/package.json JSON reordering to match formatter output.
tests/integration/multi-nodejs-test/package.json JSON reordering to match formatter output.
tests/integration/multi-nodejs-test/.eslintrc.js Remove legacy ESLint config (now handled via oxlint).
tests/browser/.eslintrc.js Remove legacy ESLint config (now handled via oxlint).
tests/bench/util/benchwarmer.js Replace new Array().join() with String#repeat() equivalents.
tests/bench/throughput.js Minor modern syntax (catch {}) / formatting changes.
tests/bench/.eslintrc.js Remove legacy ESLint config (now handled via oxlint).
tasks/util/git.js Minor modernization (startsWith) / formatting.
tasks/tests/.eslintrc.js Remove legacy ESLint config (now handled via oxlint).
tasks/metrics.js Minor modernization (startsWith) / formatting.
tasks/.eslintrc.js Remove legacy ESLint config (now handled via oxlint).
spec/umd.html HTML formatting updates (self-closing meta tags, indentation).
spec/umd-runtime.html HTML formatting updates (self-closing meta tags, indentation).
spec/source-map.js Minor modern syntax (catch {}) / formatting changes.
spec/partials.js Small test simplification (undefined literal) / formatting.
spec/index.html HTML formatting updates / line wrapping.
spec/.eslintrc.js Remove legacy ESLint config (now handled via oxlint).
runtime.d.ts Formatting normalization.
release-notes.md Markdown formatting cleanup (blank line removal).
prettier.config.js Remove Prettier config (replaced by .oxfmtrc.json).
package.json Switch scripts/devDependencies from ESLint+Prettier to oxlint+oxfmt; update lint-staged.
lib/handlebars/compiler/code-gen.js Add oxlint suppression for unused catch binding; keep existing logic.
lib/.eslintrc.js Remove legacy ESLint config (now handled via oxlint).
docs/compiler-api.md Markdown formatting cleanup (blank line removal).
README.md Markdown formatting normalization (headings, lists, wrapping).
.prettierignore Update ignore patterns (and document that oxfmt reads it).
.oxlintrc.json New consolidated oxlint configuration with overrides and ignores.
.oxfmtrc.json New oxfmt configuration matching prior formatting preferences.
.github/workflows/release.yml YAML formatting normalization (quoting).
.github/dependabot.yml YAML formatting normalization (quoting).
.git-blame-ignore-revs Add revision to ignore blame for the formatting migration.
.eslintrc.js Remove root ESLint config (replaced by .oxlintrc.json).
.eslintignore Remove ESLint ignore file (replaced by .oxlintrc.json ignores).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +48 to +52
"ignorePatterns": [
"tmp/",
"dist/",
"coverage/",
"tests/integration/*/dist/",
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.prettierignore still lists local/generated artifacts like .nyc_output and /handlebars-release.tgz, but .oxlintrc.json's ignorePatterns doesn't. If those artifacts exist locally (e.g., after running tests/packaging), oxlint may start linting them and produce unexpected failures/noise. Consider adding .nyc_output/ and handlebars-release.tgz (and any other generated artifacts you intend to ignore) to ignorePatterns to match the formatter ignore list and the previous .eslintignore behavior.

Copilot uses AI. Check for mistakes.
Copy link
Member

@jaylinski jaylinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR! Makes linting/formatting faster and reduces dev-dependencies.

"spec/mustache",
"spec/vendor",
"node_modules",
"src/*.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no more src-folder in the master-branch, please remove.

@@ -1,3 +1,4 @@
# Ignore patterns for oxfmt (reads .prettierignore by default)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't you add this config to .oxfmtrc.json?

"dustjs-linkedin": "^2.0.2",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.9.0",
"eslint-plugin-compat": "4.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking if we still need this plugin. We originally added it to avoid using new browser APIs that were not supported widely yet. I think it reads the browserslist-config below.

Maybe we can also check compatibility via a new build-tool?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants