Migrate to oxfmt and oxlint#2129
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates formatting and linting from Prettier/ESLint to oxfmt/oxlint, aiming to preserve existing style while speeding up checks and introducing updated rules/configuration.
Changes:
- Replaced ESLint + Prettier setup with oxlint and oxfmt (new configs, updated scripts, removed old configs/ignores).
- Reformatted a large portion of JS/TS/MD files to align with the new formatter output.
- Updated CI and developer workflows to run the new lint/format commands.
Reviewed changes
Copilot reviewed 133 out of 137 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.js | Reformatted Vitest config to new quote/format style. |
| types/test.ts | Reformatted TS typing tests to oxfmt output. |
| types/index.d.ts | Reformatted type declarations and adjusted formatting consistency. |
| tests/print-script.js | Reformatted debug utility script. |
| tests/integration/webpack-test/webpack.config.js | Reformatted webpack integration config. |
| tests/integration/webpack-test/src/test-template.handlebars | Trimmed/normalized template file formatting. |
| tests/integration/webpack-test/src/handlebars-wildcard-import-test.js | Reformatted integration test source. |
| tests/integration/webpack-test/src/handlebars-wildcard-import-pre-4.2-test.js | Reformatted integration test source. |
| tests/integration/webpack-test/src/handlebars-runtime-test.js | Reformatted runtime integration test. |
| tests/integration/webpack-test/src/handlebars-require-vs-import-test.js | Reformatted require vs import test. |
| tests/integration/webpack-test/src/handlebars-loader-test.js | Reformatted loader integration test. |
| tests/integration/webpack-test/src/handlebars-esm-import-test.js | Reformatted ESM import test. |
| tests/integration/webpack-test/src/handlebars-default-import-test.js | Reformatted default import test. |
| tests/integration/webpack-test/src/handlebars-default-import-pre-4.2-test.js | Reformatted legacy default import test. |
| tests/integration/webpack-test/src/.eslintrc.js | Removed per-subproject ESLint config (obsolete with oxlint). |
| tests/integration/webpack-test/package.json | Normalized JSON formatting/order. |
| tests/integration/webpack-babel-test/webpack.config.js | Reformatted webpack+babel integration config. |
| tests/integration/webpack-babel-test/src/handlebars-inline-precompile-test.js | Reformatted inline-precompile test. |
| tests/integration/webpack-babel-test/src/.eslintrc.js | Removed per-subproject ESLint config (obsolete with oxlint). |
| tests/integration/webpack-babel-test/package.json | Normalized JSON formatting/order. |
| tests/integration/webpack-babel-test/.babelrc | Normalized JSON formatting and comment indentation. |
| tests/integration/rollup-test/src/index.js | Reformatted rollup integration source. |
| tests/integration/rollup-test/rollup.config.js | Reformatted rollup config. |
| tests/integration/rollup-test/package.json | Normalized JSON formatting/order. |
| tests/integration/multi-nodejs-test/run-handlebars.js | Reformatted multi-node integration runner. |
| tests/integration/multi-nodejs-test/package.json | Normalized JSON formatting/order. |
| tests/integration/multi-nodejs-test/.eslintrc.js | Removed per-subproject ESLint config (obsolete with oxlint). |
| tests/browser/tests/lib.spec.js | Reformatted browser smoke tests. |
| tests/browser/playwright.config.js | Reformatted Playwright config. |
| tests/browser/.eslintrc.js | Removed per-subproject ESLint config (obsolete with oxlint). |
| tests/bench/util/template-runner.js | Reformatted benchmark runner utility. |
| tests/bench/util/benchwarmer.js | Reformatted benchmark helper; modernized some string building. |
| tests/bench/throughput.js | Reformatted throughput benchmark. |
| tests/bench/templates/variables.js | Reformatted benchmark template fixture. |
| tests/bench/templates/subexpression.js | Reformatted benchmark template fixture. |
| tests/bench/templates/string.js | Reformatted benchmark template fixture. |
| tests/bench/templates/paths.js | Reformatted benchmark template fixture. |
| tests/bench/templates/partial.js | Reformatted benchmark template fixture. |
| tests/bench/templates/partial-recursion.js | Reformatted benchmark template fixture. |
| tests/bench/templates/object.js | Reformatted benchmark template fixture. |
| tests/bench/templates/object-mustache.js | Reformatted benchmark template fixture. |
| tests/bench/templates/index.js | Reformatted benchmark template index. |
| tests/bench/templates/depth-2.js | Reformatted benchmark template fixture. |
| tests/bench/templates/depth-1.js | Reformatted benchmark template fixture. |
| tests/bench/templates/data.js | Reformatted benchmark template fixture. |
| tests/bench/templates/complex.js | Reformatted benchmark template fixture. |
| tests/bench/templates/complex.handlebars | Replaced legacy inverse markers with {{else}} formatting. |
| tests/bench/templates/array-mustache.js | Reformatted benchmark template fixture. |
| tests/bench/templates/array-each.js | Reformatted benchmark template fixture. |
| tests/bench/templates/arguments.js | Reformatted benchmark template fixture. |
| tests/bench/precompile-size.js | Reformatted benchmark script. |
| tests/bench/index.js | Reformatted benchmark index. |
| tests/bench/dist-size.js | Reformatted benchmark script. |
| tests/bench/.eslintrc.js | Removed bench ESLint override config (obsolete with oxlint). |
| tasks/version.js | Reformatted task script and string literals. |
| tasks/util/git.js | Reformatted utility and adjusted minor string logic. |
| tasks/util/exec-file.js | Reformatted utility. |
| tasks/tests/git.test.js | Reformatted tests to new style. |
| tasks/tests/bin.test.js | Reformatted tests to new style. |
| tasks/tests/.eslintrc.js | Removed tasks tests ESLint globals (replaced by oxlint overrides). |
| tasks/publish-to-aws.js | Reformatted AWS publish task. |
| tasks/metrics.js | Reformatted metrics task and minor string handling. |
| tasks/.eslintrc.js | Removed tasks ESLint override config (obsolete with oxlint). |
| spec/whitespace-control.js | Reformatted spec tests. |
| spec/utils.js | Reformatted spec tests. |
| spec/umd.html | Reformatted HTML and JS snippets (self-closing meta tags, quotes). |
| spec/umd-runtime.html | Reformatted HTML and JS snippets (self-closing meta tags, quotes). |
| spec/subexpressions.js | Reformatted spec tests. |
| spec/strict.js | Reformatted spec tests. |
| spec/spec.js | Reformatted spec runner. |
| spec/source-map.js | Reformatted and modernized catch syntax. |
| spec/runtime.js | Reformatted spec tests. |
| spec/require.js | Reformatted require tests. |
| spec/mustache | Updated mustache spec submodule reference. |
| spec/javascript-compiler.js | Reformatted compiler API tests. |
| spec/index.html | Reformatted HTML and JS snippets (self-closing meta tags, quotes). |
| spec/env/node.js | Reformatted node test env script. |
| spec/env/common.js | Reformatted shared spec helpers. |
| spec/env/browser.js | Reformatted browser test env script. |
| spec/env/browser-vitest.js | Reformatted vitest browser env script. |
| spec/env/browser-vitest-pre.js | Reformatted vitest browser pre-setup script. |
| spec/compiler.js | Reformatted compiler specs. |
| spec/ast.js | Reformatted AST specs. |
| spec/.eslintrc.js | Removed spec ESLint globals/rules (replaced by oxlint overrides). |
| runtime.js | Reformatted runtime alias file. |
| runtime.d.ts | Reformatted and normalized module declaration. |
| release-notes.md | Reformatted markdown and code snippet quoting. |
| prettier.config.js | Removed Prettier config (replaced by oxfmt). |
| package.json | Switched scripts/deps from Prettier/ESLint to oxfmt/oxlint; updated lint-staged; reordered metadata. |
| lib/precompiler.js | Reformatted and updated string literals/trailing commas. |
| lib/index.js | Reformatted require paths and string literals. |
| lib/handlebars/utils.js | Reformatted and modified escape map (behavioral change). |
| lib/handlebars/safe-string.js | Reformatted string coercion. |
| lib/handlebars/runtime.js | Reformatted runtime module. |
| lib/handlebars/logger.js | Reformatted logger and string literals. |
| lib/handlebars/internal/wrapHelper.js | Reformatted type checks. |
| lib/handlebars/internal/proto-access.js | Reformatted proto-access logic and messages. |
| lib/handlebars/helpers/with.js | Reformatted helper registration and errors. |
| lib/handlebars/helpers/lookup.js | Reformatted helper registration. |
| lib/handlebars/helpers/log.js | Reformatted helper registration. |
| lib/handlebars/helpers/if.js | Reformatted helper registration and internal access. |
| lib/handlebars/helpers/helper-missing.js | Reformatted helper registration and error formatting. |
| lib/handlebars/helpers/each.js | Reformatted helper and minor string init changes. |
| lib/handlebars/helpers/block-helper-missing.js | Reformatted helper registration and imports. |
| lib/handlebars/helpers.js | Reformatted imports. |
| lib/handlebars/decorators/inline.js | Reformatted decorator registration. |
| lib/handlebars/decorators.js | Reformatted imports. |
| lib/handlebars/compiler/compiler.js | Reformatted compiler implementation and string literals. |
| lib/handlebars/compiler/code-gen.js | Reformatted codegen module and added oxlint suppression comment. |
| lib/handlebars/compiler/ast.js | Reformatted AST helper checks. |
| lib/handlebars/base.js | Reformatted base module constants and messages. |
| lib/handlebars.runtime.js | Reformatted runtime entry and default export key access. |
| lib/handlebars.js | Reformatted main ESM entry and default export key access. |
| lib/.eslintrc.js | Removed lib ESLint override (obsolete with oxlint). |
| docs/compiler-api.md | Reformatted docs and code samples. |
| bin/handlebars.js | Reformatted CLI options definitions. |
| README.md | Converted setext headings to ATX headings and reformatted examples/lists. |
| Gruntfile.js | Reformatted task configuration and strings. |
| .prettierignore | Updated to act as oxfmt ignore source; added ignore patterns for template files. |
| .oxlintrc.json | Added oxlint configuration with env/rule overrides. |
| .oxfmtrc.json | Added oxfmt configuration. |
| .github/workflows/release.yml | Normalized YAML quoting/style. |
| .github/workflows/ci.yml | Normalized YAML quoting/style. |
| .git-blame-ignore-revs | Added formatter migration revision to ignore list. |
| .eslintrc.js | Removed ESLint config (replaced by oxlint). |
| .eslintignore | Removed ESLint ignore file (replaced by oxlint ignorePatterns / .prettierignore usage). |
Comments suppressed due to low confidence (2)
lib/handlebars/utils.js:1
- The HTML escape entity mappings for
&,<,>, and\"lost their trailing semicolons (e.g.&instead of&). This changes escaping output and will break HTML validity and existing expectations/tests (e.g.foo<&...). Restore the correct entity strings with semicolons (keep the ones that already have them like').
spec/javascript-compiler.js:1 - This array literal is now invalid / unintended JavaScript due to the comma operator inside parentheses:
[('123test', 'abc()', 'abc.cde')]evaluates to['abc.cde']. It should be an array of three strings so each invalid variable name is tested. Replace it with a normal array literal containing the three string entries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.oxfmtrc.json
Outdated
| "$schema": "https://raw.githubusercontent.com/nicolo-ribaudo/oxfmt-config-schema/refs/heads/main/schema.json", | ||
| "indentWidth": 2, | ||
| "semicolons": "always", | ||
| "quoteStyle": "single", |
There was a problem hiding this comment.
The configured quoteStyle is single, but many formatted changes in this PR use double quotes in JS/TS (e.g. imports and string literals). This mismatch will cause ongoing churn (format runs flipping quotes back/forth) or indicate the config isn't being picked up. Align the oxfmt config with the repository's actual formatted output (either switch quoteStyle to double or re-run oxfmt so code matches single).
| "quoteStyle": "single", | |
| "quoteStyle": "double", |
|
superseded by #2130 |
This preserves original formatting and style rules to a maximum extent possible, while introducing new ones and speeding up the check process dramatically.