chore: migrate oxlint & oxfmt (#15464)

#### PR Dependency Tree


* **PR #15464** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Replaced the project’s formatting and linting workflow with Oxfmt and
Oxlint.
* Added shared formatting and linting configuration, editor integration,
and updated automated checks.
* Updated generated files, scripts, and lint guidance to use the new
tooling.

* **Style**
* Reformatted templates, source code, examples, and configuration files
for consistent readability.
  * No user-facing functionality or rendering behavior changed.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2026-08-10 23:51:28 +08:00
committed by GitHub
parent 749c83cd8e
commit 0c7b20dc18
292 changed files with 3372 additions and 2866 deletions

View File

@@ -3,9 +3,27 @@
"jsPlugins": [
"eslint-plugin-simple-import-sort",
"eslint-plugin-sonarjs",
"eslint-plugin-lit"
"eslint-plugin-lit",
{
"name": "import-x-js",
"specifier": "eslint-plugin-import-x"
},
{
"name": "react-js",
"specifier": "eslint-plugin-react"
},
{
"name": "react-hooks-js",
"specifier": "eslint-plugin-react-hooks"
}
],
"plugins": ["import", "react", "typescript", "unicorn", "promise"],
"settings": {
"_comment": "TODO: Restore rxjs/finnish when Oxlint JS plugins support type-aware rules.",
"react": {
"version": "19.2.1"
}
},
"categories": {
"correctness": "error",
"perf": "error"
@@ -66,8 +84,19 @@
"no-unused-private-class-members": "error",
"no-useless-backreference": "error",
"react/display-name": "error",
"react-js/no-deprecated": "error",
"react/rules-of-hooks": "error",
"react/exhaustive-deps": "warn",
"react-hooks-js/component-hook-factories": "error",
"react-hooks-js/preserve-manual-memoization": "error",
"react-hooks-js/incompatible-library": "warn",
"react-hooks-js/globals": "error",
"react-hooks-js/error-boundaries": "error",
"react-hooks-js/purity": "error",
"react-hooks-js/set-state-in-render": "error",
"react-hooks-js/unsupported-syntax": "warn",
"react-hooks-js/config": "error",
"react-hooks-js/gating": "error",
"typescript/prefer-for-of": "error",
"typescript/no-unsafe-function-type": "error",
"typescript/no-wrapper-object-types": "error",
@@ -162,6 +191,7 @@
"no-useless-catch": "error",
"no-async-promise-executor": "error",
"no-unreachable": "error",
"no-unreachable-loop": "error",
"no-duplicate-case": "error",
"no-empty-pattern": "error",
"no-unused-labels": "error",
@@ -399,6 +429,67 @@
"lit/binding-positions": "off",
"lit/no-invalid-html": "off"
}
},
{
"files": [
"packages/**/*.{ts,tsx}",
"tools/**/*.{ts,tsx}",
"blocksuite/**/*.{ts,tsx}"
],
"rules": {
"import-x-js/no-extraneous-dependencies": [
"error",
{
"includeInternal": true
}
]
}
},
{
"files": ["packages/frontend/admin/**/*"],
"rules": {
"import-x-js/no-extraneous-dependencies": [
"error",
{
"includeInternal": true,
"whitelist": ["@affine/admin"]
}
]
}
},
{
"files": ["packages/frontend/core/**/*"],
"rules": {
"import-x-js/no-extraneous-dependencies": [
"error",
{
"includeInternal": true,
"whitelist": ["@affine/core"]
}
]
}
},
{
"files": ["packages/frontend/component/**/*"],
"rules": {
"import-x-js/no-extraneous-dependencies": [
"error",
{
"includeInternal": true,
"whitelist": ["@affine/component"]
}
]
}
},
{
"files": [
"packages/frontend/apps/electron/scripts/**/*",
"tests/blocksuite/**/*.{ts,tsx}",
"blocksuite/**/__tests__/**/*.{ts,tsx}"
],
"rules": {
"import-x-js/no-extraneous-dependencies": "off"
}
}
]
}