Skip to content

Commit 419de22

Browse files
committed
Migrate ESLint + Prettier to oxlint + oxfmt
1 parent 169ef75 commit 419de22

137 files changed

Lines changed: 10452 additions & 12655 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 64 deletions
This file was deleted.

.git-blame-ignore-revs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Upgrade to Prettier 2.7
22
3d228334530860a6e3f99dc10777c84bf22292c1
33
# Format markdown files with Prettier
4-
dfe2eaaf20f0b679d94e5a799757c4394d80f1cc
4+
dfe2eaaf20f0b679d94e5a799757c4394d80f1cc
5+
# Migrate to oxfmt and oxlint
6+
882780b032ea8294eb27be123145a29f370a7934

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ on:
99
jobs:
1010
lint:
1111
name: Lint
12-
runs-on: 'ubuntu-latest'
12+
runs-on: "ubuntu-latest"
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v6
1616

1717
- name: Setup Node.js
1818
uses: actions/setup-node@v6
1919
with:
20-
node-version: '24'
20+
node-version: "24"
2121

2222
- name: Install dependencies
2323
run: npm ci
@@ -31,9 +31,9 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
operating-system: ['ubuntu-latest', 'windows-latest']
34+
operating-system: ["ubuntu-latest", "windows-latest"]
3535
# https://nodejs.org/en/about/releases/
36-
node-version: ['20', '22', '24']
36+
node-version: ["20", "22", "24"]
3737

3838
steps:
3939
- name: Checkout
@@ -71,7 +71,7 @@ jobs:
7171
- name: Setup Node.js
7272
uses: actions/setup-node@v6
7373
with:
74-
node-version: '24'
74+
node-version: "24"
7575

7676
- name: Install dependencies
7777
run: npm ci

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ on:
66
branches:
77
- master
88
tags:
9-
- '*'
9+
- "*"
1010

1111
jobs:
1212
publish-aws-s3:
1313
name: Publish to AWS S3
14-
runs-on: 'ubuntu-latest'
15-
environment: 'builds.handlebarsjs.com.s3.amazonaws.com'
14+
runs-on: "ubuntu-latest"
15+
environment: "builds.handlebarsjs.com.s3.amazonaws.com"
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v6
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup Node.js
2323
uses: actions/setup-node@v6
2424
with:
25-
node-version: '24'
25+
node-version: "24"
2626

2727
- name: Install dependencies
2828
run: npm ci

.oxfmtrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/nicolo-ribaudo/oxfmt-config-schema/refs/heads/main/schema.json",
3+
"indentWidth": 2,
4+
"semicolons": "always",
5+
"quoteStyle": "single",
6+
"trailingCommas": "es5",
7+
"printWidth": 80
8+
}

.oxlintrc.json

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
3+
"plugins": ["eslint", "typescript", "unicorn", "oxc", "node", "vitest"],
4+
"categories": {
5+
"correctness": "error"
6+
},
7+
"rules": {
8+
"no-console": "warn",
9+
"no-func-assign": "off",
10+
"no-sparse-arrays": "off",
11+
12+
"default-case": "warn",
13+
"guard-for-in": "warn",
14+
"no-alert": "error",
15+
"no-caller": "error",
16+
"no-div-regex": "warn",
17+
"no-eval": "error",
18+
"no-extend-native": "error",
19+
"no-extra-bind": "error",
20+
"no-implied-eval": "error",
21+
"no-iterator": "error",
22+
"no-labels": "error",
23+
"no-lone-blocks": "error",
24+
"no-loop-func": "error",
25+
"no-multi-str": "warn",
26+
"no-global-assign": "error",
27+
"no-new": "error",
28+
"no-new-func": "error",
29+
"no-new-wrappers": "error",
30+
"no-proto": "error",
31+
"no-return-assign": "error",
32+
"no-script-url": "error",
33+
"no-self-compare": "error",
34+
"no-sequences": "error",
35+
"no-throw-literal": "error",
36+
"no-unused-expressions": "error",
37+
"no-warning-comments": "warn",
38+
"no-with": "error",
39+
"radix": "error",
40+
41+
"no-label-var": "error",
42+
"no-use-before-define": ["error", { "functions": false }],
43+
44+
"no-var": "error",
45+
46+
"node/no-process-env": "error"
47+
},
48+
"ignorePatterns": [
49+
"tmp/",
50+
"dist/",
51+
"coverage/",
52+
"tests/integration/*/dist/",
53+
"spec/expected/",
54+
"spec/vendor",
55+
"node_modules",
56+
"src/*.js",
57+
"types/"
58+
],
59+
"overrides": [
60+
{
61+
"files": ["lib/**/*.js"],
62+
"env": {
63+
"node": false,
64+
"browser": true
65+
}
66+
},
67+
{
68+
"files": ["spec/**/*.js"],
69+
"globals": {
70+
"CompilerContext": "readonly",
71+
"Handlebars": "writable",
72+
"handlebarsEnv": "readonly",
73+
"expectTemplate": "readonly",
74+
"suite": "readonly",
75+
"test": "readonly",
76+
"testBoth": "readonly",
77+
"raises": "readonly",
78+
"deepEqual": "readonly",
79+
"start": "readonly",
80+
"stop": "readonly",
81+
"ok": "readonly",
82+
"vi": "readonly",
83+
"strictEqual": "readonly",
84+
"define": "readonly",
85+
"expect": "readonly",
86+
"beforeEach": "readonly",
87+
"afterEach": "readonly",
88+
"describe": "readonly",
89+
"it": "readonly"
90+
},
91+
"rules": {
92+
"no-var": "off",
93+
"dot-notation": "off",
94+
"vitest/no-conditional-tests": "off"
95+
}
96+
},
97+
{
98+
"files": ["tasks/**/*.js"],
99+
"rules": {
100+
"node/no-process-env": "off",
101+
"prefer-const": "warn",
102+
"dot-notation": "error"
103+
}
104+
},
105+
{
106+
"files": ["tasks/tests/**/*.js"],
107+
"globals": {
108+
"describe": "readonly",
109+
"it": "readonly",
110+
"expect": "readonly",
111+
"beforeEach": "readonly",
112+
"afterEach": "readonly",
113+
"vi": "readonly"
114+
}
115+
},
116+
{
117+
"files": ["tests/bench/**/*.js"],
118+
"rules": {
119+
"no-console": "off",
120+
"no-var": "off"
121+
}
122+
},
123+
{
124+
"files": ["tests/integration/multi-nodejs-test/**/*.js"],
125+
"rules": {
126+
"no-console": "off",
127+
"no-var": "off"
128+
}
129+
},
130+
{
131+
"files": ["tests/browser/**/*.js"],
132+
"env": {
133+
"browser": true
134+
}
135+
},
136+
{
137+
"files": [
138+
"tests/integration/webpack-babel-test/src/**/*.js",
139+
"tests/integration/webpack-test/src/**/*.js"
140+
],
141+
"env": {
142+
"browser": true
143+
},
144+
"rules": {
145+
"no-var": "off"
146+
}
147+
}
148+
]
149+
}

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Ignore patterns for oxfmt (reads .prettierignore by default)
12
.rvmrc
23
.DS_Store
34
/tmp/
@@ -19,3 +20,7 @@ node_modules
1920
# Third-party or files that must remain unchanged
2021
/spec/expected/
2122
/spec/vendor
23+
24+
# Handlebars template files (not JavaScript)
25+
*.handlebars
26+
*.hbs

0 commit comments

Comments
 (0)