Skip to content

Commit c44d97a

Browse files
committed
chore: adopt oxlint
1 parent f7e10ce commit c44d97a

File tree

9 files changed

+340
-23
lines changed

9 files changed

+340
-23
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
8080
- run: |
8181
yarn copy --bump=major
82-
git commit -am 'chore: bump canary versions [skip ci]'
82+
git commit -am 'chore: release new version [skip ci]'
8383
cd dist
8484
npm publish
8585

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.oxlintrc.json

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["typescript", "import"],
4+
"categories": {
5+
"correctness": "off"
6+
},
7+
"ignorePatterns": ["**/node_modules", "**/dist", "**/coverage", "**/*.{js,mjs}", "**/*.d.ts"],
8+
"rules": {
9+
"constructor-super": "error",
10+
"for-direction": "error",
11+
"getter-return": "error",
12+
"no-async-promise-executor": "error",
13+
"no-case-declarations": "error",
14+
"no-class-assign": "error",
15+
"no-compare-neg-zero": "error",
16+
"no-cond-assign": "error",
17+
"no-const-assign": "error",
18+
"no-constant-binary-expression": "error",
19+
"no-constant-condition": "error",
20+
"no-control-regex": "error",
21+
"no-debugger": "error",
22+
"no-delete-var": "error",
23+
"no-dupe-class-members": "error",
24+
"no-dupe-else-if": "error",
25+
"no-dupe-keys": "error",
26+
"no-duplicate-case": "error",
27+
"no-empty": "error",
28+
"no-empty-character-class": "error",
29+
"no-empty-pattern": "error",
30+
"no-empty-static-block": "error",
31+
"no-ex-assign": "error",
32+
"no-extra-boolean-cast": "error",
33+
"no-fallthrough": "error",
34+
"no-func-assign": "error",
35+
"no-global-assign": "error",
36+
"no-import-assign": "error",
37+
"no-invalid-regexp": "error",
38+
"no-irregular-whitespace": "error",
39+
"no-loss-of-precision": "error",
40+
"no-misleading-character-class": "error",
41+
"no-new-native-nonconstructor": "error",
42+
"no-nonoctal-decimal-escape": "error",
43+
"no-obj-calls": "error",
44+
"no-prototype-builtins": "error",
45+
"no-redeclare": ["error"],
46+
"no-regex-spaces": "error",
47+
"no-self-assign": "error",
48+
"no-setter-return": "error",
49+
"no-shadow-restricted-names": "error",
50+
"no-sparse-arrays": "error",
51+
"no-this-before-super": "error",
52+
"no-undef": "error",
53+
"no-unexpected-multiline": "error",
54+
"no-unreachable": "error",
55+
"no-unsafe-finally": "error",
56+
"no-unsafe-negation": "error",
57+
"no-unsafe-optional-chaining": "error",
58+
"no-unused-labels": "error",
59+
"no-unused-private-class-members": "error",
60+
"no-useless-backreference": "error",
61+
"no-useless-catch": "error",
62+
"no-useless-escape": "error",
63+
"no-with": "error",
64+
"require-yield": "error",
65+
"use-isnan": "error",
66+
"valid-typeof": "error",
67+
"no-array-constructor": "error",
68+
"@typescript-eslint/no-duplicate-enum-values": "error",
69+
"@typescript-eslint/no-extra-non-null-assertion": "error",
70+
"@typescript-eslint/no-misused-new": "error",
71+
"@typescript-eslint/no-namespace": [
72+
"error",
73+
{
74+
"allowDeclarations": true
75+
}
76+
],
77+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
78+
"@typescript-eslint/no-this-alias": "error",
79+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
80+
"no-unused-expressions": "error",
81+
"@typescript-eslint/no-wrapper-object-types": "error",
82+
"@typescript-eslint/prefer-as-const": "error",
83+
"@typescript-eslint/prefer-namespace-keyword": "error",
84+
"@typescript-eslint/triple-slash-reference": "error",
85+
"@typescript-eslint/consistent-type-imports": "error",
86+
"@typescript-eslint/no-floating-promises": [
87+
"error",
88+
{
89+
"checkThenables": false
90+
}
91+
],
92+
"@typescript-eslint/adjacent-overload-signatures": "error",
93+
"@typescript-eslint/no-inferrable-types": "error",
94+
"@typescript-eslint/no-var-requires": "error",
95+
"@typescript-eslint/array-type": "error",
96+
"no-var": "error",
97+
"prefer-rest-params": "error",
98+
"prefer-spread": "error",
99+
"import/no-duplicates": [
100+
"error",
101+
{
102+
"prefer-inline": true
103+
}
104+
],
105+
"no-inner-declarations": "error",
106+
"eqeqeq": [
107+
"error",
108+
"always",
109+
{
110+
"null": "ignore"
111+
}
112+
],
113+
"no-console": "error",
114+
"no-throw-literal": "error",
115+
"yoda": "error",
116+
"curly": "error",
117+
"no-else-return": "error",
118+
"no-empty-function": "error",
119+
"no-useless-constructor": "error"
120+
},
121+
"overrides": [
122+
{
123+
"files": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
124+
"rules": {
125+
"constructor-super": "off",
126+
"getter-return": "off",
127+
"no-class-assign": "off",
128+
"no-const-assign": "off",
129+
"no-dupe-class-members": "off",
130+
"no-dupe-keys": "off",
131+
"no-func-assign": "off",
132+
"no-import-assign": "off",
133+
"no-new-native-nonconstructor": "off",
134+
"no-obj-calls": "off",
135+
"no-redeclare": "off",
136+
"no-setter-return": "off",
137+
"no-this-before-super": "off",
138+
"no-undef": "off",
139+
"no-unreachable": "off",
140+
"no-unsafe-negation": "off",
141+
"no-with": "off"
142+
}
143+
},
144+
{
145+
"files": ["tests/**/*"],
146+
"rules": {
147+
"@typescript-eslint/no-inferrable-types": "off",
148+
"@typescript-eslint/no-var-requires": "off",
149+
"@typescript-eslint/consistent-type-imports": "off",
150+
"no-console": [
151+
"error",
152+
{
153+
"allow": ["time", "timeEnd"]
154+
}
155+
],
156+
"no-control-regex": "off",
157+
"no-empty": "off",
158+
"import/no-duplicates": "off"
159+
}
160+
}
161+
]
162+
}

jest.config.mjs

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

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@
4141
"test": "vitest --run",
4242
"tsc-check-tests": "tsc --noEmit --project tests/tsconfig.json",
4343
"format": "oxfmt --write .",
44+
"lint": "oxlint --type-aware",
4445
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
45-
"release": "yarn build && cd dist && npm publish && cd ..",
46-
"coverage": "yarn test --coverage",
47-
"lint": "eslint src/**/*.ts"
46+
"coverage": "yarn test --coverage"
4847
},
4948
"commitlint": {
5049
"extends": [
@@ -73,6 +72,8 @@
7372
"eslint": "^9.39.2",
7473
"eslint-plugin-import": "^2.32.0",
7574
"oxfmt": "^0.18.0",
75+
"oxlint": "^1.33.0",
76+
"oxlint-tsgolint": "^0.9.1",
7677
"reflect-metadata": "^0.2.2",
7778
"rimraf": "^6.1.2",
7879
"rxjs": "^7.8.2",

src/mikro-orm-core.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
type OnApplicationShutdown,
1111
type Type,
1212
} from '@nestjs/common';
13+
// oxlint-disable-next-line consistent-type-imports
1314
import { ModuleRef } from '@nestjs/core';
1415

1516
import { forRoutesPath } from './middleware.helper.js';

src/mikro-orm.middleware.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// oxlint-disable-next-line consistent-type-imports
12
import { MikroORM, RequestContext } from '@mikro-orm/core';
23
import { Injectable, type NestMiddleware } from '@nestjs/common';
34

tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
22
"extends": "./tsconfig.build.json",
33
"include": ["src/**/*"],
4-
"compilerOptions": {
5-
"baseUrl": "."
6-
}
4+
"compilerOptions": {}
75
}

0 commit comments

Comments
 (0)