@eslint-react/jsx 0.10.0 → 0.10.1-beta.1
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.cjs +4 -4
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -243,14 +243,14 @@ function isChildrenOfCreateElement(node, context) {
|
|
|
243
243
|
* @param node The AST node to check
|
|
244
244
|
* @returns `true` if the node is a `JSXElement` of `User-Defined Component` type
|
|
245
245
|
*/ function isJSXElementOfUserDefinedComponent(node) {
|
|
246
|
-
return node.
|
|
246
|
+
return node.openingElement.name.type === ast.NodeType.JSXIdentifier && /^[A-Z]/u.test(node.openingElement.name.name);
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
* Check if a node is a `JSXFragment` of `Built-in Component` type
|
|
250
250
|
* @param node The AST node to check
|
|
251
251
|
* @returns `true` if the node is a `JSXFragment` of `Built-in Component` type
|
|
252
252
|
*/ function isJSXElementOfBuiltinComponent(node) {
|
|
253
|
-
return node.
|
|
253
|
+
return node.openingElement.name.type === ast.NodeType.JSXIdentifier && node.openingElement.name.name.toLowerCase() === node.openingElement.name.name && /^[a-z]/u.test(node.openingElement.name.name);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
const hdlAnimation = [
|
|
@@ -675,10 +675,10 @@ function getProp(props, propName, context, initialScope) {
|
|
|
675
675
|
* @param predicate The predicate to check each node
|
|
676
676
|
* @returns prop node if found
|
|
677
677
|
*/ function traverseUpProp(node, predicate = tools.F.constTrue) {
|
|
678
|
-
const
|
|
678
|
+
const guard = (node)=>{
|
|
679
679
|
return node.type === ast.NodeType.JSXAttribute && predicate(node);
|
|
680
680
|
};
|
|
681
|
-
return ast.traverseUpGuard(node,
|
|
681
|
+
return ast.traverseUpGuard(node, guard);
|
|
682
682
|
}
|
|
683
683
|
|
|
684
684
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -47,13 +47,13 @@ declare function isChildOfJSXElement(node: TSESTree.Node): node is TSESTree.JSXE
|
|
|
47
47
|
* @param node The AST node to check
|
|
48
48
|
* @returns `true` if the node is a `JSXElement` of `User-Defined Component` type
|
|
49
49
|
*/
|
|
50
|
-
declare function isJSXElementOfUserDefinedComponent(node: TSESTree.
|
|
50
|
+
declare function isJSXElementOfUserDefinedComponent(node: TSESTree.JSXElement): boolean;
|
|
51
51
|
/**
|
|
52
52
|
* Check if a node is a `JSXFragment` of `Built-in Component` type
|
|
53
53
|
* @param node The AST node to check
|
|
54
54
|
* @returns `true` if the node is a `JSXFragment` of `Built-in Component` type
|
|
55
55
|
*/
|
|
56
|
-
declare function isJSXElementOfBuiltinComponent(node: TSESTree.
|
|
56
|
+
declare function isJSXElementOfBuiltinComponent(node: TSESTree.JSXElement): boolean;
|
|
57
57
|
|
|
58
58
|
declare const hdlAnimation: readonly ["onAnimationStart", "onAnimationEnd", "onAnimationIteration"];
|
|
59
59
|
declare const hdlClipboard: readonly ["onCopy", "onCut", "onPaste"];
|
package/dist/index.d.ts
CHANGED
|
@@ -47,13 +47,13 @@ declare function isChildOfJSXElement(node: TSESTree.Node): node is TSESTree.JSXE
|
|
|
47
47
|
* @param node The AST node to check
|
|
48
48
|
* @returns `true` if the node is a `JSXElement` of `User-Defined Component` type
|
|
49
49
|
*/
|
|
50
|
-
declare function isJSXElementOfUserDefinedComponent(node: TSESTree.
|
|
50
|
+
declare function isJSXElementOfUserDefinedComponent(node: TSESTree.JSXElement): boolean;
|
|
51
51
|
/**
|
|
52
52
|
* Check if a node is a `JSXFragment` of `Built-in Component` type
|
|
53
53
|
* @param node The AST node to check
|
|
54
54
|
* @returns `true` if the node is a `JSXFragment` of `Built-in Component` type
|
|
55
55
|
*/
|
|
56
|
-
declare function isJSXElementOfBuiltinComponent(node: TSESTree.
|
|
56
|
+
declare function isJSXElementOfBuiltinComponent(node: TSESTree.JSXElement): boolean;
|
|
57
57
|
|
|
58
58
|
declare const hdlAnimation: readonly ["onAnimationStart", "onAnimationEnd", "onAnimationIteration"];
|
|
59
59
|
declare const hdlClipboard: readonly ["onCopy", "onCut", "onPaste"];
|
package/dist/index.js
CHANGED
|
@@ -243,14 +243,14 @@ function isChildrenOfCreateElement(node, context) {
|
|
|
243
243
|
* @param node The AST node to check
|
|
244
244
|
* @returns `true` if the node is a `JSXElement` of `User-Defined Component` type
|
|
245
245
|
*/ function isJSXElementOfUserDefinedComponent(node) {
|
|
246
|
-
return node.
|
|
246
|
+
return node.openingElement.name.type === ast.NodeType.JSXIdentifier && /^[A-Z]/u.test(node.openingElement.name.name);
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
* Check if a node is a `JSXFragment` of `Built-in Component` type
|
|
250
250
|
* @param node The AST node to check
|
|
251
251
|
* @returns `true` if the node is a `JSXFragment` of `Built-in Component` type
|
|
252
252
|
*/ function isJSXElementOfBuiltinComponent(node) {
|
|
253
|
-
return node.
|
|
253
|
+
return node.openingElement.name.type === ast.NodeType.JSXIdentifier && node.openingElement.name.name.toLowerCase() === node.openingElement.name.name && /^[a-z]/u.test(node.openingElement.name.name);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
const hdlAnimation = [
|
|
@@ -675,10 +675,10 @@ function getProp(props, propName, context, initialScope) {
|
|
|
675
675
|
* @param predicate The predicate to check each node
|
|
676
676
|
* @returns prop node if found
|
|
677
677
|
*/ function traverseUpProp(node, predicate = tools.F.constTrue) {
|
|
678
|
-
const
|
|
678
|
+
const guard = (node)=>{
|
|
679
679
|
return node.type === ast.NodeType.JSXAttribute && predicate(node);
|
|
680
680
|
};
|
|
681
|
-
return ast.traverseUpGuard(node,
|
|
681
|
+
return ast.traverseUpGuard(node, guard);
|
|
682
682
|
}
|
|
683
683
|
|
|
684
684
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -241,14 +241,14 @@ function isChildrenOfCreateElement(node, context) {
|
|
|
241
241
|
* @param node The AST node to check
|
|
242
242
|
* @returns `true` if the node is a `JSXElement` of `User-Defined Component` type
|
|
243
243
|
*/ function isJSXElementOfUserDefinedComponent(node) {
|
|
244
|
-
return node.
|
|
244
|
+
return node.openingElement.name.type === NodeType.JSXIdentifier && /^[A-Z]/u.test(node.openingElement.name.name);
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
247
247
|
* Check if a node is a `JSXFragment` of `Built-in Component` type
|
|
248
248
|
* @param node The AST node to check
|
|
249
249
|
* @returns `true` if the node is a `JSXFragment` of `Built-in Component` type
|
|
250
250
|
*/ function isJSXElementOfBuiltinComponent(node) {
|
|
251
|
-
return node.
|
|
251
|
+
return node.openingElement.name.type === NodeType.JSXIdentifier && node.openingElement.name.name.toLowerCase() === node.openingElement.name.name && /^[a-z]/u.test(node.openingElement.name.name);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
const hdlAnimation = [
|
|
@@ -673,10 +673,10 @@ function getProp(props, propName, context, initialScope) {
|
|
|
673
673
|
* @param predicate The predicate to check each node
|
|
674
674
|
* @returns prop node if found
|
|
675
675
|
*/ function traverseUpProp(node, predicate = F.constTrue) {
|
|
676
|
-
const
|
|
676
|
+
const guard = (node)=>{
|
|
677
677
|
return node.type === NodeType.JSXAttribute && predicate(node);
|
|
678
678
|
};
|
|
679
|
-
return traverseUpGuard(node,
|
|
679
|
+
return traverseUpGuard(node, guard);
|
|
680
680
|
}
|
|
681
681
|
|
|
682
682
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/jsx",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1-beta.1",
|
|
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": {
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"./package.json"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@typescript-eslint/scope-manager": "6.
|
|
39
|
-
"@typescript-eslint/types": "6.
|
|
40
|
-
"@typescript-eslint/utils": "6.
|
|
38
|
+
"@typescript-eslint/scope-manager": "6.16.0",
|
|
39
|
+
"@typescript-eslint/types": "6.16.0",
|
|
40
|
+
"@typescript-eslint/utils": "6.16.0",
|
|
41
41
|
"micro-memoize": "4.1.2",
|
|
42
|
-
"@eslint-react/
|
|
43
|
-
"@eslint-react/
|
|
44
|
-
"@eslint-react/tools": "0.10.
|
|
45
|
-
"@eslint-react/types": "0.10.
|
|
42
|
+
"@eslint-react/ast": "0.10.1-beta.1",
|
|
43
|
+
"@eslint-react/shared": "0.10.1-beta.1",
|
|
44
|
+
"@eslint-react/tools": "0.10.1-beta.1",
|
|
45
|
+
"@eslint-react/types": "0.10.1-beta.1"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "rollup -c rollup.config.ts --configPlugin swc3 && cp dist/index.d.ts dist/index.d.mts",
|