Skip to content

Commit 215b647

Browse files
committed
chore: strengthen linting and formatting
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
1 parent a14dd8e commit 215b647

20 files changed

Lines changed: 1156 additions & 182 deletions

‎.oxfmtrc.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3-
"semi": false,
43
"arrowParens": "avoid",
5-
"singleQuote": false,
6-
"sortImports": true
4+
"semi": false,
5+
"sortImports": true,
6+
"ignorePatterns": ["dist/**", "node_modules/**", "pnpm-lock.yaml"]
77
}

‎knip.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@6/schema.json",
3+
"entry": ["src/certs-cli.ts", "test/**/*.test.ts"],
4+
"project": ["src/**/*.ts", "test/**/*.ts"]
5+
}

‎oxlint.json‎

Lines changed: 259 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,271 @@
11
{
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import", "promise", "node", "jsdoc"],
4+
"categories": {
5+
"correctness": "error",
6+
"perf": "error"
7+
},
38
"rules": {
49
"eslint/no-unused-vars": [
510
"error",
611
{
7-
"args": "none",
8-
"caughtErrors": "none",
12+
"args": "all",
13+
"argsIgnorePattern": "^_",
14+
"caughtErrors": "all",
15+
"caughtErrorsIgnorePattern": "^_",
16+
"destructuredArrayIgnorePattern": "^_",
17+
"ignoreRestSiblings": true,
18+
"varsIgnorePattern": "^_",
919
"fix": {
1020
"imports": "fix"
1121
}
1222
}
13-
]
23+
],
24+
"typescript/consistent-type-imports": "error",
25+
"typescript/no-explicit-any": "error",
26+
"typescript/no-unsafe-assignment": "error",
27+
"typescript/no-unsafe-call": "error",
28+
"typescript/no-unsafe-member-access": "error",
29+
"typescript/no-unsafe-return": "error",
30+
"typescript/no-unsafe-argument": "error",
31+
"typescript/ban-ts-comment": [
32+
"error",
33+
{
34+
"ts-expect-error": "allow-with-description",
35+
"ts-ignore": true,
36+
"ts-nocheck": true
37+
}
38+
],
39+
"typescript/no-namespace": "error",
40+
"typescript/no-require-imports": "error",
41+
"typescript/no-var-requires": "error",
42+
"typescript/no-import-type-side-effects": "error",
43+
"typescript/no-non-null-assertion": "error",
44+
"typescript/no-confusing-non-null-assertion": "error",
45+
"typescript/no-unsafe-enum-comparison": "error",
46+
"typescript/no-unsafe-function-type": "error",
47+
"typescript/no-empty-object-type": "error",
48+
"typescript/no-invalid-void-type": [
49+
"error",
50+
{
51+
"allowAsThisParameter": true
52+
}
53+
],
54+
"typescript/no-unnecessary-type-assertion": "error",
55+
"typescript/no-unnecessary-type-constraint": "error",
56+
"typescript/no-unnecessary-type-parameters": "error",
57+
"typescript/no-unnecessary-template-expression": "error",
58+
"typescript/no-unnecessary-boolean-literal-compare": "error",
59+
"typescript/no-mixed-enums": "error",
60+
"typescript/non-nullable-type-assertion-style": "error",
61+
"typescript/prefer-ts-expect-error": "error",
62+
"typescript/no-extraneous-class": "error",
63+
"typescript/consistent-type-exports": "error",
64+
"typescript/no-deprecated": "error",
65+
"typescript/no-misused-promises": "error",
66+
"typescript/only-throw-error": "error",
67+
"typescript/prefer-promise-reject-errors": "error",
68+
"typescript/require-await": "error",
69+
"typescript/return-await": ["error", "in-try-catch"],
70+
"typescript/switch-exhaustiveness-check": [
71+
"error",
72+
{
73+
"considerDefaultExhaustiveForUnions": true
74+
}
75+
],
76+
"typescript/strict-boolean-expressions": [
77+
"error",
78+
{
79+
"allowNullableObject": false,
80+
"allowNumber": false,
81+
"allowString": false
82+
}
83+
],
84+
"typescript/no-confusing-void-expression": [
85+
"error",
86+
{
87+
"ignoreVoidOperator": true,
88+
"ignoreArrowShorthand": true
89+
}
90+
],
91+
"typescript/no-unsafe-type-assertion": "error",
92+
"typescript/no-unnecessary-condition": "error",
93+
"typescript/prefer-optional-chain": "error",
94+
"typescript/prefer-nullish-coalescing": [
95+
"error",
96+
{
97+
"ignorePrimitives": true
98+
}
99+
],
100+
"typescript/prefer-includes": "error",
101+
"typescript/prefer-find": "error",
102+
"typescript/prefer-string-starts-ends-with": "error",
103+
"typescript/promise-function-async": "error",
104+
"typescript/restrict-plus-operands": "error",
105+
"typescript/related-getter-setter-pairs": "error",
106+
"typescript/use-unknown-in-catch-callback-variable": "error",
107+
"typescript/adjacent-overload-signatures": "error",
108+
"typescript/consistent-generic-constructors": "error",
109+
"typescript/consistent-indexed-object-style": "error",
110+
"typescript/consistent-type-assertions": [
111+
"error",
112+
{
113+
"assertionStyle": "as",
114+
"objectLiteralTypeAssertions": "never"
115+
}
116+
],
117+
"typescript/array-type": "error",
118+
"typescript/method-signature-style": ["error", "property"],
119+
"typescript/no-inferrable-types": "error",
120+
"typescript/no-empty-interface": "error",
121+
"import/no-duplicates": "error",
122+
"import/no-self-import": "error",
123+
"import/no-cycle": "error",
124+
"import/no-commonjs": "error",
125+
"import/no-amd": "error",
126+
"import/no-webpack-loader-syntax": "error",
127+
"import/no-absolute-path": "error",
128+
"import/no-empty-named-blocks": "error",
129+
"import/no-mutable-exports": "error",
130+
"import/no-anonymous-default-export": "error",
131+
"import/first": "error",
132+
"import/newline-after-import": "error",
133+
"promise/always-return": "error",
134+
"promise/catch-or-return": "error",
135+
"promise/no-return-wrap": "error",
136+
"promise/param-names": "error",
137+
"promise/no-return-in-finally": "error",
138+
"promise/no-promise-in-callback": "error",
139+
"promise/no-nesting": "error",
140+
"promise/prefer-await-to-then": "error",
141+
"promise/spec-only": "error",
142+
"node/no-exports-assign": "error",
143+
"node/no-new-require": "error",
144+
"node/no-path-concat": "error",
145+
"node/global-require": "error",
146+
"node/callback-return": "error",
147+
"unicorn/catch-error-name": "error",
148+
"unicorn/consistent-function-scoping": "error",
149+
"unicorn/explicit-length-check": "error",
150+
"unicorn/no-array-reduce": "error",
151+
"unicorn/no-lonely-if": "error",
152+
"unicorn/no-nested-ternary": "error",
153+
"unicorn/no-useless-undefined": "error",
154+
"unicorn/no-useless-promise-resolve-reject": "error",
155+
"unicorn/prefer-code-point": "error",
156+
"unicorn/prefer-date-now": "error",
157+
"unicorn/prefer-export-from": "error",
158+
"unicorn/prefer-includes": "error",
159+
"unicorn/prefer-modern-math-apis": "error",
160+
"unicorn/prefer-negative-index": "error",
161+
"unicorn/prefer-node-protocol": "error",
162+
"unicorn/prefer-number-properties": "error",
163+
"unicorn/prefer-optional-catch-binding": "error",
164+
"unicorn/prefer-string-replace-all": "error",
165+
"unicorn/prefer-string-slice": "error",
166+
"unicorn/prefer-string-trim-start-end": "error",
167+
"unicorn/relative-url-style": ["error", "never"],
168+
"unicorn/require-number-to-fixed-digits-argument": "error",
169+
"unicorn/switch-case-braces": ["error", "avoid"],
170+
"unicorn/throw-new-error": "error",
171+
"unicorn/escape-case": "error",
172+
"unicorn/no-hex-escape": "error",
173+
"unicorn/new-for-builtins": "error",
174+
"unicorn/no-instanceof-array": "error",
175+
"unicorn/no-typeof-undefined": "error",
176+
"unicorn/prefer-regexp-test": "error",
177+
"unicorn/prefer-spread": "error",
178+
"unicorn/no-console-spaces": "error",
179+
"unicorn/no-array-callback-reference": "error",
180+
"unicorn/no-await-expression-member": "error",
181+
"unicorn/no-this-assignment": "error",
182+
"unicorn/no-abusive-eslint-disable": "error",
183+
"unicorn/filename-case": [
184+
"error",
185+
{
186+
"case": "kebabCase"
187+
}
188+
],
189+
"oxc/no-barrel-file": "error",
190+
"oxc/no-const-enum": "error",
191+
"oxc/no-rest-spread-properties": "error",
192+
"oxc/no-this-in-exported-function": "error",
193+
"eslint/array-callback-return": "error",
194+
"eslint/block-scoped-var": "error",
195+
"eslint/curly": ["error", "multi-line"],
196+
"eslint/default-case-last": "error",
197+
"eslint/default-param-last": "error",
198+
"eslint/eqeqeq": "error",
199+
"eslint/func-style": ["error", "declaration"],
200+
"eslint/grouped-accessor-pairs": ["error", "getBeforeSet"],
201+
"eslint/guard-for-in": "error",
202+
"eslint/no-else-return": "error",
203+
"eslint/no-fallthrough": "error",
204+
"eslint/no-inner-declarations": "error",
205+
"eslint/no-multi-assign": "error",
206+
"eslint/no-param-reassign": "error",
207+
"eslint/no-return-assign": ["error", "always"],
208+
"eslint/no-shadow": "error",
209+
"eslint/no-template-curly-in-string": "error",
210+
"eslint/no-unneeded-ternary": "error",
211+
"eslint/no-useless-concat": "error",
212+
"eslint/no-useless-return": "error",
213+
"eslint/no-var": "error",
214+
"eslint/object-shorthand": ["error", "always"],
215+
"eslint/operator-assignment": "error",
216+
"eslint/prefer-arrow-callback": "error",
217+
"eslint/prefer-const": "error",
218+
"eslint/prefer-destructuring": [
219+
"error",
220+
{
221+
"array": true,
222+
"object": true
223+
},
224+
{
225+
"enforceForRenamedProperties": false
226+
}
227+
],
228+
"eslint/prefer-exponentiation-operator": "error",
229+
"eslint/prefer-object-has-own": "error",
230+
"eslint/prefer-object-spread": "error",
231+
"eslint/prefer-rest-params": "error",
232+
"eslint/prefer-spread": "error",
233+
"eslint/prefer-template": "error",
234+
"eslint/radix": "error",
235+
"eslint/require-unicode-regexp": "error",
236+
"eslint/symbol-description": "error",
237+
"eslint/yoda": "error",
238+
"eslint/no-duplicate-imports": [
239+
"error",
240+
{
241+
"includeExports": true
242+
}
243+
],
244+
"eslint/no-empty-function": "error",
245+
"eslint/no-new-func": "error",
246+
"jsdoc/empty-tags": "error",
247+
"jsdoc/no-blank-blocks": "error"
14248
},
15-
"plugins": ["eslint"]
249+
"overrides": [
250+
{
251+
"files": ["test/**/*.ts", "test/**/*.js"],
252+
"rules": {
253+
"typescript/require-await": "off",
254+
"promise/prefer-await-to-then": "off",
255+
"eslint/func-style": "off",
256+
"unicorn/consistent-function-scoping": "off",
257+
"typescript/no-floating-promises": [
258+
"error",
259+
{
260+
"ignoreVoid": true
261+
}
262+
]
263+
}
264+
}
265+
],
266+
"options": {
267+
"typeAware": true,
268+
"reportUnusedDisableDirectives": "warn",
269+
"denyWarnings": true
270+
}
16271
}

‎package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
},
6262
"scripts": {
6363
"build": "rm -rf dist && tsc --project tsconfig.build.esm.json && tsc --project tsconfig.build.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
64-
"lint": "oxfmt && oxlint --fix && tsc --noEmit",
64+
"lint": "oxfmt && oxlint --fix && knip && tsc --noEmit",
6565
"test": "node --test-concurrency=1 --test test/*.test.ts",
6666
"prepack": "pnpm build",
6767
"preuninstall": "node dist/esm/certs-cli.js -u",
@@ -73,8 +73,10 @@
7373
},
7474
"devDependencies": {
7575
"@types/node": "^26.4.1",
76+
"knip": "^6.34.0",
7677
"oxfmt": "^0.66.0",
7778
"oxlint": "^1.81.0",
79+
"oxlint-tsgolint": "^7.0.2001",
7880
"typescript": "^7.0.2"
7981
},
8082
"devEngines": {

0 commit comments

Comments
 (0)