@eslint-react/shared 3.0.0-next.0 → 3.0.0-next.2

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/index.d.ts CHANGED
@@ -212,6 +212,14 @@ declare const RE_COMPONENT_NAME_LOOSE: RegExp;
212
212
  * Regular expression for matching a React Hook name.
213
213
  */
214
214
  declare const RE_HOOK_NAME: RegExp;
215
+ /**
216
+ * Known impure functions
217
+ */
218
+ declare const IMPURE_FUNCTIONS: ReadonlyMap<string, ReadonlySet<string>>;
219
+ /**
220
+ * Known impure global constructors used with `new`
221
+ */
222
+ declare const IMPURE_CONSTRUCTORS: ReadonlySet<string>;
215
223
  //#endregion
216
224
  //#region src/define-rule-listener.d.ts
217
225
  /**
@@ -400,4 +408,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
400
408
  }
401
409
  }
402
410
  //#endregion
403
- export { CompatibleConfig, CompatiblePlugin, CompatibleRule, CompilationMode, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, IdGenerator, NPM_SCOPE, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE, RE_HOOK_NAME, RE_HTML_TAG, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, RegExpLike, RuleConfig, RuleContext, RuleFeature, RulePolicy, RuleSuggest, SettingsConfig, Severity, SeverityLevel, SeverityName, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getConfigAdapters, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
411
+ export { CompatibleConfig, CompatiblePlugin, CompatibleRule, CompilationMode, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, IMPURE_CONSTRUCTORS, IMPURE_FUNCTIONS, IdGenerator, NPM_SCOPE, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE, RE_HOOK_NAME, RE_HTML_TAG, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, RegExpLike, RuleConfig, RuleContext, RuleFeature, RulePolicy, RuleSuggest, SettingsConfig, Severity, SeverityLevel, SeverityName, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getConfigAdapters, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
package/dist/index.js CHANGED
@@ -138,6 +138,273 @@ const RE_COMPONENT_NAME_LOOSE = /^_?[A-Z]/u;
138
138
  * Regular expression for matching a React Hook name.
139
139
  */
140
140
  const RE_HOOK_NAME = /^use/u;
141
+ /**
142
+ * Known impure functions
143
+ */
144
+ const IMPURE_FUNCTIONS = new Map([
145
+ ["Atomics", new Set([
146
+ "add",
147
+ "and",
148
+ "compareExchange",
149
+ "exchange",
150
+ "load",
151
+ "notify",
152
+ "or",
153
+ "store",
154
+ "sub",
155
+ "wait",
156
+ "waitAsync",
157
+ "xor"
158
+ ])],
159
+ ["caches", new Set([
160
+ "delete",
161
+ "has",
162
+ "keys",
163
+ "match",
164
+ "open"
165
+ ])],
166
+ ["clipboard", new Set([
167
+ "read",
168
+ "readText",
169
+ "write",
170
+ "writeText"
171
+ ])],
172
+ ["console", new Set([
173
+ "assert",
174
+ "clear",
175
+ "count",
176
+ "countReset",
177
+ "debug",
178
+ "dir",
179
+ "dirxml",
180
+ "error",
181
+ "group",
182
+ "groupCollapsed",
183
+ "groupEnd",
184
+ "info",
185
+ "log",
186
+ "profile",
187
+ "profileEnd",
188
+ "table",
189
+ "time",
190
+ "timeEnd",
191
+ "timeLog",
192
+ "timeStamp",
193
+ "trace",
194
+ "warn"
195
+ ])],
196
+ ["cookieStore", new Set([
197
+ "delete",
198
+ "get",
199
+ "getAll",
200
+ "set"
201
+ ])],
202
+ ["crypto", new Set(["getRandomValues", "randomUUID"])],
203
+ ["Date", new Set(["now"])],
204
+ ["document", new Set([
205
+ "adoptNode",
206
+ "append",
207
+ "close",
208
+ "createAttribute",
209
+ "createAttributeNS",
210
+ "createCDATASection",
211
+ "createComment",
212
+ "createDocumentFragment",
213
+ "createDocumentType",
214
+ "createElement",
215
+ "createElementNS",
216
+ "createEvent",
217
+ "createNodeIterator",
218
+ "createProcessingInstruction",
219
+ "createRange",
220
+ "createTextNode",
221
+ "createTreeWalker",
222
+ "elementFromPoint",
223
+ "elementsFromPoint",
224
+ "execCommand",
225
+ "exitFullscreen",
226
+ "exitPictureInPicture",
227
+ "exitPointerLock",
228
+ "getAnimations",
229
+ "getElementById",
230
+ "getElementsByClassName",
231
+ "getElementsByName",
232
+ "getElementsByTagName",
233
+ "getElementsByTagNameNS",
234
+ "getSelection",
235
+ "hasFocus",
236
+ "importNode",
237
+ "open",
238
+ "prepend",
239
+ "querySelector",
240
+ "querySelectorAll",
241
+ "replaceChildren",
242
+ "requestStorageAccess",
243
+ "startViewTransition",
244
+ "write",
245
+ "writeln"
246
+ ])],
247
+ ["history", new Set([
248
+ "back",
249
+ "forward",
250
+ "go",
251
+ "pushState",
252
+ "replaceState"
253
+ ])],
254
+ ["indexedDB", new Set([
255
+ "databases",
256
+ "deleteDatabase",
257
+ "open"
258
+ ])],
259
+ ["localStorage", new Set([
260
+ "clear",
261
+ "getItem",
262
+ "key",
263
+ "removeItem",
264
+ "setItem"
265
+ ])],
266
+ ["location", new Set([
267
+ "assign",
268
+ "reload",
269
+ "replace"
270
+ ])],
271
+ ["Math", new Set(["random"])],
272
+ ["navigation", new Set([
273
+ "back",
274
+ "forward",
275
+ "navigate",
276
+ "reload",
277
+ "traverseTo",
278
+ "updateCurrentEntry"
279
+ ])],
280
+ ["navigator", new Set([
281
+ "canShare",
282
+ "getBattery",
283
+ "getGamepads",
284
+ "getUserMedia",
285
+ "javaEnabled",
286
+ "registerProtocolHandler",
287
+ "requestMediaKeySystemAccess",
288
+ "requestMIDIAccess",
289
+ "sendBeacon",
290
+ "share",
291
+ "vibrate"
292
+ ])],
293
+ ["Notification", new Set(["requestPermission"])],
294
+ ["Object", new Set([
295
+ "assign",
296
+ "defineProperties",
297
+ "defineProperty",
298
+ "freeze",
299
+ "preventExtensions",
300
+ "seal",
301
+ "setPrototypeOf"
302
+ ])],
303
+ ["performance", new Set([
304
+ "clearMarks",
305
+ "clearMeasures",
306
+ "getEntries",
307
+ "getEntriesByName",
308
+ "getEntriesByType",
309
+ "mark",
310
+ "measure",
311
+ "now"
312
+ ])],
313
+ ["process", new Set([
314
+ "abort",
315
+ "chdir",
316
+ "cpuUsage",
317
+ "emitWarning",
318
+ "exit",
319
+ "hrtime",
320
+ "kill",
321
+ "memoryUsage",
322
+ "nextTick",
323
+ "send",
324
+ "stderr",
325
+ "stdout"
326
+ ])],
327
+ ["Reflect", new Set([
328
+ "defineProperty",
329
+ "deleteProperty",
330
+ "preventExtensions",
331
+ "set",
332
+ "setPrototypeOf"
333
+ ])],
334
+ ["scheduler", new Set(["postTask", "yield"])],
335
+ ["sessionStorage", new Set([
336
+ "clear",
337
+ "getItem",
338
+ "key",
339
+ "removeItem",
340
+ "setItem"
341
+ ])],
342
+ ["URL", new Set(["createObjectURL", "revokeObjectURL"])],
343
+ ["window", new Set([
344
+ "addEventListener",
345
+ "alert",
346
+ "blur",
347
+ "cancelAnimationFrame",
348
+ "cancelIdleCallback",
349
+ "clearInterval",
350
+ "clearTimeout",
351
+ "close",
352
+ "confirm",
353
+ "dispatchEvent",
354
+ "fetch",
355
+ "focus",
356
+ "getComputedStyle",
357
+ "getSelection",
358
+ "matchMedia",
359
+ "moveBy",
360
+ "moveTo",
361
+ "open",
362
+ "postMessage",
363
+ "print",
364
+ "prompt",
365
+ "queueMicrotask",
366
+ "removeEventListener",
367
+ "requestAnimationFrame",
368
+ "requestIdleCallback",
369
+ "resizeBy",
370
+ "resizeTo",
371
+ "scroll",
372
+ "scrollBy",
373
+ "scrollTo",
374
+ "setInterval",
375
+ "setTimeout",
376
+ "stop"
377
+ ])]
378
+ ]);
379
+ /**
380
+ * Known impure global constructors used with `new`
381
+ */
382
+ const IMPURE_CONSTRUCTORS = new Set([
383
+ "AbortController",
384
+ "Audio",
385
+ "AudioContext",
386
+ "BroadcastChannel",
387
+ "Date",
388
+ "EventSource",
389
+ "FileReader",
390
+ "Image",
391
+ "IntersectionObserver",
392
+ "MediaRecorder",
393
+ "MediaSource",
394
+ "MediaStream",
395
+ "MessageChannel",
396
+ "MutationObserver",
397
+ "Notification",
398
+ "OfflineAudioContext",
399
+ "PerformanceObserver",
400
+ "ReportingObserver",
401
+ "ResizeObserver",
402
+ "RTCPeerConnection",
403
+ "SharedWorker",
404
+ "WebSocket",
405
+ "Worker",
406
+ "XMLHttpRequest"
407
+ ]);
141
408
 
142
409
  //#endregion
143
410
  //#region src/define-rule-listener.ts
@@ -314,7 +581,7 @@ const normalizeSettings = ({ importSource = "react", compilationMode = "annotati
314
581
  compilationMode,
315
582
  isCompilerEnabled: compilationMode !== "off",
316
583
  polymorphicPropName,
317
- version: match(version).with(P.union(P.nullish, "", "detect"), () => getReactVersion("19.2.0")).otherwise(identity),
584
+ version: match(version).with(P.union(P.nullish, "", "detect"), () => getReactVersion("19.2.4")).otherwise(identity),
318
585
  additionalStateHooks: toRegExp(additionalStateHooks)
319
586
  };
320
587
  };
@@ -335,4 +602,4 @@ function getSettingsFromContext(context) {
335
602
  const defineSettings = identity;
336
603
 
337
604
  //#endregion
338
- export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, IdGenerator, NPM_SCOPE, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE, RE_HOOK_NAME, RE_HTML_TAG, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getConfigAdapters, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
605
+ export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, IMPURE_CONSTRUCTORS, IMPURE_FUNCTIONS, IdGenerator, NPM_SCOPE, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE, RE_HOOK_NAME, RE_HTML_TAG, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getConfigAdapters, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "3.0.0-next.0",
3
+ "version": "3.0.0-next.2",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -33,7 +33,7 @@
33
33
  "@typescript-eslint/utils": "^8.56.0",
34
34
  "ts-pattern": "^5.9.0",
35
35
  "zod": "^3.25.0 || ^4.0.0",
36
- "@eslint-react/eff": "3.0.0-next.0"
36
+ "@eslint-react/eff": "3.0.0-next.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@tsconfig/node24": "^24.0.4",