@configg/oxc 0.1.3 → 0.1.5
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 +6 -3
- package/package.json +1 -1
- package/src/lint.ts +7 -0
package/README.md
CHANGED
|
@@ -40,9 +40,12 @@ 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()
|
|
44
|
-
shutdown handlers exit with a status code on purpose).
|
|
45
|
-
|
|
43
|
+
Both presets allow up to two classes per file, allow `reduce()`, allow `process.exit()` (CLI scripts and
|
|
44
|
+
shutdown handlers exit with a status code on purpose) and allow short identifiers (`eslint/id-length` is off). They turn `import/prefer-default-export` off, since named
|
|
45
|
+
exports are the convention (it matters once a config adds the `import` plugin), and `unicorn/number-literal-case`
|
|
46
|
+
off, since oxfmt and Prettier write hex digits in lowercase. `async`/`await` is allowed (`oxc/no-async-await` is
|
|
47
|
+
off), and functions may run to 100 lines (blank lines and comments not counted) and 30 statements. Template expressions
|
|
48
|
+
allow booleans, numbers, nullish values and `never`; other types follow Oxlint's defaults.
|
|
46
49
|
|
|
47
50
|
## Peer dependencies
|
|
48
51
|
|
package/package.json
CHANGED
package/src/lint.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { OxlintConfig } from 'oxlint'
|
|
2
2
|
|
|
3
3
|
const sharedRules = {
|
|
4
|
+
'eslint/id-length': 'off',
|
|
4
5
|
'eslint/max-classes-per-file': ['warn', { max: 2 }],
|
|
6
|
+
'eslint/max-lines-per-function': ['warn', { max: 100, skipBlankLines: true, skipComments: true }],
|
|
7
|
+
'eslint/max-statements': ['warn', { max: 30 }],
|
|
5
8
|
'typescript/restrict-template-expressions': [
|
|
6
9
|
'error',
|
|
7
10
|
{
|
|
@@ -11,8 +14,12 @@ const sharedRules = {
|
|
|
11
14
|
allowNumber: true,
|
|
12
15
|
},
|
|
13
16
|
],
|
|
17
|
+
'import/prefer-default-export': 'off',
|
|
18
|
+
'oxc/no-async-await': 'off',
|
|
14
19
|
'unicorn/no-array-reduce': 'off',
|
|
15
20
|
'unicorn/no-process-exit': 'off',
|
|
21
|
+
// Oxfmt and Prettier write hex digits in lowercase; this rule wants uppercase and takes no option.
|
|
22
|
+
'unicorn/number-literal-case': 'off',
|
|
16
23
|
} as const satisfies OxlintConfig['rules']
|
|
17
24
|
|
|
18
25
|
export const configs = {
|