@eslint-react/jsx 1.5.28-beta.1 → 1.5.28-beta.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 +4 -4
- package/dist/index.mjs +2 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ var types = require('@typescript-eslint/types');
|
|
|
4
4
|
var tools = require('@eslint-react/tools');
|
|
5
5
|
var ast = require('@eslint-react/ast');
|
|
6
6
|
var _var = require('@eslint-react/var');
|
|
7
|
+
var astUtils = require('@typescript-eslint/utils/ast-utils');
|
|
7
8
|
|
|
8
9
|
// src/element-type.ts
|
|
9
10
|
function resolveMemberExpressions(object, property) {
|
|
@@ -296,7 +297,6 @@ var z = class _z {
|
|
|
296
297
|
};
|
|
297
298
|
|
|
298
299
|
// src/get-prop.ts
|
|
299
|
-
var { getStaticValue } = ast.ESLintCommunityESLintUtils;
|
|
300
300
|
function getPropName(node) {
|
|
301
301
|
return $(node.name).when(ast.is(ast.NodeType.JSXIdentifier), (n2) => n2.name).when(ast.is(ast.NodeType.JSXNamespacedName), (n2) => `${n2.namespace.name}:${n2.name.name}`).exhaustive();
|
|
302
302
|
}
|
|
@@ -308,12 +308,12 @@ function getPropValue(attribute, context) {
|
|
|
308
308
|
if (attribute.type === ast.NodeType.JSXAttribute && "value" in attribute) {
|
|
309
309
|
const { value } = attribute;
|
|
310
310
|
if (value === null) return tools.O.none();
|
|
311
|
-
if (value.type === ast.NodeType.Literal) return tools.O.some(getStaticValue(value, initialScope));
|
|
312
|
-
if (value.type === ast.NodeType.JSXExpressionContainer) return tools.O.some(getStaticValue(value.expression, initialScope));
|
|
311
|
+
if (value.type === ast.NodeType.Literal) return tools.O.some(astUtils.getStaticValue(value, initialScope));
|
|
312
|
+
if (value.type === ast.NodeType.JSXExpressionContainer) return tools.O.some(astUtils.getStaticValue(value.expression, initialScope));
|
|
313
313
|
return tools.O.none();
|
|
314
314
|
}
|
|
315
315
|
const { argument } = attribute;
|
|
316
|
-
return tools.O.some(getStaticValue(argument, initialScope));
|
|
316
|
+
return tools.O.some(astUtils.getStaticValue(argument, initialScope));
|
|
317
317
|
}
|
|
318
318
|
function findPropInProperties(properties, context, initialScope, seenProps = []) {
|
|
319
319
|
return (propName) => {
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
2
2
|
import { F, O, Pred } from '@eslint-react/tools';
|
|
3
|
-
import { isOneOf, NodeType, is, isJSXTagNameExpression, isMultiLine, traverseUpGuard
|
|
3
|
+
import { isOneOf, NodeType, is, isJSXTagNameExpression, isMultiLine, traverseUpGuard } from '@eslint-react/ast';
|
|
4
4
|
import { findVariable, getVariableInit } from '@eslint-react/var';
|
|
5
|
+
import { getStaticValue } from '@typescript-eslint/utils/ast-utils';
|
|
5
6
|
|
|
6
7
|
// src/element-type.ts
|
|
7
8
|
function resolveMemberExpressions(object, property) {
|
|
@@ -294,7 +295,6 @@ var z = class _z {
|
|
|
294
295
|
};
|
|
295
296
|
|
|
296
297
|
// src/get-prop.ts
|
|
297
|
-
var { getStaticValue } = ESLintCommunityESLintUtils;
|
|
298
298
|
function getPropName(node) {
|
|
299
299
|
return $(node.name).when(is(NodeType.JSXIdentifier), (n2) => n2.name).when(is(NodeType.JSXNamespacedName), (n2) => `${n2.namespace.name}:${n2.name.name}`).exhaustive();
|
|
300
300
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/jsx",
|
|
3
|
-
"version": "1.5.28-beta.
|
|
3
|
+
"version": "1.5.28-beta.3",
|
|
4
4
|
"description": "ESLint React's TSESTree AST utility module for static analysis of JSX.",
|
|
5
5
|
"homepage": "https://github.com/rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"@typescript-eslint/scope-manager": "^7.16.1",
|
|
39
39
|
"@typescript-eslint/types": "^7.16.1",
|
|
40
40
|
"@typescript-eslint/utils": "^7.16.1",
|
|
41
|
-
"@eslint-react/ast": "1.5.28-beta.
|
|
42
|
-
"@eslint-react/
|
|
43
|
-
"@eslint-react/
|
|
44
|
-
"@eslint-react/
|
|
41
|
+
"@eslint-react/ast": "1.5.28-beta.3",
|
|
42
|
+
"@eslint-react/var": "1.5.28-beta.3",
|
|
43
|
+
"@eslint-react/tools": "1.5.28-beta.3",
|
|
44
|
+
"@eslint-react/types": "1.5.28-beta.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"ts-pattern": "5.2.0",
|
|
48
|
-
"tsup": "8.
|
|
48
|
+
"tsup": "8.2.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup",
|