@rigour-labs/core 3.0.4 → 3.0.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/dist/gates/deprecated-apis-rules-lang.d.ts +21 -0
- package/dist/gates/deprecated-apis-rules-lang.js +311 -0
- package/dist/gates/deprecated-apis-rules-node.d.ts +19 -0
- package/dist/gates/deprecated-apis-rules-node.js +199 -0
- package/dist/gates/deprecated-apis-rules.d.ts +6 -0
- package/dist/gates/deprecated-apis-rules.js +6 -0
- package/dist/gates/deprecated-apis.js +1 -502
- package/dist/gates/hallucinated-imports-lang.d.ts +16 -0
- package/dist/gates/hallucinated-imports-lang.js +374 -0
- package/dist/gates/hallucinated-imports-stdlib.d.ts +12 -0
- package/dist/gates/hallucinated-imports-stdlib.js +228 -0
- package/dist/gates/hallucinated-imports.d.ts +0 -98
- package/dist/gates/hallucinated-imports.js +10 -678
- package/dist/gates/phantom-apis-data.d.ts +33 -0
- package/dist/gates/phantom-apis-data.js +398 -0
- package/dist/gates/phantom-apis.js +1 -393
- package/dist/gates/phantom-apis.test.js +52 -0
- package/dist/gates/promise-safety-helpers.d.ts +19 -0
- package/dist/gates/promise-safety-helpers.js +101 -0
- package/dist/gates/promise-safety-rules.d.ts +7 -0
- package/dist/gates/promise-safety-rules.js +19 -0
- package/dist/gates/promise-safety.d.ts +1 -21
- package/dist/gates/promise-safety.js +51 -257
- package/dist/gates/test-quality-lang.d.ts +30 -0
- package/dist/gates/test-quality-lang.js +188 -0
- package/dist/gates/test-quality.d.ts +0 -14
- package/dist/gates/test-quality.js +13 -186
- package/dist/pattern-index/indexer-helpers.d.ts +38 -0
- package/dist/pattern-index/indexer-helpers.js +111 -0
- package/dist/pattern-index/indexer-lang.d.ts +13 -0
- package/dist/pattern-index/indexer-lang.js +244 -0
- package/dist/pattern-index/indexer-ts.d.ts +22 -0
- package/dist/pattern-index/indexer-ts.js +258 -0
- package/dist/pattern-index/indexer.d.ts +4 -106
- package/dist/pattern-index/indexer.js +58 -707
- package/dist/pattern-index/staleness-data.d.ts +6 -0
- package/dist/pattern-index/staleness-data.js +262 -0
- package/dist/pattern-index/staleness.js +1 -258
- package/dist/templates/index.d.ts +12 -16
- package/dist/templates/index.js +11 -527
- package/dist/templates/paradigms.d.ts +2 -0
- package/dist/templates/paradigms.js +46 -0
- package/dist/templates/presets.d.ts +14 -0
- package/dist/templates/presets.js +227 -0
- package/dist/templates/universal-config.d.ts +2 -0
- package/dist/templates/universal-config.js +171 -0
- package/package.json +1 -1
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in deprecation database.
|
|
3
|
+
* Bundled with Rigour and updated with releases.
|
|
4
|
+
*/
|
|
5
|
+
export const BUILT_IN_DEPRECATIONS = [
|
|
6
|
+
// React deprecations
|
|
7
|
+
{
|
|
8
|
+
pattern: 'componentWillMount',
|
|
9
|
+
library: 'react',
|
|
10
|
+
deprecatedIn: '16.3.0',
|
|
11
|
+
replacement: 'useEffect(() => { ... }, [])',
|
|
12
|
+
severity: 'error',
|
|
13
|
+
reason: 'Unsafe lifecycle method removed in React 18',
|
|
14
|
+
docs: 'https://react.dev/reference/react/Component#unsafe_componentwillmount'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
pattern: 'componentWillReceiveProps',
|
|
18
|
+
library: 'react',
|
|
19
|
+
deprecatedIn: '16.3.0',
|
|
20
|
+
replacement: 'getDerivedStateFromProps or useEffect',
|
|
21
|
+
severity: 'error',
|
|
22
|
+
reason: 'Unsafe lifecycle method removed in React 18'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
pattern: 'componentWillUpdate',
|
|
26
|
+
library: 'react',
|
|
27
|
+
deprecatedIn: '16.3.0',
|
|
28
|
+
replacement: 'getSnapshotBeforeUpdate or useEffect',
|
|
29
|
+
severity: 'error',
|
|
30
|
+
reason: 'Unsafe lifecycle method removed in React 18'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
pattern: 'UNSAFE_componentWillMount',
|
|
34
|
+
library: 'react',
|
|
35
|
+
deprecatedIn: '18.0.0',
|
|
36
|
+
replacement: 'useEffect(() => { ... }, [])',
|
|
37
|
+
severity: 'warning',
|
|
38
|
+
reason: 'Prepare for React 19 removal'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
pattern: 'ReactDOM.render',
|
|
42
|
+
library: 'react-dom',
|
|
43
|
+
deprecatedIn: '18.0.0',
|
|
44
|
+
replacement: 'createRoot(container).render(<App />)',
|
|
45
|
+
severity: 'error',
|
|
46
|
+
reason: 'Legacy root API deprecated in React 18'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
pattern: 'ReactDOM.hydrate',
|
|
50
|
+
library: 'react-dom',
|
|
51
|
+
deprecatedIn: '18.0.0',
|
|
52
|
+
replacement: 'hydrateRoot(container, <App />)',
|
|
53
|
+
severity: 'error',
|
|
54
|
+
reason: 'Legacy hydration API deprecated in React 18'
|
|
55
|
+
},
|
|
56
|
+
// Package deprecations
|
|
57
|
+
{
|
|
58
|
+
pattern: "import.*from ['\"]moment['\"]",
|
|
59
|
+
deprecatedIn: 'ecosystem',
|
|
60
|
+
replacement: "import { format } from 'date-fns'",
|
|
61
|
+
severity: 'warning',
|
|
62
|
+
reason: 'moment.js is in maintenance mode since September 2020',
|
|
63
|
+
docs: 'https://momentjs.com/docs/#/-project-status/'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
pattern: "require\\(['\"]request['\"]\\)",
|
|
67
|
+
deprecatedIn: 'ecosystem',
|
|
68
|
+
replacement: 'Use native fetch or axios',
|
|
69
|
+
severity: 'error',
|
|
70
|
+
reason: 'request package deprecated in February 2020'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
pattern: "import.*from ['\"]request['\"]",
|
|
74
|
+
deprecatedIn: 'ecosystem',
|
|
75
|
+
replacement: 'Use native fetch or axios',
|
|
76
|
+
severity: 'error',
|
|
77
|
+
reason: 'request package deprecated in February 2020'
|
|
78
|
+
},
|
|
79
|
+
// JavaScript/TypeScript deprecations
|
|
80
|
+
{
|
|
81
|
+
pattern: '\\bvar\\s+\\w+\\s*=',
|
|
82
|
+
deprecatedIn: 'es6',
|
|
83
|
+
replacement: 'Use const or let',
|
|
84
|
+
severity: 'warning',
|
|
85
|
+
reason: 'var has function scope which leads to bugs. Use block-scoped const/let'
|
|
86
|
+
},
|
|
87
|
+
// Redux deprecations
|
|
88
|
+
{
|
|
89
|
+
pattern: 'createStore\\(',
|
|
90
|
+
library: 'redux',
|
|
91
|
+
deprecatedIn: '4.2.0',
|
|
92
|
+
replacement: "configureStore from '@reduxjs/toolkit'",
|
|
93
|
+
severity: 'warning',
|
|
94
|
+
reason: 'Redux Toolkit is now the recommended way',
|
|
95
|
+
docs: 'https://redux.js.org/introduction/why-rtk-is-redux-today'
|
|
96
|
+
},
|
|
97
|
+
// Node.js deprecations
|
|
98
|
+
{
|
|
99
|
+
pattern: 'new Buffer\\(',
|
|
100
|
+
deprecatedIn: 'node@6.0.0',
|
|
101
|
+
replacement: 'Buffer.alloc() or Buffer.from()',
|
|
102
|
+
severity: 'error',
|
|
103
|
+
reason: 'Buffer constructor is a security hazard'
|
|
104
|
+
},
|
|
105
|
+
// Express deprecations
|
|
106
|
+
{
|
|
107
|
+
pattern: 'app\\.del\\(',
|
|
108
|
+
library: 'express',
|
|
109
|
+
deprecatedIn: '4.0.0',
|
|
110
|
+
replacement: 'app.delete()',
|
|
111
|
+
severity: 'warning',
|
|
112
|
+
reason: 'app.del() was renamed to app.delete()'
|
|
113
|
+
},
|
|
114
|
+
// TypeScript patterns to avoid
|
|
115
|
+
{
|
|
116
|
+
pattern: '\\benum\\s+\\w+',
|
|
117
|
+
deprecatedIn: 'best-practice',
|
|
118
|
+
replacement: 'const object with as const assertion',
|
|
119
|
+
severity: 'info',
|
|
120
|
+
reason: 'Enums have quirks. Consider using const objects for better tree-shaking',
|
|
121
|
+
docs: 'https://www.typescriptlang.org/docs/handbook/enums.html#const-enums'
|
|
122
|
+
},
|
|
123
|
+
// Next.js deprecations
|
|
124
|
+
{
|
|
125
|
+
pattern: 'getInitialProps',
|
|
126
|
+
library: 'next',
|
|
127
|
+
deprecatedIn: '13.0.0',
|
|
128
|
+
replacement: 'getServerSideProps or App Router with async components',
|
|
129
|
+
severity: 'warning',
|
|
130
|
+
reason: 'getInitialProps prevents static optimization'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
pattern: "from ['\"]next/router['\"]",
|
|
134
|
+
library: 'next',
|
|
135
|
+
deprecatedIn: '13.0.0',
|
|
136
|
+
replacement: "useRouter from 'next/navigation' in App Router",
|
|
137
|
+
severity: 'info',
|
|
138
|
+
reason: 'Use next/navigation for App Router projects'
|
|
139
|
+
},
|
|
140
|
+
// ============================================================
|
|
141
|
+
// SECURITY PATTERNS - Cross-language security vulnerabilities
|
|
142
|
+
// ============================================================
|
|
143
|
+
// Python CSRF disabled
|
|
144
|
+
{
|
|
145
|
+
pattern: 'csrf\\s*=\\s*False',
|
|
146
|
+
deprecatedIn: 'security',
|
|
147
|
+
replacement: "Never disable CSRF protection. Remove 'csrf = False' and use proper CSRF tokens.",
|
|
148
|
+
severity: 'error',
|
|
149
|
+
reason: 'CSRF protection is critical for security. Disabling it exposes users to cross-site request forgery attacks.'
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
pattern: 'WTF_CSRF_ENABLED\\s*=\\s*False',
|
|
153
|
+
deprecatedIn: 'security',
|
|
154
|
+
replacement: "Never disable CSRF. Remove 'WTF_CSRF_ENABLED = False' from config.",
|
|
155
|
+
severity: 'error',
|
|
156
|
+
reason: 'Flask-WTF CSRF protection should never be disabled in production.'
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
pattern: "@csrf_exempt",
|
|
160
|
+
deprecatedIn: 'security',
|
|
161
|
+
replacement: "Remove @csrf_exempt decorator. Use proper CSRF token handling instead.",
|
|
162
|
+
severity: 'error',
|
|
163
|
+
reason: 'csrf_exempt bypasses CSRF protection, creating security vulnerabilities.'
|
|
164
|
+
},
|
|
165
|
+
// Python hardcoded secrets
|
|
166
|
+
{
|
|
167
|
+
pattern: "SECRET_KEY\\s*=\\s*['\"][^'\"]{1,50}['\"]",
|
|
168
|
+
deprecatedIn: 'security',
|
|
169
|
+
replacement: "Use os.environ.get('SECRET_KEY') or secrets.token_hex(32)",
|
|
170
|
+
severity: 'error',
|
|
171
|
+
reason: 'Hardcoded secrets are exposed in version control and logs. Use environment variables.'
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
pattern: "API_KEY\\s*=\\s*['\"][^'\"]+['\"]",
|
|
175
|
+
deprecatedIn: 'security',
|
|
176
|
+
replacement: "Use os.environ.get('API_KEY') for API credentials",
|
|
177
|
+
severity: 'error',
|
|
178
|
+
reason: 'Hardcoded API keys are a security risk. Use environment variables.'
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
pattern: "PASSWORD\\s*=\\s*['\"][^'\"]+['\"]",
|
|
182
|
+
deprecatedIn: 'security',
|
|
183
|
+
replacement: "Never hardcode passwords. Use environment variables or secret managers.",
|
|
184
|
+
severity: 'error',
|
|
185
|
+
reason: 'Hardcoded passwords are a critical security vulnerability.'
|
|
186
|
+
},
|
|
187
|
+
// JavaScript/TypeScript prototype pollution
|
|
188
|
+
{
|
|
189
|
+
pattern: '\\.__proto__',
|
|
190
|
+
deprecatedIn: 'security',
|
|
191
|
+
replacement: "Use Object.getPrototypeOf() or Object.setPrototypeOf() instead of __proto__",
|
|
192
|
+
severity: 'error',
|
|
193
|
+
reason: 'Direct __proto__ access enables prototype pollution attacks.'
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
pattern: '\\[\\s*[\'"]__proto__[\'"]\\s*\\]',
|
|
197
|
+
deprecatedIn: 'security',
|
|
198
|
+
replacement: "Never allow user input to access __proto__. Validate and sanitize object keys.",
|
|
199
|
+
severity: 'error',
|
|
200
|
+
reason: 'Bracket notation access to __proto__ is a prototype pollution vector.'
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
pattern: '\\[\\s*[\'"]constructor[\'"]\\s*\\]\\s*\\[',
|
|
204
|
+
deprecatedIn: 'security',
|
|
205
|
+
replacement: "Block access to constructor property from user input.",
|
|
206
|
+
severity: 'error',
|
|
207
|
+
reason: 'constructor[constructor] pattern enables prototype pollution.'
|
|
208
|
+
},
|
|
209
|
+
// SQL Injection patterns
|
|
210
|
+
{
|
|
211
|
+
pattern: 'cursor\\.execute\\s*\\(\\s*f[\'"]',
|
|
212
|
+
deprecatedIn: 'security',
|
|
213
|
+
replacement: "Use parameterized queries: cursor.execute('SELECT * FROM users WHERE id = %s', (user_id,))",
|
|
214
|
+
severity: 'error',
|
|
215
|
+
reason: 'F-string SQL queries are vulnerable to SQL injection attacks.'
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
pattern: '\\.execute\\s*\\([^)]*\\+[^)]*\\)',
|
|
219
|
+
deprecatedIn: 'security',
|
|
220
|
+
replacement: "Use parameterized queries instead of string concatenation.",
|
|
221
|
+
severity: 'error',
|
|
222
|
+
reason: 'String concatenation in SQL queries enables SQL injection.'
|
|
223
|
+
},
|
|
224
|
+
// XSS patterns
|
|
225
|
+
{
|
|
226
|
+
pattern: 'dangerouslySetInnerHTML',
|
|
227
|
+
deprecatedIn: 'security',
|
|
228
|
+
replacement: "Sanitize HTML with DOMPurify before using dangerouslySetInnerHTML, or use safe alternatives.",
|
|
229
|
+
severity: 'warning',
|
|
230
|
+
reason: 'dangerouslySetInnerHTML can lead to XSS vulnerabilities if content is not sanitized.'
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
pattern: '\\.innerHTML\\s*=',
|
|
234
|
+
deprecatedIn: 'security',
|
|
235
|
+
replacement: "Use textContent for text, or sanitize HTML before setting innerHTML.",
|
|
236
|
+
severity: 'warning',
|
|
237
|
+
reason: 'Direct innerHTML assignment can lead to XSS attacks.'
|
|
238
|
+
},
|
|
239
|
+
// Insecure session/cookie settings
|
|
240
|
+
{
|
|
241
|
+
pattern: 'SESSION_COOKIE_SECURE\\s*=\\s*False',
|
|
242
|
+
deprecatedIn: 'security',
|
|
243
|
+
replacement: "Set SESSION_COOKIE_SECURE = True in production",
|
|
244
|
+
severity: 'error',
|
|
245
|
+
reason: 'Insecure cookies can be intercepted over HTTP connections.'
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
pattern: 'SESSION_COOKIE_HTTPONLY\\s*=\\s*False',
|
|
249
|
+
deprecatedIn: 'security',
|
|
250
|
+
replacement: "Set SESSION_COOKIE_HTTPONLY = True to prevent XSS cookie theft",
|
|
251
|
+
severity: 'error',
|
|
252
|
+
reason: 'Non-HTTPOnly cookies are accessible via JavaScript, enabling XSS attacks.'
|
|
253
|
+
},
|
|
254
|
+
// Debug mode in production
|
|
255
|
+
{
|
|
256
|
+
pattern: 'DEBUG\\s*=\\s*True',
|
|
257
|
+
deprecatedIn: 'security',
|
|
258
|
+
replacement: "Use DEBUG = os.environ.get('DEBUG', 'False') == 'True'",
|
|
259
|
+
severity: 'warning',
|
|
260
|
+
reason: 'Debug mode in production exposes sensitive information and stack traces.'
|
|
261
|
+
}
|
|
262
|
+
];
|
|
@@ -11,264 +11,7 @@ import semver from 'semver';
|
|
|
11
11
|
* Built-in deprecation database.
|
|
12
12
|
* This is bundled with Rigour and updated with releases.
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
// React deprecations
|
|
16
|
-
{
|
|
17
|
-
pattern: 'componentWillMount',
|
|
18
|
-
library: 'react',
|
|
19
|
-
deprecatedIn: '16.3.0',
|
|
20
|
-
replacement: 'useEffect(() => { ... }, [])',
|
|
21
|
-
severity: 'error',
|
|
22
|
-
reason: 'Unsafe lifecycle method removed in React 18',
|
|
23
|
-
docs: 'https://react.dev/reference/react/Component#unsafe_componentwillmount'
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
pattern: 'componentWillReceiveProps',
|
|
27
|
-
library: 'react',
|
|
28
|
-
deprecatedIn: '16.3.0',
|
|
29
|
-
replacement: 'getDerivedStateFromProps or useEffect',
|
|
30
|
-
severity: 'error',
|
|
31
|
-
reason: 'Unsafe lifecycle method removed in React 18'
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
pattern: 'componentWillUpdate',
|
|
35
|
-
library: 'react',
|
|
36
|
-
deprecatedIn: '16.3.0',
|
|
37
|
-
replacement: 'getSnapshotBeforeUpdate or useEffect',
|
|
38
|
-
severity: 'error',
|
|
39
|
-
reason: 'Unsafe lifecycle method removed in React 18'
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
pattern: 'UNSAFE_componentWillMount',
|
|
43
|
-
library: 'react',
|
|
44
|
-
deprecatedIn: '18.0.0',
|
|
45
|
-
replacement: 'useEffect(() => { ... }, [])',
|
|
46
|
-
severity: 'warning',
|
|
47
|
-
reason: 'Prepare for React 19 removal'
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
pattern: 'ReactDOM.render',
|
|
51
|
-
library: 'react-dom',
|
|
52
|
-
deprecatedIn: '18.0.0',
|
|
53
|
-
replacement: 'createRoot(container).render(<App />)',
|
|
54
|
-
severity: 'error',
|
|
55
|
-
reason: 'Legacy root API deprecated in React 18'
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
pattern: 'ReactDOM.hydrate',
|
|
59
|
-
library: 'react-dom',
|
|
60
|
-
deprecatedIn: '18.0.0',
|
|
61
|
-
replacement: 'hydrateRoot(container, <App />)',
|
|
62
|
-
severity: 'error',
|
|
63
|
-
reason: 'Legacy hydration API deprecated in React 18'
|
|
64
|
-
},
|
|
65
|
-
// Package deprecations
|
|
66
|
-
{
|
|
67
|
-
pattern: "import.*from ['\"]moment['\"]",
|
|
68
|
-
deprecatedIn: 'ecosystem',
|
|
69
|
-
replacement: "import { format } from 'date-fns'",
|
|
70
|
-
severity: 'warning',
|
|
71
|
-
reason: 'moment.js is in maintenance mode since September 2020',
|
|
72
|
-
docs: 'https://momentjs.com/docs/#/-project-status/'
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
pattern: "require\\(['\"]request['\"]\\)",
|
|
76
|
-
deprecatedIn: 'ecosystem',
|
|
77
|
-
replacement: 'Use native fetch or axios',
|
|
78
|
-
severity: 'error',
|
|
79
|
-
reason: 'request package deprecated in February 2020'
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
pattern: "import.*from ['\"]request['\"]",
|
|
83
|
-
deprecatedIn: 'ecosystem',
|
|
84
|
-
replacement: 'Use native fetch or axios',
|
|
85
|
-
severity: 'error',
|
|
86
|
-
reason: 'request package deprecated in February 2020'
|
|
87
|
-
},
|
|
88
|
-
// JavaScript/TypeScript deprecations
|
|
89
|
-
{
|
|
90
|
-
pattern: '\\bvar\\s+\\w+\\s*=',
|
|
91
|
-
deprecatedIn: 'es6',
|
|
92
|
-
replacement: 'Use const or let',
|
|
93
|
-
severity: 'warning',
|
|
94
|
-
reason: 'var has function scope which leads to bugs. Use block-scoped const/let'
|
|
95
|
-
},
|
|
96
|
-
// Redux deprecations
|
|
97
|
-
{
|
|
98
|
-
pattern: 'createStore\\(',
|
|
99
|
-
library: 'redux',
|
|
100
|
-
deprecatedIn: '4.2.0',
|
|
101
|
-
replacement: "configureStore from '@reduxjs/toolkit'",
|
|
102
|
-
severity: 'warning',
|
|
103
|
-
reason: 'Redux Toolkit is now the recommended way',
|
|
104
|
-
docs: 'https://redux.js.org/introduction/why-rtk-is-redux-today'
|
|
105
|
-
},
|
|
106
|
-
// Node.js deprecations
|
|
107
|
-
{
|
|
108
|
-
pattern: 'new Buffer\\(',
|
|
109
|
-
deprecatedIn: 'node@6.0.0',
|
|
110
|
-
replacement: 'Buffer.alloc() or Buffer.from()',
|
|
111
|
-
severity: 'error',
|
|
112
|
-
reason: 'Buffer constructor is a security hazard'
|
|
113
|
-
},
|
|
114
|
-
// Express deprecations
|
|
115
|
-
{
|
|
116
|
-
pattern: 'app\\.del\\(',
|
|
117
|
-
library: 'express',
|
|
118
|
-
deprecatedIn: '4.0.0',
|
|
119
|
-
replacement: 'app.delete()',
|
|
120
|
-
severity: 'warning',
|
|
121
|
-
reason: 'app.del() was renamed to app.delete()'
|
|
122
|
-
},
|
|
123
|
-
// TypeScript patterns to avoid
|
|
124
|
-
{
|
|
125
|
-
pattern: '\\benum\\s+\\w+',
|
|
126
|
-
deprecatedIn: 'best-practice',
|
|
127
|
-
replacement: 'const object with as const assertion',
|
|
128
|
-
severity: 'info',
|
|
129
|
-
reason: 'Enums have quirks. Consider using const objects for better tree-shaking',
|
|
130
|
-
docs: 'https://www.typescriptlang.org/docs/handbook/enums.html#const-enums'
|
|
131
|
-
},
|
|
132
|
-
// Next.js deprecations
|
|
133
|
-
{
|
|
134
|
-
pattern: 'getInitialProps',
|
|
135
|
-
library: 'next',
|
|
136
|
-
deprecatedIn: '13.0.0',
|
|
137
|
-
replacement: 'getServerSideProps or App Router with async components',
|
|
138
|
-
severity: 'warning',
|
|
139
|
-
reason: 'getInitialProps prevents static optimization'
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
pattern: "from ['\"]next/router['\"]",
|
|
143
|
-
library: 'next',
|
|
144
|
-
deprecatedIn: '13.0.0',
|
|
145
|
-
replacement: "useRouter from 'next/navigation' in App Router",
|
|
146
|
-
severity: 'info',
|
|
147
|
-
reason: 'Use next/navigation for App Router projects'
|
|
148
|
-
},
|
|
149
|
-
// ============================================================
|
|
150
|
-
// SECURITY PATTERNS - Cross-language security vulnerabilities
|
|
151
|
-
// ============================================================
|
|
152
|
-
// Python CSRF disabled
|
|
153
|
-
{
|
|
154
|
-
pattern: 'csrf\\s*=\\s*False',
|
|
155
|
-
deprecatedIn: 'security',
|
|
156
|
-
replacement: "Never disable CSRF protection. Remove 'csrf = False' and use proper CSRF tokens.",
|
|
157
|
-
severity: 'error',
|
|
158
|
-
reason: 'CSRF protection is critical for security. Disabling it exposes users to cross-site request forgery attacks.'
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
pattern: 'WTF_CSRF_ENABLED\\s*=\\s*False',
|
|
162
|
-
deprecatedIn: 'security',
|
|
163
|
-
replacement: "Never disable CSRF. Remove 'WTF_CSRF_ENABLED = False' from config.",
|
|
164
|
-
severity: 'error',
|
|
165
|
-
reason: 'Flask-WTF CSRF protection should never be disabled in production.'
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
pattern: "@csrf_exempt",
|
|
169
|
-
deprecatedIn: 'security',
|
|
170
|
-
replacement: "Remove @csrf_exempt decorator. Use proper CSRF token handling instead.",
|
|
171
|
-
severity: 'error',
|
|
172
|
-
reason: 'csrf_exempt bypasses CSRF protection, creating security vulnerabilities.'
|
|
173
|
-
},
|
|
174
|
-
// Python hardcoded secrets
|
|
175
|
-
{
|
|
176
|
-
pattern: "SECRET_KEY\\s*=\\s*['\"][^'\"]{1,50}['\"]",
|
|
177
|
-
deprecatedIn: 'security',
|
|
178
|
-
replacement: "Use os.environ.get('SECRET_KEY') or secrets.token_hex(32)",
|
|
179
|
-
severity: 'error',
|
|
180
|
-
reason: 'Hardcoded secrets are exposed in version control and logs. Use environment variables.'
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
pattern: "API_KEY\\s*=\\s*['\"][^'\"]+['\"]",
|
|
184
|
-
deprecatedIn: 'security',
|
|
185
|
-
replacement: "Use os.environ.get('API_KEY') for API credentials",
|
|
186
|
-
severity: 'error',
|
|
187
|
-
reason: 'Hardcoded API keys are a security risk. Use environment variables.'
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
pattern: "PASSWORD\\s*=\\s*['\"][^'\"]+['\"]",
|
|
191
|
-
deprecatedIn: 'security',
|
|
192
|
-
replacement: "Never hardcode passwords. Use environment variables or secret managers.",
|
|
193
|
-
severity: 'error',
|
|
194
|
-
reason: 'Hardcoded passwords are a critical security vulnerability.'
|
|
195
|
-
},
|
|
196
|
-
// JavaScript/TypeScript prototype pollution
|
|
197
|
-
{
|
|
198
|
-
pattern: '\\.__proto__',
|
|
199
|
-
deprecatedIn: 'security',
|
|
200
|
-
replacement: "Use Object.getPrototypeOf() or Object.setPrototypeOf() instead of __proto__",
|
|
201
|
-
severity: 'error',
|
|
202
|
-
reason: 'Direct __proto__ access enables prototype pollution attacks.'
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
pattern: '\\[\\s*[\'"]__proto__[\'"]\\s*\\]',
|
|
206
|
-
deprecatedIn: 'security',
|
|
207
|
-
replacement: "Never allow user input to access __proto__. Validate and sanitize object keys.",
|
|
208
|
-
severity: 'error',
|
|
209
|
-
reason: 'Bracket notation access to __proto__ is a prototype pollution vector.'
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
pattern: '\\[\\s*[\'"]constructor[\'"]\\s*\\]\\s*\\[',
|
|
213
|
-
deprecatedIn: 'security',
|
|
214
|
-
replacement: "Block access to constructor property from user input.",
|
|
215
|
-
severity: 'error',
|
|
216
|
-
reason: 'constructor[constructor] pattern enables prototype pollution.'
|
|
217
|
-
},
|
|
218
|
-
// SQL Injection patterns
|
|
219
|
-
{
|
|
220
|
-
pattern: 'cursor\\.execute\\s*\\(\\s*f[\'"]',
|
|
221
|
-
deprecatedIn: 'security',
|
|
222
|
-
replacement: "Use parameterized queries: cursor.execute('SELECT * FROM users WHERE id = %s', (user_id,))",
|
|
223
|
-
severity: 'error',
|
|
224
|
-
reason: 'F-string SQL queries are vulnerable to SQL injection attacks.'
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
pattern: '\\.execute\\s*\\([^)]*\\+[^)]*\\)',
|
|
228
|
-
deprecatedIn: 'security',
|
|
229
|
-
replacement: "Use parameterized queries instead of string concatenation.",
|
|
230
|
-
severity: 'error',
|
|
231
|
-
reason: 'String concatenation in SQL queries enables SQL injection.'
|
|
232
|
-
},
|
|
233
|
-
// XSS patterns
|
|
234
|
-
{
|
|
235
|
-
pattern: 'dangerouslySetInnerHTML',
|
|
236
|
-
deprecatedIn: 'security',
|
|
237
|
-
replacement: "Sanitize HTML with DOMPurify before using dangerouslySetInnerHTML, or use safe alternatives.",
|
|
238
|
-
severity: 'warning',
|
|
239
|
-
reason: 'dangerouslySetInnerHTML can lead to XSS vulnerabilities if content is not sanitized.'
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
pattern: '\\.innerHTML\\s*=',
|
|
243
|
-
deprecatedIn: 'security',
|
|
244
|
-
replacement: "Use textContent for text, or sanitize HTML before setting innerHTML.",
|
|
245
|
-
severity: 'warning',
|
|
246
|
-
reason: 'Direct innerHTML assignment can lead to XSS attacks.'
|
|
247
|
-
},
|
|
248
|
-
// Insecure session/cookie settings
|
|
249
|
-
{
|
|
250
|
-
pattern: 'SESSION_COOKIE_SECURE\\s*=\\s*False',
|
|
251
|
-
deprecatedIn: 'security',
|
|
252
|
-
replacement: "Set SESSION_COOKIE_SECURE = True in production",
|
|
253
|
-
severity: 'error',
|
|
254
|
-
reason: 'Insecure cookies can be intercepted over HTTP connections.'
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
pattern: 'SESSION_COOKIE_HTTPONLY\\s*=\\s*False',
|
|
258
|
-
deprecatedIn: 'security',
|
|
259
|
-
replacement: "Set SESSION_COOKIE_HTTPONLY = True to prevent XSS cookie theft",
|
|
260
|
-
severity: 'error',
|
|
261
|
-
reason: 'Non-HTTPOnly cookies are accessible via JavaScript, enabling XSS attacks.'
|
|
262
|
-
},
|
|
263
|
-
// Debug mode in production
|
|
264
|
-
{
|
|
265
|
-
pattern: 'DEBUG\\s*=\\s*True',
|
|
266
|
-
deprecatedIn: 'security',
|
|
267
|
-
replacement: "Use DEBUG = os.environ.get('DEBUG', 'False') == 'True'",
|
|
268
|
-
severity: 'warning',
|
|
269
|
-
reason: 'Debug mode in production exposes sensitive information and stack traces.'
|
|
270
|
-
}
|
|
271
|
-
];
|
|
14
|
+
import { BUILT_IN_DEPRECATIONS } from './staleness-data.js';
|
|
272
15
|
/**
|
|
273
16
|
* Staleness Detector class.
|
|
274
17
|
*/
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
export declare const TEMPLATES: Template[];
|
|
15
|
-
export declare const PARADIGM_TEMPLATES: Template[];
|
|
16
|
-
export declare const UNIVERSAL_CONFIG: Config;
|
|
1
|
+
/**
|
|
2
|
+
* Templates — Public Barrel
|
|
3
|
+
*
|
|
4
|
+
* Re-exports from sub-modules so that existing importers keep working.
|
|
5
|
+
* - Preset definitions → ./presets.ts
|
|
6
|
+
* - Paradigm templates → ./paradigms.ts
|
|
7
|
+
* - Universal config → ./universal-config.ts
|
|
8
|
+
*/
|
|
9
|
+
export type { Template } from './presets.js';
|
|
10
|
+
export { TEMPLATES } from './presets.js';
|
|
11
|
+
export { PARADIGM_TEMPLATES } from './paradigms.js';
|
|
12
|
+
export { UNIVERSAL_CONFIG } from './universal-config.js';
|