@eslint-react/jsx 0.9.0-beta.0 → 0.9.0-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 +2 -22
- package/dist/index.js +2 -22
- package/dist/index.mjs +3 -23
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -33,26 +33,6 @@ function resolveMemberExpressions(object, property) {
|
|
|
33
33
|
return name.name;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* @since 2.0.0
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* Tests if a value is a `string`.
|
|
41
|
-
*
|
|
42
|
-
* @param input - The value to test.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* import { isString } from "effect/Predicate"
|
|
46
|
-
*
|
|
47
|
-
* assert.deepStrictEqual(isString("a"), true)
|
|
48
|
-
*
|
|
49
|
-
* assert.deepStrictEqual(isString(1), false)
|
|
50
|
-
*
|
|
51
|
-
* @category guards
|
|
52
|
-
* @since 2.0.0
|
|
53
|
-
*/
|
|
54
|
-
const isString = input => typeof input === "string";
|
|
55
|
-
|
|
56
36
|
const RE_JSX_ANNOTATION_REGEX = /@jsx\s+(\S+)/u;
|
|
57
37
|
// Does not check for reserved keywords or unicode characters
|
|
58
38
|
const RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
|
|
@@ -60,7 +40,7 @@ function getFragmentFromContext(context) {
|
|
|
60
40
|
// eslint-disable-next-line prefer-destructuring
|
|
61
41
|
const settings = context.settings;
|
|
62
42
|
const fragment = settings.react?.fragment;
|
|
63
|
-
if (isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) {
|
|
43
|
+
if (tools.Pred.isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) {
|
|
64
44
|
return fragment;
|
|
65
45
|
}
|
|
66
46
|
return "Fragment";
|
|
@@ -679,7 +659,7 @@ function getProp(props, propName, context) {
|
|
|
679
659
|
* @param node The AST node to check
|
|
680
660
|
* @returns boolean `true` if the node is whitespace
|
|
681
661
|
*/ function isWhiteSpace(node) {
|
|
682
|
-
return isString(node.value) && node.value.trim() === "";
|
|
662
|
+
return tools.Pred.isString(node.value) && node.value.trim() === "";
|
|
683
663
|
}
|
|
684
664
|
/**
|
|
685
665
|
* Check if a Literal or JSXText node is a line break
|
package/dist/index.js
CHANGED
|
@@ -33,26 +33,6 @@ function resolveMemberExpressions(object, property) {
|
|
|
33
33
|
return name.name;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* @since 2.0.0
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* Tests if a value is a `string`.
|
|
41
|
-
*
|
|
42
|
-
* @param input - The value to test.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* import { isString } from "effect/Predicate"
|
|
46
|
-
*
|
|
47
|
-
* assert.deepStrictEqual(isString("a"), true)
|
|
48
|
-
*
|
|
49
|
-
* assert.deepStrictEqual(isString(1), false)
|
|
50
|
-
*
|
|
51
|
-
* @category guards
|
|
52
|
-
* @since 2.0.0
|
|
53
|
-
*/
|
|
54
|
-
const isString = input => typeof input === "string";
|
|
55
|
-
|
|
56
36
|
const RE_JSX_ANNOTATION_REGEX = /@jsx\s+(\S+)/u;
|
|
57
37
|
// Does not check for reserved keywords or unicode characters
|
|
58
38
|
const RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
|
|
@@ -60,7 +40,7 @@ function getFragmentFromContext(context) {
|
|
|
60
40
|
// eslint-disable-next-line prefer-destructuring
|
|
61
41
|
const settings = context.settings;
|
|
62
42
|
const fragment = settings.react?.fragment;
|
|
63
|
-
if (isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) {
|
|
43
|
+
if (tools.Pred.isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) {
|
|
64
44
|
return fragment;
|
|
65
45
|
}
|
|
66
46
|
return "Fragment";
|
|
@@ -679,7 +659,7 @@ function getProp(props, propName, context) {
|
|
|
679
659
|
* @param node The AST node to check
|
|
680
660
|
* @returns boolean `true` if the node is whitespace
|
|
681
661
|
*/ function isWhiteSpace(node) {
|
|
682
|
-
return isString(node.value) && node.value.trim() === "";
|
|
662
|
+
return tools.Pred.isString(node.value) && node.value.trim() === "";
|
|
683
663
|
}
|
|
684
664
|
/**
|
|
685
665
|
* Check if a Literal or JSXText node is a line break
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
2
2
|
import { getVariablesUpToGlobal, findVariableByName, NodeType, traverseUp, is, isOneOf, isJSXTagNameExpression, findVariableByNameUpToGlobal, getVariableInit, getNestedReturnStatements, getStaticValue, traverseUpGuard, isStringLiteral, isMultiLine } from '@eslint-react/ast';
|
|
3
|
-
import { F, O as O$1 } from '@eslint-react/tools';
|
|
3
|
+
import { F, O as O$1, Pred } from '@eslint-react/tools';
|
|
4
4
|
import memo from 'micro-memoize';
|
|
5
5
|
|
|
6
6
|
function resolveMemberExpressions(object, property) {
|
|
@@ -31,26 +31,6 @@ function resolveMemberExpressions(object, property) {
|
|
|
31
31
|
return name.name;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* @since 2.0.0
|
|
36
|
-
*/
|
|
37
|
-
/**
|
|
38
|
-
* Tests if a value is a `string`.
|
|
39
|
-
*
|
|
40
|
-
* @param input - The value to test.
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* import { isString } from "effect/Predicate"
|
|
44
|
-
*
|
|
45
|
-
* assert.deepStrictEqual(isString("a"), true)
|
|
46
|
-
*
|
|
47
|
-
* assert.deepStrictEqual(isString(1), false)
|
|
48
|
-
*
|
|
49
|
-
* @category guards
|
|
50
|
-
* @since 2.0.0
|
|
51
|
-
*/
|
|
52
|
-
const isString = input => typeof input === "string";
|
|
53
|
-
|
|
54
34
|
const RE_JSX_ANNOTATION_REGEX = /@jsx\s+(\S+)/u;
|
|
55
35
|
// Does not check for reserved keywords or unicode characters
|
|
56
36
|
const RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
|
|
@@ -58,7 +38,7 @@ function getFragmentFromContext(context) {
|
|
|
58
38
|
// eslint-disable-next-line prefer-destructuring
|
|
59
39
|
const settings = context.settings;
|
|
60
40
|
const fragment = settings.react?.fragment;
|
|
61
|
-
if (isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) {
|
|
41
|
+
if (Pred.isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) {
|
|
62
42
|
return fragment;
|
|
63
43
|
}
|
|
64
44
|
return "Fragment";
|
|
@@ -677,7 +657,7 @@ function getProp(props, propName, context) {
|
|
|
677
657
|
* @param node The AST node to check
|
|
678
658
|
* @returns boolean `true` if the node is whitespace
|
|
679
659
|
*/ function isWhiteSpace(node) {
|
|
680
|
-
return isString(node.value) && node.value.trim() === "";
|
|
660
|
+
return Pred.isString(node.value) && node.value.trim() === "";
|
|
681
661
|
}
|
|
682
662
|
/**
|
|
683
663
|
* 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.9.0-beta.
|
|
3
|
+
"version": "0.9.0-beta.1",
|
|
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/
|
|
42
|
-
"@eslint-react/
|
|
43
|
-
"@eslint-react/
|
|
44
|
-
"@eslint-react/types": "0.9.0-beta.
|
|
41
|
+
"@eslint-react/ast": "0.9.0-beta.1",
|
|
42
|
+
"@eslint-react/shared": "0.9.0-beta.1",
|
|
43
|
+
"@eslint-react/tools": "0.9.0-beta.1",
|
|
44
|
+
"@eslint-react/types": "0.9.0-beta.1"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "rollup -c rollup.config.ts --configPlugin swc3 && cp dist/index.d.ts dist/index.d.mts",
|