@eslint-react/jsx 0.10.11-beta.2 → 0.10.12-beta.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.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/index.mjs +4 -4
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ const RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
|
|
|
13
13
|
function getFragmentFromContext(context) {
|
|
14
14
|
const settings = shared.parseSchema(shared.ESLintSettingsSchema, context.settings);
|
|
15
15
|
const fragment = settings.eslintReact?.jsx?.fragment;
|
|
16
|
-
if (tools.
|
|
16
|
+
if (tools.Prd.isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) return fragment;
|
|
17
17
|
return "Fragment";
|
|
18
18
|
}
|
|
19
19
|
const getPragmaFromContext = memo((context)=>{
|
|
@@ -199,7 +199,7 @@ function isChildrenOfCreateElement(node, context) {
|
|
|
199
199
|
* @param predicate A predicate to filter the children
|
|
200
200
|
* @returns `true` if the node has children
|
|
201
201
|
*/ function hasChildren(node, predicate) {
|
|
202
|
-
if (tools.
|
|
202
|
+
if (tools.Prd.isFunction(predicate)) return node.children.some(predicate);
|
|
203
203
|
return node.children.length > 0;
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
@@ -529,7 +529,7 @@ function getProp(props, propName, context, initialScope) {
|
|
|
529
529
|
* @param node The AST node to check
|
|
530
530
|
* @returns boolean `true` if the node is whitespace
|
|
531
531
|
*/ function isWhiteSpace(node) {
|
|
532
|
-
return tools.
|
|
532
|
+
return tools.Prd.isString(node.value) && node.value.trim() === "";
|
|
533
533
|
}
|
|
534
534
|
/**
|
|
535
535
|
* Check if a Literal or JSXText node is a line break
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ const RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
|
|
|
13
13
|
function getFragmentFromContext(context) {
|
|
14
14
|
const settings = shared.parseSchema(shared.ESLintSettingsSchema, context.settings);
|
|
15
15
|
const fragment = settings.eslintReact?.jsx?.fragment;
|
|
16
|
-
if (tools.
|
|
16
|
+
if (tools.Prd.isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) return fragment;
|
|
17
17
|
return "Fragment";
|
|
18
18
|
}
|
|
19
19
|
const getPragmaFromContext = memo((context)=>{
|
|
@@ -199,7 +199,7 @@ function isChildrenOfCreateElement(node, context) {
|
|
|
199
199
|
* @param predicate A predicate to filter the children
|
|
200
200
|
* @returns `true` if the node has children
|
|
201
201
|
*/ function hasChildren(node, predicate) {
|
|
202
|
-
if (tools.
|
|
202
|
+
if (tools.Prd.isFunction(predicate)) return node.children.some(predicate);
|
|
203
203
|
return node.children.length > 0;
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
@@ -529,7 +529,7 @@ function getProp(props, propName, context, initialScope) {
|
|
|
529
529
|
* @param node The AST node to check
|
|
530
530
|
* @returns boolean `true` if the node is whitespace
|
|
531
531
|
*/ function isWhiteSpace(node) {
|
|
532
|
-
return tools.
|
|
532
|
+
return tools.Prd.isString(node.value) && node.value.trim() === "";
|
|
533
533
|
}
|
|
534
534
|
/**
|
|
535
535
|
* Check if a Literal or JSXText node is a line break
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeType, isOneOf, is, traverseUp, isJSXTagNameExpression, getNestedReturnStatements, ESLintCommunityESLintUtils, traverseUpGuard, isStringLiteral, isMultiLine } from '@eslint-react/ast';
|
|
2
2
|
import { parseSchema, ESLintSettingsSchema } from '@eslint-react/shared';
|
|
3
|
-
import { F, O as O$1,
|
|
3
|
+
import { F, O as O$1, Prd } from '@eslint-react/tools';
|
|
4
4
|
import memo from 'micro-memoize';
|
|
5
5
|
import { findVariable, getVariableInit } from '@eslint-react/var';
|
|
6
6
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
@@ -11,7 +11,7 @@ const RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
|
|
|
11
11
|
function getFragmentFromContext(context) {
|
|
12
12
|
const settings = parseSchema(ESLintSettingsSchema, context.settings);
|
|
13
13
|
const fragment = settings.eslintReact?.jsx?.fragment;
|
|
14
|
-
if (
|
|
14
|
+
if (Prd.isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) return fragment;
|
|
15
15
|
return "Fragment";
|
|
16
16
|
}
|
|
17
17
|
const getPragmaFromContext = memo((context)=>{
|
|
@@ -197,7 +197,7 @@ function isChildrenOfCreateElement(node, context) {
|
|
|
197
197
|
* @param predicate A predicate to filter the children
|
|
198
198
|
* @returns `true` if the node has children
|
|
199
199
|
*/ function hasChildren(node, predicate) {
|
|
200
|
-
if (
|
|
200
|
+
if (Prd.isFunction(predicate)) return node.children.some(predicate);
|
|
201
201
|
return node.children.length > 0;
|
|
202
202
|
}
|
|
203
203
|
/**
|
|
@@ -527,7 +527,7 @@ function getProp(props, propName, context, initialScope) {
|
|
|
527
527
|
* @param node The AST node to check
|
|
528
528
|
* @returns boolean `true` if the node is whitespace
|
|
529
529
|
*/ function isWhiteSpace(node) {
|
|
530
|
-
return
|
|
530
|
+
return Prd.isString(node.value) && node.value.trim() === "";
|
|
531
531
|
}
|
|
532
532
|
/**
|
|
533
533
|
* Check if a Literal or JSXText node is a line break
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/jsx",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.12-beta.0",
|
|
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": {
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"@typescript-eslint/types": ">=6.19.0",
|
|
40
40
|
"@typescript-eslint/utils": ">=6.19.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.
|
|
46
|
-
"@eslint-react/var": "0.10.
|
|
42
|
+
"@eslint-react/ast": "0.10.12-beta.0",
|
|
43
|
+
"@eslint-react/shared": "0.10.12-beta.0",
|
|
44
|
+
"@eslint-react/tools": "0.10.12-beta.0",
|
|
45
|
+
"@eslint-react/types": "0.10.12-beta.0",
|
|
46
|
+
"@eslint-react/var": "0.10.12-beta.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "rollup -c rollup.config.ts --configPlugin swc3 && cp dist/index.d.ts dist/index.d.mts",
|