react-code-smell-detector 1.0.1 → 1.1.1

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.
@@ -14,7 +14,31 @@ export type SmellType =
14
14
  | 'dependency-array-issue'
15
15
  | 'nested-ternary'
16
16
  | 'dead-code'
17
- | 'magic-value';
17
+ | 'magic-value'
18
+ // Next.js specific
19
+ | 'nextjs-client-server-boundary'
20
+ | 'nextjs-missing-metadata'
21
+ | 'nextjs-image-unoptimized'
22
+ | 'nextjs-router-misuse'
23
+ // React Native specific
24
+ | 'rn-inline-style'
25
+ | 'rn-missing-accessibility'
26
+ | 'rn-performance-issue'
27
+ // Node.js specific
28
+ | 'nodejs-callback-hell'
29
+ | 'nodejs-unhandled-promise'
30
+ | 'nodejs-sync-io'
31
+ | 'nodejs-missing-error-handling'
32
+ // JavaScript specific
33
+ | 'js-var-usage'
34
+ | 'js-loose-equality'
35
+ | 'js-implicit-coercion'
36
+ | 'js-global-pollution'
37
+ // TypeScript specific
38
+ | 'ts-any-usage'
39
+ | 'ts-missing-return-type'
40
+ | 'ts-non-null-assertion'
41
+ | 'ts-type-assertion';
18
42
 
19
43
  export interface CodeSmell {
20
44
  type: SmellType;
@@ -87,7 +111,14 @@ export interface DetectorConfig {
87
111
  maxTernaryDepth: number;
88
112
  checkDeadCode: boolean;
89
113
  checkMagicValues: boolean;
90
- magicNumberThreshold: number; // Numbers above this are flagged
114
+ magicNumberThreshold: number;
115
+ // Framework detection
116
+ checkNextjs: boolean;
117
+ checkReactNative: boolean;
118
+ checkNodejs: boolean;
119
+ checkJavascript: boolean;
120
+ checkTypescript: boolean;
121
+ maxCallbackDepth: number;
91
122
  }
92
123
 
93
124
  export const DEFAULT_CONFIG: DetectorConfig = {
@@ -103,4 +134,11 @@ export const DEFAULT_CONFIG: DetectorConfig = {
103
134
  checkDeadCode: true,
104
135
  checkMagicValues: true,
105
136
  magicNumberThreshold: 10,
137
+ // Framework detection - auto-enabled based on project
138
+ checkNextjs: true,
139
+ checkReactNative: true,
140
+ checkNodejs: true,
141
+ checkJavascript: true,
142
+ checkTypescript: true,
143
+ maxCallbackDepth: 3,
106
144
  };