@configg/oxc 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/package.json +2 -2
- package/src/lint.ts +17 -0
package/README.md
CHANGED
|
@@ -40,6 +40,10 @@ export default defineConfig(configs.client)
|
|
|
40
40
|
- `client`: browser env, type-aware, with rules relaxed for component code. Its `**/*.spec.{ts,tsx}` override enables the Vitest env and Testing Library rules, so it needs `eslint-plugin-testing-library`.
|
|
41
41
|
- `scripts`: Node env, type-aware, for tooling and config files.
|
|
42
42
|
|
|
43
|
+
Both presets allow up to two classes per file, allow `reduce()` and allow `process.exit()` (CLI scripts and
|
|
44
|
+
shutdown handlers exit with a status code on purpose). Template expressions allow booleans, numbers, nullish
|
|
45
|
+
values and `never`; other types follow Oxlint's defaults.
|
|
46
|
+
|
|
43
47
|
## Peer dependencies
|
|
44
48
|
|
|
45
49
|
`oxfmt`, `oxlint`, `oxlint-tsgolint` and `eslint-plugin-testing-library` are all optional peers, so you install only the ones the presets you use need.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configg/oxc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "oxfmt and oxlint presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"eslint-plugin-testing-library": "^7.16",
|
|
39
39
|
"oxfmt": ">=0.65.0",
|
|
40
|
-
"oxlint": "^1",
|
|
40
|
+
"oxlint": "^1.12.0",
|
|
41
41
|
"oxlint-tsgolint": "^7"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
package/src/lint.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import type { OxlintConfig } from 'oxlint'
|
|
2
2
|
|
|
3
|
+
const sharedRules = {
|
|
4
|
+
'eslint/max-classes-per-file': ['warn', { max: 2 }],
|
|
5
|
+
'typescript/restrict-template-expressions': [
|
|
6
|
+
'error',
|
|
7
|
+
{
|
|
8
|
+
allowBoolean: true,
|
|
9
|
+
allowNever: true,
|
|
10
|
+
allowNullish: true,
|
|
11
|
+
allowNumber: true,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
'unicorn/no-array-reduce': 'off',
|
|
15
|
+
'unicorn/no-process-exit': 'off',
|
|
16
|
+
} as const satisfies OxlintConfig['rules']
|
|
17
|
+
|
|
3
18
|
export const configs = {
|
|
4
19
|
client: {
|
|
5
20
|
categories: {
|
|
@@ -82,6 +97,7 @@ export const configs = {
|
|
|
82
97
|
],
|
|
83
98
|
plugins: ['eslint', 'oxc', 'react', 'typescript', 'unicorn'],
|
|
84
99
|
rules: {
|
|
100
|
+
...sharedRules,
|
|
85
101
|
'func-style': ['error', 'declaration'],
|
|
86
102
|
'no-magic-numbers': 'off',
|
|
87
103
|
'no-rest-spread-properties': 'off',
|
|
@@ -126,6 +142,7 @@ export const configs = {
|
|
|
126
142
|
typeCheck: true,
|
|
127
143
|
},
|
|
128
144
|
rules: {
|
|
145
|
+
...sharedRules,
|
|
129
146
|
'func-style': ['error', 'declaration'],
|
|
130
147
|
'no-magic-numbers': 'off',
|
|
131
148
|
'no-rest-spread-properties': 'off',
|