Skip to content

Commit 2f68d94

Browse files
authored
Migrate to oxlint and oxfmt v2 (#2130)
* Migrate to oxlint and oxfmt * Address review comments
1 parent 169ef75 commit 2f68d94

49 files changed

Lines changed: 3398 additions & 3773 deletions

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 oxlint and oxfmt
6+
0c1d00282ca619c3416ad819bdf53c0852b32415

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22
updates:
33
- package-ecosystem: npm
4-
directory: "/"
4+
directory: '/'
55
open-pull-requests-limit: 0
66
schedule:
77
interval: weekly

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ jobs:
3333
git config --global user.name "handlebars-lang"
3434
npm run publish:aws
3535
env:
36-
S3_BUCKET_NAME: "builds.handlebarsjs.com"
36+
S3_BUCKET_NAME: 'builds.handlebarsjs.com'
3737
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
3838
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}

.oxfmtrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/nicolo-ribaudo/oxfmt-config-schema/refs/heads/main/schema.json",
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"semi": true,
6+
"trailingComma": "es5",
7+
"printWidth": 80,
8+
"ignorePatterns": [
9+
".rvmrc",
10+
".DS_Store",
11+
"/tmp/",
12+
"*.sublime-project",
13+
"*.sublime-workspace",
14+
"npm-debug.log",
15+
"sauce_connect.log*",
16+
".idea",
17+
"yarn-error.log",
18+
"/coverage/",
19+
".nyc_output/",
20+
"/dist/",
21+
"/tests/integration/*/dist/",
22+
"/spec/expected/",
23+
"/spec/mustache",
24+
"/spec/vendor",
25+
"*.handlebars",
26+
"*.hbs"
27+
]
28+
}

.oxlintrc.json

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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+
".nyc_output/",
53+
"handlebars-release.tgz",
54+
"tests/integration/*/dist/",
55+
"spec/expected/",
56+
"spec/mustache",
57+
"spec/vendor",
58+
"node_modules",
59+
"types/"
60+
],
61+
"overrides": [
62+
{
63+
"files": ["lib/**/*.js"],
64+
"env": {
65+
"node": false,
66+
"browser": true
67+
}
68+
},
69+
{
70+
"files": ["spec/**/*.js"],
71+
"globals": {
72+
"CompilerContext": "readonly",
73+
"Handlebars": "writable",
74+
"handlebarsEnv": "readonly",
75+
"expectTemplate": "readonly",
76+
"suite": "readonly",
77+
"test": "readonly",
78+
"testBoth": "readonly",
79+
"raises": "readonly",
80+
"deepEqual": "readonly",
81+
"start": "readonly",
82+
"stop": "readonly",
83+
"ok": "readonly",
84+
"vi": "readonly",
85+
"strictEqual": "readonly",
86+
"define": "readonly",
87+
"expect": "readonly",
88+
"beforeEach": "readonly",
89+
"afterEach": "readonly",
90+
"describe": "readonly",
91+
"it": "readonly"
92+
},
93+
"rules": {
94+
"no-var": "off",
95+
"dot-notation": "off",
96+
"vitest/no-conditional-tests": "off"
97+
}
98+
},
99+
{
100+
"files": ["tasks/**/*.js"],
101+
"rules": {
102+
"node/no-process-env": "off",
103+
"prefer-const": "warn",
104+
"dot-notation": "error"
105+
}
106+
},
107+
{
108+
"files": ["tasks/tests/**/*.js"],
109+
"globals": {
110+
"describe": "readonly",
111+
"it": "readonly",
112+
"expect": "readonly",
113+
"beforeEach": "readonly",
114+
"afterEach": "readonly",
115+
"vi": "readonly"
116+
}
117+
},
118+
{
119+
"files": ["tests/bench/**/*.js"],
120+
"rules": {
121+
"no-console": "off",
122+
"no-var": "off"
123+
}
124+
},
125+
{
126+
"files": ["tests/integration/multi-nodejs-test/**/*.js"],
127+
"rules": {
128+
"no-console": "off",
129+
"no-var": "off"
130+
}
131+
},
132+
{
133+
"files": ["tests/browser/**/*.js"],
134+
"env": {
135+
"browser": true
136+
}
137+
},
138+
{
139+
"files": [
140+
"tests/integration/webpack-babel-test/src/**/*.js",
141+
"tests/integration/webpack-test/src/**/*.js"
142+
],
143+
"env": {
144+
"browser": true
145+
},
146+
"rules": {
147+
"no-var": "off"
148+
}
149+
}
150+
]
151+
}

.prettierignore

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

0 commit comments

Comments
 (0)