Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dry-kiwis-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@badrap/libapp": patch
---

Switch from ESLint + Prettier to oxlint + oxfmt
1 change: 0 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ RUN apk add --no-cache \
ripgrep
RUN mkdir -p /workspace && chown node:node /workspace
USER node
RUN mkdir -p /workspace/node_modules /workspace/dist
12 changes: 2 additions & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,11 @@
},
"postCreateCommand": "npm ci",
"remoteUser": "node",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
"workspaceFolder": "/workspace",
"mounts": [
"type=volume,target=/workspace/node_modules",
"type=volume,target=/workspace/dist"
],
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ms-azuretools.vscode-docker"
]
"extensions": ["oxc.oxc-vscode"]
}
}
}
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ jobs:
node-version: 24
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm run check
3 changes: 1 addition & 2 deletions .github/workflows/version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ jobs:
# Allow caching, as this job can't write and doesn't produce any artifacts.
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm run check

changesets:
needs: check
Expand Down
7 changes: 7 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"sortImports": {
"newlinesBetween": false
}
}
105 changes: 105 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript"],
"categories": {
"correctness": "error",
"suspicious": "error",
"pedantic": "error"
},
"options": {
"denyWarnings": true,
"reportUnusedDisableDirectives": "warn",
"typeAware": true,
"typeCheck": true
},
"rules": {
// category: "correctness" (overrides, enabled in categories)
"@typescript-eslint/restrict-template-expressions": [
"error",
{
"allowAny": false,
"allowArray": false,
"allowBoolean": false,
"allowNever": false,
"allowNullish": false,
"allowNumber": true,
"allowRegExp": false
}
],

// category: "suspicious" (overrides, enabled in categories)
"no-shadow": "off",
"@typescript-eslint/no-unsafe-type-assertion": "off",

// category: "pedantic" (overrides, enabled in categories)
"array-callback-return": "off",
"eqeqeq": ["error", "smart"],
"max-classes-per-file": "off",
"max-depth": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"no-else-return": "off",
"no-inline-comments": "off",
"no-negated-condition": "off",
"require-await": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
"@typescript-eslint/restrict-plus-operands": [
"error",
{
"allowAny": false,
"allowBoolean": false,
"allowNullish": false,
"allowNumberAndString": false,
"allowRegExp": false
}
],
"@typescript-eslint/return-await": [
"error",
"error-handling-correctness-only"
],
"@typescript-eslint/strict-boolean-expressions": "off",

// category: "restriction" (not enabled via categories)
"no-empty": "error",
"no-empty-function": "error",
"no-regex-spaces": "error",
"no-var": "error",
"no-console": "warn",
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/no-namespace": ["error", { "allowDeclarations": true }],
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/non-nullable-type-assertion-style": "error",
"@typescript-eslint/prefer-literal-enum-member": "error",
"@typescript-eslint/use-unknown-in-catch-callback-variable": "error",

// category: "style" (not enabled via categories)
"no-multi-assign": "error",
"no-return-assign": "error",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/class-literal-property-style": "error",
"@typescript-eslint/consistent-generic-constructors": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-reduce-type-parameter": "error",

// category: "nursery" (not enabled via categories)
"no-unreachable": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-unnecessary-type-parameters": "error",
"@typescript-eslint/no-useless-default-assignment": "error",
"@typescript-eslint/prefer-find": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-regexp-exec": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error"
}
}
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.fixAll.oxc": "always"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.formatOnSaveMode": "file",
"files.exclude": {
"node_modules": true,
"dist": true,
".cache": true
},
"typescript.tsdk": "node_modules/typescript/lib"
"js/ts.tsdk.path": "node_modules/typescript/lib"
}
78 changes: 0 additions & 78 deletions eslint.config.mjs

This file was deleted.

Loading
Loading