Skip to content
Open
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
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ gh get timobechtel/style templates/.oxfmtrc.json
> Faster ESLint alternative. 5x faster in personal testing.

```bash
npm i -D oxlint
npm i -D oxlint @oxlint/plugins oxlint-plugin-complexity
```

Core:
Expand All @@ -54,6 +54,7 @@ gh get timobechtel/style templates/.oxlintrc.jsonc
```

- [oxlint core template](https://github.com/TimoBechtel/style/blob/main/templates/.oxlintrc.jsonc)
- Includes the `oxlint-plugin-complexity` rule with sensible defaults (`cyclomatic: 20`, `cognitive: 15`, `minLines: 15`) to catch overly complex functions without flagging short helpers.

React:

Expand All @@ -62,23 +63,24 @@ gh get timobechtel/style templates/react/.oxlintrc.jsonc
```

- [oxlint react template](https://github.com/TimoBechtel/style/blob/main/templates/react/.oxlintrc.jsonc)
- React projects inherit the same complexity checks from the shared core config.

<details>
<summary>Migrating to Oxlint? - `File '@timobechtel/style/tsconfig/core' not found.`</summary>

When migrating from ESLint to Oxlint, you might need to update the `tsconfig.json` file:
When migrating from ESLint to Oxlint, you might need to update the `tsconfig.json` file:

```diff
- "extends": ["@timobechtel/style/tsconfig/core"]
+ "extends": ["@timobechtel/style/tsconfig/core.json"]
```
```diff
- "extends": ["@timobechtel/style/tsconfig/core"]
+ "extends": ["@timobechtel/style/tsconfig/core.json"]
```

```diff
- "extends": ["@timobechtel/style/tsconfig/react"]
+ "extends": ["@timobechtel/style/tsconfig/react.json"]
```
```diff
- "extends": ["@timobechtel/style/tsconfig/react"]
+ "extends": ["@timobechtel/style/tsconfig/react.json"]
```

> tsgolint requires a file extension to resolve the config file.
> tsgolint requires a file extension to resolve the config file.

</details>

Expand Down
Binary file modified bun.lockb
Binary file not shown.
11 changes: 11 additions & 0 deletions oxlint/core.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"oxc",
"import"
],
"jsPlugins": [
"oxlint-plugin-complexity"
],
"categories": {
"correctness": "error",
"suspicious": "error",
Expand Down Expand Up @@ -187,6 +190,14 @@

// report duplicate code in branches
"oxc/branches-sharing-code": "warn",
"complexity/complexity": [
"warn",
{
"cyclomatic": 20,
"cognitive": 15,
"minLines": 15
}
],
// prevent mixing value and non-value returns in functions
"typescript/consistent-return": "warn",
"typescript/no-unnecessary-qualifier": "warn",
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@
"semantic-release": "^25.0.3",
"typescript": "^5.9.3",
"oxlint": "^1.55.0",
"oxfmt": "^0.40.0"
"oxfmt": "^0.40.0",
"@oxlint/plugins": "^1.63.0",
"oxlint-plugin-complexity": "^2.1.2"
},
"peerDependencies": {
"eslint": "^9.39.3",
"prettier": "^3.8.1",
"semantic-release": "^25.0.3",
"typescript": "^5.9.3",
"oxlint": "^1.55.0",
"oxfmt": "^0.40.0"
"oxfmt": "^0.40.0",
"@oxlint/plugins": "^1.63.0",
"oxlint-plugin-complexity": "^2.1.2"
},
"dependencies": {
"@eslint/js": "^9.39.3",
Expand Down