@eslint-react/shared 1.20.0-next.7 → 1.20.0

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.mts CHANGED
@@ -2152,9 +2152,16 @@ type PartialObjectDeep<ObjectType extends object, Options extends PartialDeepOpt
2152
2152
  };
2153
2153
 
2154
2154
  /**
2155
- * The initial settings for "react-x".
2155
+ * The default ESLint settings for "react-x".
2156
2156
  */
2157
- declare const INITIAL_ESLINT_REACT_SETTINGS: {};
2157
+ declare const DEFAULT_ESLINT_REACT_SETTINGS: {
2158
+ readonly additionalHooks: {
2159
+ readonly useLayoutEffect: ["useIsomorphicLayoutEffect"];
2160
+ };
2161
+ readonly polymorphicPropName: "as";
2162
+ readonly strictImportCheck: false;
2163
+ readonly version: "detect";
2164
+ };
2158
2165
  /**
2159
2166
  * Unsafely casts settings from a data object from `context.settings`.
2160
2167
  * @internal
@@ -2168,96 +2175,14 @@ declare function unsafeReadSettings(data: unknown): PartialDeep<ESLintReactSetti
2168
2175
  * @param data The data object.
2169
2176
  * @returns settings The settings.
2170
2177
  */
2171
- declare const decodeSettings: Memoized<(data: unknown) => {
2172
- readonly importSource?: string;
2173
- readonly jsxPragma?: string;
2174
- readonly jsxPragmaFrag?: string;
2175
- readonly polymorphicPropName?: string;
2176
- readonly strict?: boolean;
2177
- readonly strictImportCheck?: boolean;
2178
- readonly version?: string;
2179
- readonly additionalComponents?: {
2180
- name: string;
2181
- as?: string;
2182
- selector?: string;
2183
- attributes?: {
2184
- name: string;
2185
- as?: string;
2186
- controlled?: boolean;
2187
- defaultValue?: string;
2188
- }[];
2189
- }[];
2190
- readonly additionalHooks?: {
2191
- use?: string[];
2192
- useActionState?: string[];
2193
- useCallback?: string[];
2194
- useContext?: string[];
2195
- useDebugValue?: string[];
2196
- useDeferredValue?: string[];
2197
- useEffect?: string[];
2198
- useFormStatus?: string[];
2199
- useId?: string[];
2200
- useImperativeHandle?: string[];
2201
- useInsertionEffect?: string[];
2202
- useLayoutEffect?: string[];
2203
- useMemo?: string[];
2204
- useOptimistic?: string[];
2205
- useReducer?: string[];
2206
- useRef?: string[];
2207
- useState?: string[];
2208
- useSyncExternalStore?: string[];
2209
- useTransition?: string[];
2210
- };
2211
- }>;
2178
+ declare const decodeSettings: Memoized<(data: unknown) => ESLintReactSettings>;
2212
2179
  /**
2213
2180
  * Normalizes the settings by converting all shorthand properties to their full form.
2214
2181
  * @param settings The settings.
2215
2182
  * @returns The normalized settings.
2216
2183
  * @internal
2217
2184
  */
2218
- declare const normalizeSettings: Memoized<(settings: ESLintReactSettings) => {
2219
- readonly additionalComponents: {
2220
- attributes: {
2221
- as: string;
2222
- name: string;
2223
- controlled?: boolean;
2224
- defaultValue?: string;
2225
- }[];
2226
- re: RegExp;
2227
- name: string;
2228
- as?: string;
2229
- selector?: string;
2230
- }[];
2231
- readonly components: Map<string, string>;
2232
- readonly version: string;
2233
- readonly importSource?: string;
2234
- readonly jsxPragma?: string;
2235
- readonly jsxPragmaFrag?: string;
2236
- readonly polymorphicPropName?: string;
2237
- readonly strict?: boolean;
2238
- readonly strictImportCheck?: boolean;
2239
- readonly additionalHooks?: {
2240
- use?: string[];
2241
- useActionState?: string[];
2242
- useCallback?: string[];
2243
- useContext?: string[];
2244
- useDebugValue?: string[];
2245
- useDeferredValue?: string[];
2246
- useEffect?: string[];
2247
- useFormStatus?: string[];
2248
- useId?: string[];
2249
- useImperativeHandle?: string[];
2250
- useInsertionEffect?: string[];
2251
- useLayoutEffect?: string[];
2252
- useMemo?: string[];
2253
- useOptimistic?: string[];
2254
- useReducer?: string[];
2255
- useRef?: string[];
2256
- useState?: string[];
2257
- useSyncExternalStore?: string[];
2258
- useTransition?: string[];
2259
- };
2260
- }>;
2185
+ declare const normalizeSettings: Memoized<(settings: ESLintReactSettings) => ESLintReactSettingsNormalized>;
2261
2186
  /**
2262
2187
  * A helper function to define settings for "react-x" with type checking in JavaScript files.
2263
2188
  * @param settings The settings.
@@ -2270,4 +2195,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
2270
2195
  }
2271
2196
  }
2272
2197
 
2273
- export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, INITIAL_ESLINT_REACT_SETTINGS, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, normalizeSettings, unsafeReadSettings };
2198
+ export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, normalizeSettings, unsafeReadSettings };
package/dist/index.d.ts CHANGED
@@ -2152,9 +2152,16 @@ type PartialObjectDeep<ObjectType extends object, Options extends PartialDeepOpt
2152
2152
  };
2153
2153
 
2154
2154
  /**
2155
- * The initial settings for "react-x".
2155
+ * The default ESLint settings for "react-x".
2156
2156
  */
2157
- declare const INITIAL_ESLINT_REACT_SETTINGS: {};
2157
+ declare const DEFAULT_ESLINT_REACT_SETTINGS: {
2158
+ readonly additionalHooks: {
2159
+ readonly useLayoutEffect: ["useIsomorphicLayoutEffect"];
2160
+ };
2161
+ readonly polymorphicPropName: "as";
2162
+ readonly strictImportCheck: false;
2163
+ readonly version: "detect";
2164
+ };
2158
2165
  /**
2159
2166
  * Unsafely casts settings from a data object from `context.settings`.
2160
2167
  * @internal
@@ -2168,96 +2175,14 @@ declare function unsafeReadSettings(data: unknown): PartialDeep<ESLintReactSetti
2168
2175
  * @param data The data object.
2169
2176
  * @returns settings The settings.
2170
2177
  */
2171
- declare const decodeSettings: Memoized<(data: unknown) => {
2172
- readonly importSource?: string;
2173
- readonly jsxPragma?: string;
2174
- readonly jsxPragmaFrag?: string;
2175
- readonly polymorphicPropName?: string;
2176
- readonly strict?: boolean;
2177
- readonly strictImportCheck?: boolean;
2178
- readonly version?: string;
2179
- readonly additionalComponents?: {
2180
- name: string;
2181
- as?: string;
2182
- selector?: string;
2183
- attributes?: {
2184
- name: string;
2185
- as?: string;
2186
- controlled?: boolean;
2187
- defaultValue?: string;
2188
- }[];
2189
- }[];
2190
- readonly additionalHooks?: {
2191
- use?: string[];
2192
- useActionState?: string[];
2193
- useCallback?: string[];
2194
- useContext?: string[];
2195
- useDebugValue?: string[];
2196
- useDeferredValue?: string[];
2197
- useEffect?: string[];
2198
- useFormStatus?: string[];
2199
- useId?: string[];
2200
- useImperativeHandle?: string[];
2201
- useInsertionEffect?: string[];
2202
- useLayoutEffect?: string[];
2203
- useMemo?: string[];
2204
- useOptimistic?: string[];
2205
- useReducer?: string[];
2206
- useRef?: string[];
2207
- useState?: string[];
2208
- useSyncExternalStore?: string[];
2209
- useTransition?: string[];
2210
- };
2211
- }>;
2178
+ declare const decodeSettings: Memoized<(data: unknown) => ESLintReactSettings>;
2212
2179
  /**
2213
2180
  * Normalizes the settings by converting all shorthand properties to their full form.
2214
2181
  * @param settings The settings.
2215
2182
  * @returns The normalized settings.
2216
2183
  * @internal
2217
2184
  */
2218
- declare const normalizeSettings: Memoized<(settings: ESLintReactSettings) => {
2219
- readonly additionalComponents: {
2220
- attributes: {
2221
- as: string;
2222
- name: string;
2223
- controlled?: boolean;
2224
- defaultValue?: string;
2225
- }[];
2226
- re: RegExp;
2227
- name: string;
2228
- as?: string;
2229
- selector?: string;
2230
- }[];
2231
- readonly components: Map<string, string>;
2232
- readonly version: string;
2233
- readonly importSource?: string;
2234
- readonly jsxPragma?: string;
2235
- readonly jsxPragmaFrag?: string;
2236
- readonly polymorphicPropName?: string;
2237
- readonly strict?: boolean;
2238
- readonly strictImportCheck?: boolean;
2239
- readonly additionalHooks?: {
2240
- use?: string[];
2241
- useActionState?: string[];
2242
- useCallback?: string[];
2243
- useContext?: string[];
2244
- useDebugValue?: string[];
2245
- useDeferredValue?: string[];
2246
- useEffect?: string[];
2247
- useFormStatus?: string[];
2248
- useId?: string[];
2249
- useImperativeHandle?: string[];
2250
- useInsertionEffect?: string[];
2251
- useLayoutEffect?: string[];
2252
- useMemo?: string[];
2253
- useOptimistic?: string[];
2254
- useReducer?: string[];
2255
- useRef?: string[];
2256
- useState?: string[];
2257
- useSyncExternalStore?: string[];
2258
- useTransition?: string[];
2259
- };
2260
- }>;
2185
+ declare const normalizeSettings: Memoized<(settings: ESLintReactSettings) => ESLintReactSettingsNormalized>;
2261
2186
  /**
2262
2187
  * A helper function to define settings for "react-x" with type checking in JavaScript files.
2263
2188
  * @param settings The settings.
@@ -2270,4 +2195,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
2270
2195
  }
2271
2196
  }
2272
2197
 
2273
- export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, INITIAL_ESLINT_REACT_SETTINGS, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, normalizeSettings, unsafeReadSettings };
2198
+ export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, normalizeSettings, unsafeReadSettings };
package/dist/index.js CHANGED
@@ -1326,13 +1326,20 @@ function createMemoizedFunction(fn, options) {
1326
1326
  memoized.options = normalizedOptions;
1327
1327
  return memoized;
1328
1328
  }
1329
- var INITIAL_ESLINT_REACT_SETTINGS = {};
1329
+ var DEFAULT_ESLINT_REACT_SETTINGS = {
1330
+ additionalHooks: {
1331
+ useLayoutEffect: ["useIsomorphicLayoutEffect"]
1332
+ },
1333
+ polymorphicPropName: "as",
1334
+ strictImportCheck: false,
1335
+ version: "detect"
1336
+ };
1330
1337
  function unsafeReadSettings(data) {
1331
1338
  return data?.["react-x"] ?? {};
1332
1339
  }
1333
1340
  var decodeSettings = createMemoizedFunction((data) => {
1334
1341
  return {
1335
- ...INITIAL_ESLINT_REACT_SETTINGS,
1342
+ ...DEFAULT_ESLINT_REACT_SETTINGS,
1336
1343
  ...parse(ESLintSettingsSchema, data)["react-x"] ?? {}
1337
1344
  };
1338
1345
  }, { isEqual: (a, b) => a === b });
@@ -1363,12 +1370,12 @@ exports.CustomAttributeSchema = CustomAttributeSchema;
1363
1370
  exports.CustomComponentNormalizedSchema = CustomComponentNormalizedSchema;
1364
1371
  exports.CustomComponentSchema = CustomComponentSchema;
1365
1372
  exports.CustomHookSchema = CustomHookSchema;
1373
+ exports.DEFAULT_ESLINT_REACT_SETTINGS = DEFAULT_ESLINT_REACT_SETTINGS;
1366
1374
  exports.ESLintReactSettingsSchema = ESLintReactSettingsSchema;
1367
1375
  exports.ESLintSettingsSchema = ESLintSettingsSchema;
1368
1376
  exports.GITHUB_URL = GITHUB_URL;
1369
1377
  exports.HOST_HTML_COMPONENT_TYPES = HOST_HTML_COMPONENT_TYPES;
1370
1378
  exports.HOST_SVG_COMPONENT_TYPES = HOST_SVG_COMPONENT_TYPES;
1371
- exports.INITIAL_ESLINT_REACT_SETTINGS = INITIAL_ESLINT_REACT_SETTINGS;
1372
1379
  exports.NPM_SCOPE = NPM_SCOPE;
1373
1380
  exports.REACT_BUILD_IN_HOOKS = REACT_BUILD_IN_HOOKS;
1374
1381
  exports.RE_CAMEL_CASE = RE_CAMEL_CASE;
package/dist/index.mjs CHANGED
@@ -1320,13 +1320,20 @@ function createMemoizedFunction(fn, options) {
1320
1320
  memoized.options = normalizedOptions;
1321
1321
  return memoized;
1322
1322
  }
1323
- var INITIAL_ESLINT_REACT_SETTINGS = {};
1323
+ var DEFAULT_ESLINT_REACT_SETTINGS = {
1324
+ additionalHooks: {
1325
+ useLayoutEffect: ["useIsomorphicLayoutEffect"]
1326
+ },
1327
+ polymorphicPropName: "as",
1328
+ strictImportCheck: false,
1329
+ version: "detect"
1330
+ };
1324
1331
  function unsafeReadSettings(data) {
1325
1332
  return data?.["react-x"] ?? {};
1326
1333
  }
1327
1334
  var decodeSettings = createMemoizedFunction((data) => {
1328
1335
  return {
1329
- ...INITIAL_ESLINT_REACT_SETTINGS,
1336
+ ...DEFAULT_ESLINT_REACT_SETTINGS,
1330
1337
  ...parse(ESLintSettingsSchema, data)["react-x"] ?? {}
1331
1338
  };
1332
1339
  }, { isEqual: (a, b) => a === b });
@@ -1353,4 +1360,4 @@ var normalizeSettings = createMemoizedFunction((settings) => {
1353
1360
  }, { isEqual: shallowEqual });
1354
1361
  var defineSettings = F.identity;
1355
1362
 
1356
- export { CustomAttributeSchema, CustomComponentNormalizedSchema, CustomComponentSchema, CustomHookSchema, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, INITIAL_ESLINT_REACT_SETTINGS, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, normalizeSettings, unsafeReadSettings };
1363
+ export { CustomAttributeSchema, CustomComponentNormalizedSchema, CustomComponentSchema, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, normalizeSettings, unsafeReadSettings };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "1.20.0-next.7",
3
+ "version": "1.20.0",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
@@ -38,8 +38,8 @@
38
38
  "@typescript-eslint/utils": "^8.18.0",
39
39
  "local-pkg": "^0.5.1",
40
40
  "picomatch": "^4.0.2",
41
- "ts-pattern": "^5.5.0",
42
- "@eslint-react/tools": "1.20.0-next.7"
41
+ "ts-pattern": "^5.6.0",
42
+ "@eslint-react/tools": "1.20.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/picomatch": "^3.0.1",