跳到主要内容

oxc

Oxlint

npm install --save-dev oxlint
.oxlintrc.json
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
package.json
{
"scripts": {
"lint": "oxlint",
"lint:fix": "oxlint --fix"
}
}

Oxfmt

npm install --save-dev oxfmt
.oxfmtrc.json
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"ignorePatterns": ["index.html"],
"printWidth": 120
}
package.json
{
"scripts": {
"fmt": "oxfmt",
"fmt:check": "oxfmt --check"
}
}