@configg/bases 0.1.5 → 0.1.7
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 +14 -0
- package/package.json +2 -1
- package/packages/oxc/src/anti-slop/LICENSE +21 -0
- package/packages/oxc/src/anti-slop/UPSTREAM.md +8 -0
- package/packages/oxc/src/anti-slop/index.ts +47 -0
- package/packages/oxc/src/anti-slop/rules/no-array-filter-map.ts +28 -0
- package/packages/oxc/src/anti-slop/rules/no-chained-type-assertions.ts +77 -0
- package/packages/oxc/src/anti-slop/rules/no-conditional-empty-object-spread.ts +49 -0
- package/packages/oxc/src/anti-slop/rules/no-known-value-widening.ts +415 -0
- package/packages/oxc/src/anti-slop/rules/no-module-mocking.ts +80 -0
- package/packages/oxc/src/anti-slop/rules/no-object-parameters.ts +83 -0
- package/packages/oxc/src/anti-slop/rules/no-reduce-accumulator-copy.ts +109 -0
- package/packages/oxc/src/anti-slop/rules/no-reflect-apply.ts +28 -0
- package/packages/oxc/src/anti-slop/rules/no-reflect-get.ts +28 -0
- package/packages/oxc/src/anti-slop/rules/no-runtime-typeof.ts +77 -0
- package/packages/oxc/src/anti-slop/rules/no-shape-in-symbol-names.ts +46 -0
- package/packages/oxc/src/anti-slop/rules/no-unknown-parameters.ts +69 -0
- package/packages/oxc/src/anti-slop/rules/no-unknown-returns.ts +82 -0
- package/packages/oxc/src/anti-slop/rules/no-unknown-type-aliases.ts +54 -0
- package/packages/oxc/src/anti-slop/rules/no-unsafe-dictionary-type.ts +154 -0
- package/packages/oxc/src/anti-slop/rules/no-widen-then-assert.ts +366 -0
- package/packages/oxc/src/anti-slop/rules/require-readable-spacing.ts +47 -0
- package/packages/oxc/src/anti-slop/rules/require-safety-comment-for-type-assertion.ts +131 -0
- package/packages/oxc/src/anti-slop/shared/array-method.ts +94 -0
- package/packages/oxc/src/anti-slop/shared/dictionary-types.ts +515 -0
- package/packages/oxc/src/anti-slop/shared/function-parameters.ts +49 -0
- package/packages/oxc/src/anti-slop/shared/lexical-type-parameters.ts +61 -0
- package/packages/oxc/src/anti-slop/shared/reflect-method.ts +24 -0
- package/packages/oxc/src/anti-slop/shared/scope.ts +15 -0
- package/packages/oxc/src/anti-slop/shared/type-alias-resolution.ts +250 -0
- package/packages/oxc/src/anti-slop/vendor/eslint-stylistic/LICENSE +22 -0
- package/packages/oxc/src/anti-slop/vendor/eslint-stylistic/UPSTREAM.md +28 -0
- package/packages/oxc/src/anti-slop/vendor/eslint-stylistic/padding-line-ast.ts +51 -0
- package/packages/oxc/src/anti-slop/vendor/eslint-stylistic/padding-line-between-statements.ts +906 -0
- package/packages/oxc/src/anti-slop/vendor/eslint-stylistic/padding-line-options.d.ts +87 -0
- package/packages/oxc/src/lint.ts +31 -2
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* GENERATED, DO NOT EDIT DIRECTLY */
|
|
2
|
+
|
|
3
|
+
/* @checksum: 3QCTtOH6rJM5_AGJ58rGpeEaBEfaJz17MSCxWB4X_PU */
|
|
4
|
+
|
|
5
|
+
export type PaddingType = 'any' | 'never' | 'always'
|
|
6
|
+
export type StatementOption =
|
|
7
|
+
| StatementMatcher
|
|
8
|
+
| [StatementMatcher, ...StatementMatcher[]]
|
|
9
|
+
export type StatementMatcher =
|
|
10
|
+
| StatementType
|
|
11
|
+
| SelectorOption
|
|
12
|
+
export type StatementType =
|
|
13
|
+
| '*'
|
|
14
|
+
| 'exports'
|
|
15
|
+
| 'require'
|
|
16
|
+
| 'directive'
|
|
17
|
+
| 'iife'
|
|
18
|
+
| 'block'
|
|
19
|
+
| 'empty'
|
|
20
|
+
| 'function'
|
|
21
|
+
| 'ts-method'
|
|
22
|
+
| 'break'
|
|
23
|
+
| 'case'
|
|
24
|
+
| 'class'
|
|
25
|
+
| 'continue'
|
|
26
|
+
| 'debugger'
|
|
27
|
+
| 'default'
|
|
28
|
+
| 'do'
|
|
29
|
+
| 'for'
|
|
30
|
+
| 'if'
|
|
31
|
+
| 'import'
|
|
32
|
+
| 'switch'
|
|
33
|
+
| 'throw'
|
|
34
|
+
| 'try'
|
|
35
|
+
| 'while'
|
|
36
|
+
| 'with'
|
|
37
|
+
| 'cjs-export'
|
|
38
|
+
| 'cjs-import'
|
|
39
|
+
| 'enum'
|
|
40
|
+
| 'interface'
|
|
41
|
+
| 'function-overload'
|
|
42
|
+
| 'block-like'
|
|
43
|
+
| 'singleline-block-like'
|
|
44
|
+
| 'multiline-block-like'
|
|
45
|
+
| 'expression'
|
|
46
|
+
| 'singleline-expression'
|
|
47
|
+
| 'multiline-expression'
|
|
48
|
+
| 'return'
|
|
49
|
+
| 'singleline-return'
|
|
50
|
+
| 'multiline-return'
|
|
51
|
+
| 'export'
|
|
52
|
+
| 'singleline-export'
|
|
53
|
+
| 'multiline-export'
|
|
54
|
+
| 'var'
|
|
55
|
+
| 'singleline-var'
|
|
56
|
+
| 'multiline-var'
|
|
57
|
+
| 'let'
|
|
58
|
+
| 'singleline-let'
|
|
59
|
+
| 'multiline-let'
|
|
60
|
+
| 'const'
|
|
61
|
+
| 'singleline-const'
|
|
62
|
+
| 'multiline-const'
|
|
63
|
+
| 'using'
|
|
64
|
+
| 'singleline-using'
|
|
65
|
+
| 'multiline-using'
|
|
66
|
+
| 'type'
|
|
67
|
+
| 'singleline-type'
|
|
68
|
+
| 'multiline-type'
|
|
69
|
+
export type PaddingLineBetweenStatementsSchema0 = {
|
|
70
|
+
blankLine: PaddingType
|
|
71
|
+
prev: StatementOption
|
|
72
|
+
next: StatementOption
|
|
73
|
+
}[]
|
|
74
|
+
|
|
75
|
+
export interface SelectorOption {
|
|
76
|
+
selector: string
|
|
77
|
+
lineMode?: 'any' | 'singleline' | 'multiline'
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type PaddingLineBetweenStatementsRuleOptions
|
|
81
|
+
= PaddingLineBetweenStatementsSchema0
|
|
82
|
+
|
|
83
|
+
export type RuleOptions
|
|
84
|
+
= PaddingLineBetweenStatementsRuleOptions
|
|
85
|
+
export type MessageIds =
|
|
86
|
+
| 'unexpectedBlankLine'
|
|
87
|
+
| 'expectedBlankLine'
|
package/packages/oxc/src/lint.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { OxlintConfig } from 'oxlint'
|
|
2
2
|
|
|
3
|
+
const antiSlopPlugin = { name: 'anti-slop', specifier: `${import.meta.dirname}/anti-slop/index.ts` }
|
|
4
|
+
|
|
3
5
|
const sharedRules = {
|
|
4
6
|
'eslint/id-length': 'off',
|
|
5
7
|
'eslint/max-classes-per-file': ['warn', { max: 2 }],
|
|
6
8
|
'eslint/max-lines-per-function': ['warn', { max: 100, skipBlankLines: true, skipComments: true }],
|
|
7
9
|
'eslint/max-statements': ['warn', { max: 30 }],
|
|
10
|
+
'import/prefer-default-export': 'off',
|
|
11
|
+
'oxc/no-async-await': 'off',
|
|
8
12
|
'typescript/restrict-template-expressions': [
|
|
9
13
|
'error',
|
|
10
14
|
{
|
|
@@ -14,14 +18,39 @@ const sharedRules = {
|
|
|
14
18
|
allowNumber: true,
|
|
15
19
|
},
|
|
16
20
|
],
|
|
17
|
-
'import/prefer-default-export': 'off',
|
|
18
|
-
'oxc/no-async-await': 'off',
|
|
19
21
|
'unicorn/no-array-reduce': 'off',
|
|
20
22
|
'unicorn/no-process-exit': 'off',
|
|
21
23
|
// Oxfmt and Prettier write hex digits in lowercase; this rule wants uppercase and takes no option.
|
|
22
24
|
'unicorn/number-literal-case': 'off',
|
|
23
25
|
} as const satisfies OxlintConfig['rules']
|
|
24
26
|
|
|
27
|
+
/** Opt in by spreading into a preset. The plugin ships as TypeScript, so run oxlint under Bun. */
|
|
28
|
+
export const antiSlop = {
|
|
29
|
+
jsPlugins: [antiSlopPlugin],
|
|
30
|
+
rules: {
|
|
31
|
+
'anti-slop/no-array-filter-map': 'error',
|
|
32
|
+
'anti-slop/no-chained-type-assertions': 'error',
|
|
33
|
+
'anti-slop/no-conditional-empty-object-spread': 'error',
|
|
34
|
+
'anti-slop/no-known-value-widening': 'error',
|
|
35
|
+
'anti-slop/no-module-mocking': 'error',
|
|
36
|
+
'anti-slop/no-object-parameters': 'error',
|
|
37
|
+
'anti-slop/no-reduce-accumulator-copy': 'error',
|
|
38
|
+
'anti-slop/no-reflect-apply': 'error',
|
|
39
|
+
'anti-slop/no-reflect-get': 'error',
|
|
40
|
+
'anti-slop/no-runtime-typeof': 'error',
|
|
41
|
+
'anti-slop/no-shape-in-symbol-names': 'error',
|
|
42
|
+
'anti-slop/no-unknown-parameters': 'error',
|
|
43
|
+
'anti-slop/no-unknown-returns': 'error',
|
|
44
|
+
'anti-slop/no-unknown-type-aliases': 'error',
|
|
45
|
+
'anti-slop/no-unsafe-dictionary-type': 'error',
|
|
46
|
+
'anti-slop/no-widen-then-assert': 'error',
|
|
47
|
+
'anti-slop/require-readable-spacing': 'error',
|
|
48
|
+
'anti-slop/require-safety-comment-for-type-assertion': 'error',
|
|
49
|
+
// This pushes toward Reflect.apply, which anti-slop/no-reflect-apply forbids.
|
|
50
|
+
'unicorn/prefer-reflect-apply': 'off',
|
|
51
|
+
},
|
|
52
|
+
} as const satisfies OxlintConfig
|
|
53
|
+
|
|
25
54
|
export const configs = {
|
|
26
55
|
client: {
|
|
27
56
|
categories: {
|