@configg/oxc 0.1.0 → 0.1.2
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 +3 -0
- package/package.json +2 -2
- package/src/lint.ts +18 -0
package/README.md
CHANGED
|
@@ -40,6 +40,9 @@ 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 and allow `reduce()`. Template expressions
|
|
44
|
+
allow booleans, numbers, nullish values and `never`; other types follow Oxlint's defaults.
|
|
45
|
+
|
|
43
46
|
## Peer dependencies
|
|
44
47
|
|
|
45
48
|
`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.2",
|
|
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,19 @@
|
|
|
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
|
+
} as const satisfies OxlintConfig['rules']
|
|
16
|
+
|
|
3
17
|
export const configs = {
|
|
4
18
|
client: {
|
|
5
19
|
categories: {
|
|
@@ -82,6 +96,7 @@ export const configs = {
|
|
|
82
96
|
],
|
|
83
97
|
plugins: ['eslint', 'oxc', 'react', 'typescript', 'unicorn'],
|
|
84
98
|
rules: {
|
|
99
|
+
...sharedRules,
|
|
85
100
|
'func-style': ['error', 'declaration'],
|
|
86
101
|
'no-magic-numbers': 'off',
|
|
87
102
|
'no-rest-spread-properties': 'off',
|
|
@@ -126,11 +141,14 @@ export const configs = {
|
|
|
126
141
|
typeCheck: true,
|
|
127
142
|
},
|
|
128
143
|
rules: {
|
|
144
|
+
...sharedRules,
|
|
129
145
|
'func-style': ['error', 'declaration'],
|
|
130
146
|
'no-magic-numbers': 'off',
|
|
131
147
|
'no-rest-spread-properties': 'off',
|
|
132
148
|
'one-var': 'off',
|
|
133
149
|
'sort-imports': 'off',
|
|
150
|
+
'sort-keys': 'off',
|
|
151
|
+
'sort-vars': 'off',
|
|
134
152
|
'typescript/prefer-readonly-parameter-types': 'off',
|
|
135
153
|
},
|
|
136
154
|
},
|