@configg/bases 0.1.5 → 0.1.6
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 +5 -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 +26 -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,32 @@
|
|
|
1
1
|
import type { OxlintConfig } from 'oxlint'
|
|
2
2
|
|
|
3
|
+
const antiSlop = { name: 'anti-slop', specifier: `${import.meta.dirname}/anti-slop/index.ts` }
|
|
4
|
+
|
|
3
5
|
const sharedRules = {
|
|
6
|
+
'anti-slop/no-array-filter-map': 'error',
|
|
7
|
+
'anti-slop/no-chained-type-assertions': 'error',
|
|
8
|
+
'anti-slop/no-conditional-empty-object-spread': 'error',
|
|
9
|
+
'anti-slop/no-known-value-widening': 'error',
|
|
10
|
+
'anti-slop/no-module-mocking': 'error',
|
|
11
|
+
'anti-slop/no-object-parameters': 'error',
|
|
12
|
+
'anti-slop/no-reduce-accumulator-copy': 'error',
|
|
13
|
+
'anti-slop/no-reflect-apply': 'error',
|
|
14
|
+
'anti-slop/no-reflect-get': 'error',
|
|
15
|
+
'anti-slop/no-runtime-typeof': 'error',
|
|
16
|
+
'anti-slop/no-shape-in-symbol-names': 'error',
|
|
17
|
+
'anti-slop/no-unknown-parameters': 'error',
|
|
18
|
+
'anti-slop/no-unknown-returns': 'error',
|
|
19
|
+
'anti-slop/no-unknown-type-aliases': 'error',
|
|
20
|
+
'anti-slop/no-unsafe-dictionary-type': 'error',
|
|
21
|
+
'anti-slop/no-widen-then-assert': 'error',
|
|
22
|
+
'anti-slop/require-readable-spacing': 'error',
|
|
23
|
+
'anti-slop/require-safety-comment-for-type-assertion': 'error',
|
|
4
24
|
'eslint/id-length': 'off',
|
|
5
25
|
'eslint/max-classes-per-file': ['warn', { max: 2 }],
|
|
6
26
|
'eslint/max-lines-per-function': ['warn', { max: 100, skipBlankLines: true, skipComments: true }],
|
|
7
27
|
'eslint/max-statements': ['warn', { max: 30 }],
|
|
28
|
+
'import/prefer-default-export': 'off',
|
|
29
|
+
'oxc/no-async-await': 'off',
|
|
8
30
|
'typescript/restrict-template-expressions': [
|
|
9
31
|
'error',
|
|
10
32
|
{
|
|
@@ -14,12 +36,12 @@ const sharedRules = {
|
|
|
14
36
|
allowNumber: true,
|
|
15
37
|
},
|
|
16
38
|
],
|
|
17
|
-
'import/prefer-default-export': 'off',
|
|
18
|
-
'oxc/no-async-await': 'off',
|
|
19
39
|
'unicorn/no-array-reduce': 'off',
|
|
20
40
|
'unicorn/no-process-exit': 'off',
|
|
21
41
|
// Oxfmt and Prettier write hex digits in lowercase; this rule wants uppercase and takes no option.
|
|
22
42
|
'unicorn/number-literal-case': 'off',
|
|
43
|
+
// This pushes toward Reflect.apply, which anti-slop/no-reflect-apply forbids.
|
|
44
|
+
'unicorn/prefer-reflect-apply': 'off',
|
|
23
45
|
} as const satisfies OxlintConfig['rules']
|
|
24
46
|
|
|
25
47
|
export const configs = {
|
|
@@ -37,6 +59,7 @@ export const configs = {
|
|
|
37
59
|
browser: true,
|
|
38
60
|
builtin: true,
|
|
39
61
|
},
|
|
62
|
+
jsPlugins: [antiSlop],
|
|
40
63
|
options: {
|
|
41
64
|
typeAware: true,
|
|
42
65
|
typeCheck: true,
|
|
@@ -144,6 +167,7 @@ export const configs = {
|
|
|
144
167
|
builtin: true,
|
|
145
168
|
node: true,
|
|
146
169
|
},
|
|
170
|
+
jsPlugins: [antiSlop],
|
|
147
171
|
options: {
|
|
148
172
|
typeAware: true,
|
|
149
173
|
typeCheck: true,
|