@configg/bases 0.1.4 → 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.
Files changed (36) hide show
  1. package/README.md +5 -0
  2. package/package.json +2 -1
  3. package/packages/oxc/src/anti-slop/LICENSE +21 -0
  4. package/packages/oxc/src/anti-slop/UPSTREAM.md +8 -0
  5. package/packages/oxc/src/anti-slop/index.ts +47 -0
  6. package/packages/oxc/src/anti-slop/rules/no-array-filter-map.ts +28 -0
  7. package/packages/oxc/src/anti-slop/rules/no-chained-type-assertions.ts +77 -0
  8. package/packages/oxc/src/anti-slop/rules/no-conditional-empty-object-spread.ts +49 -0
  9. package/packages/oxc/src/anti-slop/rules/no-known-value-widening.ts +415 -0
  10. package/packages/oxc/src/anti-slop/rules/no-module-mocking.ts +80 -0
  11. package/packages/oxc/src/anti-slop/rules/no-object-parameters.ts +83 -0
  12. package/packages/oxc/src/anti-slop/rules/no-reduce-accumulator-copy.ts +109 -0
  13. package/packages/oxc/src/anti-slop/rules/no-reflect-apply.ts +28 -0
  14. package/packages/oxc/src/anti-slop/rules/no-reflect-get.ts +28 -0
  15. package/packages/oxc/src/anti-slop/rules/no-runtime-typeof.ts +77 -0
  16. package/packages/oxc/src/anti-slop/rules/no-shape-in-symbol-names.ts +46 -0
  17. package/packages/oxc/src/anti-slop/rules/no-unknown-parameters.ts +69 -0
  18. package/packages/oxc/src/anti-slop/rules/no-unknown-returns.ts +82 -0
  19. package/packages/oxc/src/anti-slop/rules/no-unknown-type-aliases.ts +54 -0
  20. package/packages/oxc/src/anti-slop/rules/no-unsafe-dictionary-type.ts +154 -0
  21. package/packages/oxc/src/anti-slop/rules/no-widen-then-assert.ts +366 -0
  22. package/packages/oxc/src/anti-slop/rules/require-readable-spacing.ts +47 -0
  23. package/packages/oxc/src/anti-slop/rules/require-safety-comment-for-type-assertion.ts +131 -0
  24. package/packages/oxc/src/anti-slop/shared/array-method.ts +94 -0
  25. package/packages/oxc/src/anti-slop/shared/dictionary-types.ts +515 -0
  26. package/packages/oxc/src/anti-slop/shared/function-parameters.ts +49 -0
  27. package/packages/oxc/src/anti-slop/shared/lexical-type-parameters.ts +61 -0
  28. package/packages/oxc/src/anti-slop/shared/reflect-method.ts +24 -0
  29. package/packages/oxc/src/anti-slop/shared/scope.ts +15 -0
  30. package/packages/oxc/src/anti-slop/shared/type-alias-resolution.ts +250 -0
  31. package/packages/oxc/src/anti-slop/vendor/eslint-stylistic/LICENSE +22 -0
  32. package/packages/oxc/src/anti-slop/vendor/eslint-stylistic/UPSTREAM.md +28 -0
  33. package/packages/oxc/src/anti-slop/vendor/eslint-stylistic/padding-line-ast.ts +51 -0
  34. package/packages/oxc/src/anti-slop/vendor/eslint-stylistic/padding-line-between-statements.ts +906 -0
  35. package/packages/oxc/src/anti-slop/vendor/eslint-stylistic/padding-line-options.d.ts +87 -0
  36. package/packages/oxc/src/lint.ts +28 -1
@@ -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'
@@ -1,8 +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 }],
26
+ 'eslint/max-lines-per-function': ['warn', { max: 100, skipBlankLines: true, skipComments: true }],
27
+ 'eslint/max-statements': ['warn', { max: 30 }],
28
+ 'import/prefer-default-export': 'off',
29
+ 'oxc/no-async-await': 'off',
6
30
  'typescript/restrict-template-expressions': [
7
31
  'error',
8
32
  {
@@ -12,11 +36,12 @@ const sharedRules = {
12
36
  allowNumber: true,
13
37
  },
14
38
  ],
15
- 'import/prefer-default-export': 'off',
16
39
  'unicorn/no-array-reduce': 'off',
17
40
  'unicorn/no-process-exit': 'off',
18
41
  // Oxfmt and Prettier write hex digits in lowercase; this rule wants uppercase and takes no option.
19
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',
20
45
  } as const satisfies OxlintConfig['rules']
21
46
 
22
47
  export const configs = {
@@ -34,6 +59,7 @@ export const configs = {
34
59
  browser: true,
35
60
  builtin: true,
36
61
  },
62
+ jsPlugins: [antiSlop],
37
63
  options: {
38
64
  typeAware: true,
39
65
  typeCheck: true,
@@ -141,6 +167,7 @@ export const configs = {
141
167
  builtin: true,
142
168
  node: true,
143
169
  },
170
+ jsPlugins: [antiSlop],
144
171
  options: {
145
172
  typeAware: true,
146
173
  typeCheck: true,