@eslint-react/core 1.23.2-next.1 → 1.23.2-next.3

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.js CHANGED
@@ -35,7 +35,7 @@ var VAR__namespace = /*#__PURE__*/_interopNamespace(VAR);
35
35
  function getElementRepresentName(node, context) {
36
36
  const rawElementName = JSX4__namespace.getElementName(node);
37
37
  if (rawElementName === rawElementName.toLowerCase()) return rawElementName;
38
- const { components, polymorphicPropName } = shared.normalizeSettings(shared.decodeSettings(context.settings));
38
+ const { components, polymorphicPropName } = shared.getSettingsFromContext(context);
39
39
  const asElementName = components.get(rawElementName);
40
40
  if (eff.isString(asElementName)) return asElementName;
41
41
  return eff.F.pipe(
@@ -60,7 +60,7 @@ function isInitializedFromReact(name, initialScope, settings) {
60
60
  // src/utils/is-from-react.ts
61
61
  function isFromReact(name) {
62
62
  return (node, context) => {
63
- const settings = shared.unsafeReadSettings(context.settings);
63
+ const settings = shared.getSettingsFromContext(context);
64
64
  const initialScope = context.sourceCode.getScope(node);
65
65
  if (node.type === types.AST_NODE_TYPES.MemberExpression) {
66
66
  return node.object.type === types.AST_NODE_TYPES.Identifier && node.property.type === types.AST_NODE_TYPES.Identifier && node.property.name === name && isInitializedFromReact(node.object.name, initialScope, settings);
@@ -71,7 +71,7 @@ function isFromReact(name) {
71
71
  }
72
72
  function isFromReactMember(memberName, name) {
73
73
  return (node, context) => {
74
- const settings = shared.unsafeReadSettings(context.settings);
74
+ const settings = shared.getSettingsFromContext(context);
75
75
  const initialScope = context.sourceCode.getScope(node);
76
76
  if (node.property.type !== types.AST_NODE_TYPES.Identifier || node.property.name !== name) return false;
77
77
  if (node.object.type === types.AST_NODE_TYPES.Identifier && node.object.name === memberName) {
@@ -172,7 +172,7 @@ function isReactHookCall(node) {
172
172
  return false;
173
173
  }
174
174
  function isReactHookCallWithName(node, context) {
175
- const settings = shared.unsafeReadSettings(context.settings);
175
+ const settings = shared.getSettingsFromContext(context);
176
176
  return (name) => {
177
177
  const initialScope = context.sourceCode.getScope(node);
178
178
  switch (true) {
@@ -198,7 +198,7 @@ function isReactHookCallWithNameLoose(node) {
198
198
  };
199
199
  }
200
200
  function isReactHookCallWithNameAlias(name, context, alias) {
201
- const settings = shared.unsafeReadSettings(context.settings);
201
+ const settings = shared.getSettingsFromContext(context);
202
202
  return (node) => {
203
203
  const initialScope = context.sourceCode.getScope(node);
204
204
  switch (true) {
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import { F, isString, O } from '@eslint-react/eff';
3
3
  import * as JSX4 from '@eslint-react/jsx';
4
4
  import { AST_NODE_TYPES } from '@typescript-eslint/types';
5
5
  import { isMatching, P, match } from 'ts-pattern';
6
- import { normalizeSettings, decodeSettings, unsafeReadSettings } from '@eslint-react/shared';
6
+ import { getSettingsFromContext } from '@eslint-react/shared';
7
7
  import * as VAR from '@eslint-react/var';
8
8
  import { birecord } from '@eslint-react/types';
9
9
 
@@ -11,7 +11,7 @@ import { birecord } from '@eslint-react/types';
11
11
  function getElementRepresentName(node, context) {
12
12
  const rawElementName = JSX4.getElementName(node);
13
13
  if (rawElementName === rawElementName.toLowerCase()) return rawElementName;
14
- const { components, polymorphicPropName } = normalizeSettings(decodeSettings(context.settings));
14
+ const { components, polymorphicPropName } = getSettingsFromContext(context);
15
15
  const asElementName = components.get(rawElementName);
16
16
  if (isString(asElementName)) return asElementName;
17
17
  return F.pipe(
@@ -36,7 +36,7 @@ function isInitializedFromReact(name, initialScope, settings) {
36
36
  // src/utils/is-from-react.ts
37
37
  function isFromReact(name) {
38
38
  return (node, context) => {
39
- const settings = unsafeReadSettings(context.settings);
39
+ const settings = getSettingsFromContext(context);
40
40
  const initialScope = context.sourceCode.getScope(node);
41
41
  if (node.type === AST_NODE_TYPES.MemberExpression) {
42
42
  return node.object.type === AST_NODE_TYPES.Identifier && node.property.type === AST_NODE_TYPES.Identifier && node.property.name === name && isInitializedFromReact(node.object.name, initialScope, settings);
@@ -47,7 +47,7 @@ function isFromReact(name) {
47
47
  }
48
48
  function isFromReactMember(memberName, name) {
49
49
  return (node, context) => {
50
- const settings = unsafeReadSettings(context.settings);
50
+ const settings = getSettingsFromContext(context);
51
51
  const initialScope = context.sourceCode.getScope(node);
52
52
  if (node.property.type !== AST_NODE_TYPES.Identifier || node.property.name !== name) return false;
53
53
  if (node.object.type === AST_NODE_TYPES.Identifier && node.object.name === memberName) {
@@ -148,7 +148,7 @@ function isReactHookCall(node) {
148
148
  return false;
149
149
  }
150
150
  function isReactHookCallWithName(node, context) {
151
- const settings = unsafeReadSettings(context.settings);
151
+ const settings = getSettingsFromContext(context);
152
152
  return (name) => {
153
153
  const initialScope = context.sourceCode.getScope(node);
154
154
  switch (true) {
@@ -174,7 +174,7 @@ function isReactHookCallWithNameLoose(node) {
174
174
  };
175
175
  }
176
176
  function isReactHookCallWithNameAlias(name, context, alias) {
177
- const settings = unsafeReadSettings(context.settings);
177
+ const settings = getSettingsFromContext(context);
178
178
  return (node) => {
179
179
  const initialScope = context.sourceCode.getScope(node);
180
180
  switch (true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "1.23.2-next.1",
3
+ "version": "1.23.2-next.3",
4
4
  "description": "ESLint React's ESLint utility module for static analysis of React core APIs and Patterns.",
5
5
  "homepage": "https://github.com/rEl1cx/eslint-react",
6
6
  "bugs": {
@@ -38,12 +38,12 @@
38
38
  "@typescript-eslint/types": "^8.19.0",
39
39
  "@typescript-eslint/utils": "^8.19.0",
40
40
  "ts-pattern": "^5.6.0",
41
- "@eslint-react/ast": "1.23.2-next.1",
42
- "@eslint-react/jsx": "1.23.2-next.1",
43
- "@eslint-react/shared": "1.23.2-next.1",
44
- "@eslint-react/eff": "1.23.2-next.1",
45
- "@eslint-react/types": "1.23.2-next.1",
46
- "@eslint-react/var": "1.23.2-next.1"
41
+ "@eslint-react/ast": "1.23.2-next.3",
42
+ "@eslint-react/jsx": "1.23.2-next.3",
43
+ "@eslint-react/shared": "1.23.2-next.3",
44
+ "@eslint-react/types": "1.23.2-next.3",
45
+ "@eslint-react/eff": "1.23.2-next.3",
46
+ "@eslint-react/var": "1.23.2-next.3"
47
47
  },
48
48
  "devDependencies": {
49
49
  "tsup": "^8.3.5",