@eslint-react/jsx 0.9.0-beta.1 → 0.9.0-beta.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.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 +5 -5
package/dist/index.cjs
CHANGED
|
@@ -377,14 +377,14 @@ const isFragment = (node, pragma, fragment)=>{
|
|
|
377
377
|
StrictLogical: 1n << 7n,
|
|
378
378
|
StrictConditional: 1n << 8n
|
|
379
379
|
};
|
|
380
|
-
/* eslint-enable perfectionist/sort-objects */ const
|
|
380
|
+
/* eslint-enable perfectionist/sort-objects */ const DEFAULT_JSX_VALUE_CHECK_HINT = JSXValueCheckHint.SkipUndefinedLiteral | JSXValueCheckHint.SkipBooleanLiteral;
|
|
381
381
|
/**
|
|
382
382
|
* Check if a node is a JSX value
|
|
383
383
|
* @param node The AST node to check
|
|
384
384
|
* @param context The rule context
|
|
385
385
|
* @param hint The `JSXValueCheckHint` to use
|
|
386
386
|
* @returns boolean
|
|
387
|
-
*/ function isJSXValue(node, context, hint =
|
|
387
|
+
*/ function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_CHECK_HINT) {
|
|
388
388
|
if (!node) {
|
|
389
389
|
return false;
|
|
390
390
|
}
|
|
@@ -467,7 +467,7 @@ const isFragment = (node, pragma, fragment)=>{
|
|
|
467
467
|
* @param context The rule context
|
|
468
468
|
* @param hint The `JSXValueCheckHint` to use
|
|
469
469
|
* @returns boolean
|
|
470
|
-
*/ function isFunctionReturningJSXValue(node, context, hint =
|
|
470
|
+
*/ function isFunctionReturningJSXValue(node, context, hint = DEFAULT_JSX_VALUE_CHECK_HINT) {
|
|
471
471
|
if (node.body.type !== ast.NodeType.BlockStatement) {
|
|
472
472
|
return isJSXValue(node.body, context, hint);
|
|
473
473
|
}
|
|
@@ -676,8 +676,8 @@ function getProp(props, propName, context) {
|
|
|
676
676
|
return isLiteral(node) && isWhiteSpace(node) && node.raw.includes("\n");
|
|
677
677
|
}
|
|
678
678
|
|
|
679
|
+
exports.DEFAULT_JSX_VALUE_CHECK_HINT = DEFAULT_JSX_VALUE_CHECK_HINT;
|
|
679
680
|
exports.JSXValueCheckHint = JSXValueCheckHint;
|
|
680
|
-
exports.defaultJSXValueCheckHint = defaultJSXValueCheckHint;
|
|
681
681
|
exports.elementType = elementType;
|
|
682
682
|
exports.findPropInAttributes = findPropInAttributes;
|
|
683
683
|
exports.findPropInProperties = findPropInProperties;
|
package/dist/index.d.mts
CHANGED
|
@@ -222,7 +222,7 @@ declare const JSXValueCheckHint: {
|
|
|
222
222
|
readonly StrictLogical: bigint;
|
|
223
223
|
readonly StrictConditional: bigint;
|
|
224
224
|
};
|
|
225
|
-
declare const
|
|
225
|
+
declare const DEFAULT_JSX_VALUE_CHECK_HINT: bigint;
|
|
226
226
|
/**
|
|
227
227
|
* Check if a node is a JSX value
|
|
228
228
|
* @param node The AST node to check
|
|
@@ -232,4 +232,4 @@ declare const defaultJSXValueCheckHint: bigint;
|
|
|
232
232
|
*/
|
|
233
233
|
declare function isJSXValue(node: TSESTree$1.Node | null | undefined, context: RuleContext, hint?: bigint): boolean;
|
|
234
234
|
|
|
235
|
-
export { type CallFromPragmaPredicate,
|
|
235
|
+
export { type CallFromPragmaPredicate, DEFAULT_JSX_VALUE_CHECK_HINT, JSXValueCheckHint, elementType, findPropInAttributes, findPropInProperties, getFragmentFromContext, getPragmaFromContext, getProp, getPropName, getPropValue, hasAnyProp, hasChildren, hasEveryProp, hasProp, hdlAnimation, hdlClipboard, hdlComposition, hdlFocus, hdlForm, hdlImage, hdlKeyboard, hdlMedia, hdlMouse, hdlScroll, hdlSelection, hdlTouch, hdlTransition, hdlWheel, isCallFromPragma, isChildOfJSXElement, isChildrenOfCreateElement, isCloneElementCall, isCreateElementCall, isFragment, isFragmentElement, isFragmentSyntax, isFunctionReturningJSXValue, isInitializedFromPragma, isInsideCreateElementProps, isInsidePropValue, isJSXElementOfBuiltinComponent, isJSXElementOfUserDefinedComponent, isJSXValue, isLineBreak, isLiteral, isPaddingSpaces, isPropertyOfPragma, isWhiteSpace, traverseUpProp };
|
package/dist/index.d.ts
CHANGED
|
@@ -222,7 +222,7 @@ declare const JSXValueCheckHint: {
|
|
|
222
222
|
readonly StrictLogical: bigint;
|
|
223
223
|
readonly StrictConditional: bigint;
|
|
224
224
|
};
|
|
225
|
-
declare const
|
|
225
|
+
declare const DEFAULT_JSX_VALUE_CHECK_HINT: bigint;
|
|
226
226
|
/**
|
|
227
227
|
* Check if a node is a JSX value
|
|
228
228
|
* @param node The AST node to check
|
|
@@ -232,4 +232,4 @@ declare const defaultJSXValueCheckHint: bigint;
|
|
|
232
232
|
*/
|
|
233
233
|
declare function isJSXValue(node: TSESTree$1.Node | null | undefined, context: RuleContext, hint?: bigint): boolean;
|
|
234
234
|
|
|
235
|
-
export { type CallFromPragmaPredicate,
|
|
235
|
+
export { type CallFromPragmaPredicate, DEFAULT_JSX_VALUE_CHECK_HINT, JSXValueCheckHint, elementType, findPropInAttributes, findPropInProperties, getFragmentFromContext, getPragmaFromContext, getProp, getPropName, getPropValue, hasAnyProp, hasChildren, hasEveryProp, hasProp, hdlAnimation, hdlClipboard, hdlComposition, hdlFocus, hdlForm, hdlImage, hdlKeyboard, hdlMedia, hdlMouse, hdlScroll, hdlSelection, hdlTouch, hdlTransition, hdlWheel, isCallFromPragma, isChildOfJSXElement, isChildrenOfCreateElement, isCloneElementCall, isCreateElementCall, isFragment, isFragmentElement, isFragmentSyntax, isFunctionReturningJSXValue, isInitializedFromPragma, isInsideCreateElementProps, isInsidePropValue, isJSXElementOfBuiltinComponent, isJSXElementOfUserDefinedComponent, isJSXValue, isLineBreak, isLiteral, isPaddingSpaces, isPropertyOfPragma, isWhiteSpace, traverseUpProp };
|
package/dist/index.js
CHANGED
|
@@ -377,14 +377,14 @@ const isFragment = (node, pragma, fragment)=>{
|
|
|
377
377
|
StrictLogical: 1n << 7n,
|
|
378
378
|
StrictConditional: 1n << 8n
|
|
379
379
|
};
|
|
380
|
-
/* eslint-enable perfectionist/sort-objects */ const
|
|
380
|
+
/* eslint-enable perfectionist/sort-objects */ const DEFAULT_JSX_VALUE_CHECK_HINT = JSXValueCheckHint.SkipUndefinedLiteral | JSXValueCheckHint.SkipBooleanLiteral;
|
|
381
381
|
/**
|
|
382
382
|
* Check if a node is a JSX value
|
|
383
383
|
* @param node The AST node to check
|
|
384
384
|
* @param context The rule context
|
|
385
385
|
* @param hint The `JSXValueCheckHint` to use
|
|
386
386
|
* @returns boolean
|
|
387
|
-
*/ function isJSXValue(node, context, hint =
|
|
387
|
+
*/ function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_CHECK_HINT) {
|
|
388
388
|
if (!node) {
|
|
389
389
|
return false;
|
|
390
390
|
}
|
|
@@ -467,7 +467,7 @@ const isFragment = (node, pragma, fragment)=>{
|
|
|
467
467
|
* @param context The rule context
|
|
468
468
|
* @param hint The `JSXValueCheckHint` to use
|
|
469
469
|
* @returns boolean
|
|
470
|
-
*/ function isFunctionReturningJSXValue(node, context, hint =
|
|
470
|
+
*/ function isFunctionReturningJSXValue(node, context, hint = DEFAULT_JSX_VALUE_CHECK_HINT) {
|
|
471
471
|
if (node.body.type !== ast.NodeType.BlockStatement) {
|
|
472
472
|
return isJSXValue(node.body, context, hint);
|
|
473
473
|
}
|
|
@@ -676,8 +676,8 @@ function getProp(props, propName, context) {
|
|
|
676
676
|
return isLiteral(node) && isWhiteSpace(node) && node.raw.includes("\n");
|
|
677
677
|
}
|
|
678
678
|
|
|
679
|
+
exports.DEFAULT_JSX_VALUE_CHECK_HINT = DEFAULT_JSX_VALUE_CHECK_HINT;
|
|
679
680
|
exports.JSXValueCheckHint = JSXValueCheckHint;
|
|
680
|
-
exports.defaultJSXValueCheckHint = defaultJSXValueCheckHint;
|
|
681
681
|
exports.elementType = elementType;
|
|
682
682
|
exports.findPropInAttributes = findPropInAttributes;
|
|
683
683
|
exports.findPropInProperties = findPropInProperties;
|
package/dist/index.mjs
CHANGED
|
@@ -375,14 +375,14 @@ const isFragment = (node, pragma, fragment)=>{
|
|
|
375
375
|
StrictLogical: 1n << 7n,
|
|
376
376
|
StrictConditional: 1n << 8n
|
|
377
377
|
};
|
|
378
|
-
/* eslint-enable perfectionist/sort-objects */ const
|
|
378
|
+
/* eslint-enable perfectionist/sort-objects */ const DEFAULT_JSX_VALUE_CHECK_HINT = JSXValueCheckHint.SkipUndefinedLiteral | JSXValueCheckHint.SkipBooleanLiteral;
|
|
379
379
|
/**
|
|
380
380
|
* Check if a node is a JSX value
|
|
381
381
|
* @param node The AST node to check
|
|
382
382
|
* @param context The rule context
|
|
383
383
|
* @param hint The `JSXValueCheckHint` to use
|
|
384
384
|
* @returns boolean
|
|
385
|
-
*/ function isJSXValue(node, context, hint =
|
|
385
|
+
*/ function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_CHECK_HINT) {
|
|
386
386
|
if (!node) {
|
|
387
387
|
return false;
|
|
388
388
|
}
|
|
@@ -465,7 +465,7 @@ const isFragment = (node, pragma, fragment)=>{
|
|
|
465
465
|
* @param context The rule context
|
|
466
466
|
* @param hint The `JSXValueCheckHint` to use
|
|
467
467
|
* @returns boolean
|
|
468
|
-
*/ function isFunctionReturningJSXValue(node, context, hint =
|
|
468
|
+
*/ function isFunctionReturningJSXValue(node, context, hint = DEFAULT_JSX_VALUE_CHECK_HINT) {
|
|
469
469
|
if (node.body.type !== NodeType.BlockStatement) {
|
|
470
470
|
return isJSXValue(node.body, context, hint);
|
|
471
471
|
}
|
|
@@ -674,4 +674,4 @@ function getProp(props, propName, context) {
|
|
|
674
674
|
return isLiteral(node) && isWhiteSpace(node) && node.raw.includes("\n");
|
|
675
675
|
}
|
|
676
676
|
|
|
677
|
-
export {
|
|
677
|
+
export { DEFAULT_JSX_VALUE_CHECK_HINT, JSXValueCheckHint, elementType, findPropInAttributes, findPropInProperties, getFragmentFromContext, getPragmaFromContext, getProp, getPropName, getPropValue, hasAnyProp, hasChildren, hasEveryProp, hasProp, hdlAnimation, hdlClipboard, hdlComposition, hdlFocus, hdlForm, hdlImage, hdlKeyboard, hdlMedia, hdlMouse, hdlScroll, hdlSelection, hdlTouch, hdlTransition, hdlWheel, isCallFromPragma, isChildOfJSXElement, isChildrenOfCreateElement, isCloneElementCall, isCreateElementCall, isFragment, isFragmentElement, isFragmentSyntax, isFunctionReturningJSXValue, isInitializedFromPragma, isInsideCreateElementProps, isInsidePropValue, isJSXElementOfBuiltinComponent, isJSXElementOfUserDefinedComponent, isJSXValue, isLineBreak, isLiteral, isPaddingSpaces, isPropertyOfPragma, isWhiteSpace, traverseUpProp };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/jsx",
|
|
3
|
-
"version": "0.9.0-beta.
|
|
3
|
+
"version": "0.9.0-beta.2",
|
|
4
4
|
"description": "ESLint x React's TSESTree AST utility module for static analysis of JSX.",
|
|
5
5
|
"homepage": "https://github.com/rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"@typescript-eslint/types": "6.13.1",
|
|
39
39
|
"@typescript-eslint/utils": "6.13.1",
|
|
40
40
|
"micro-memoize": "4.1.2",
|
|
41
|
-
"@eslint-react/ast": "0.9.0-beta.
|
|
42
|
-
"@eslint-react/
|
|
43
|
-
"@eslint-react/
|
|
44
|
-
"@eslint-react/
|
|
41
|
+
"@eslint-react/ast": "0.9.0-beta.2",
|
|
42
|
+
"@eslint-react/types": "0.9.0-beta.2",
|
|
43
|
+
"@eslint-react/shared": "0.9.0-beta.2",
|
|
44
|
+
"@eslint-react/tools": "0.9.0-beta.2"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "rollup -c rollup.config.ts --configPlugin swc3 && cp dist/index.d.ts dist/index.d.mts",
|