@eslint-react/jsx 0.8.6-beta.3 → 0.8.6-beta.5

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.
@@ -27,15 +27,6 @@ function _interopNamespaceDefault(e) {
27
27
 
28
28
  var eslintUtils__namespace = /*#__PURE__*/_interopNamespaceDefault(eslintUtils);
29
29
 
30
- /**
31
- * @since 2.0.0
32
- */
33
-
34
- /**
35
- * @category type lambdas
36
- * @since 2.0.0
37
- */
38
-
39
30
  /**
40
31
  * Tests if a value is a `function`.
41
32
  *
@@ -52,6 +43,9 @@ var eslintUtils__namespace = /*#__PURE__*/_interopNamespaceDefault(eslintUtils);
52
43
  */
53
44
  const isFunction$2 = input => typeof input === "function";
54
45
 
46
+ /**
47
+ * @since 2.0.0
48
+ */
55
49
  /**
56
50
  * Tests if a value is a `string`.
57
51
  *
@@ -68,7 +62,6 @@ const isFunction$2 = input => typeof input === "function";
68
62
  * @since 2.0.0
69
63
  */
70
64
  const isString = input => typeof input === "string";
71
-
72
65
  /**
73
66
  * Tests if a value is a `function`.
74
67
  *
@@ -85,7 +78,7 @@ const isString = input => typeof input === "string";
85
78
  * @since 2.0.0
86
79
  */
87
80
  const isFunction$1 = isFunction$2;
88
-
81
+ const isRecordOrArray = input => typeof input === "object" && input !== null;
89
82
  /**
90
83
  * Tests if a value is an `object`.
91
84
  *
@@ -103,8 +96,7 @@ const isFunction$1 = isFunction$2;
103
96
  * @category guards
104
97
  * @since 2.0.0
105
98
  */
106
- const isObject = input => typeof input === "object" && input !== null || isFunction$1(input);
107
-
99
+ const isObject = input => isRecordOrArray(input) || isFunction$1(input);
108
100
  /**
109
101
  * A guard that succeeds when the input is `null` or `undefined`.
110
102
  *
@@ -638,10 +630,10 @@ const isParenthesized = eslintUtils__namespace.isParenthesized;
638
630
  }, (x)=>x.id).with({
639
631
  type: NodeType.ClassExpression,
640
632
  parent: {
641
- type: NodeType.VariableDeclarator,
642
633
  id: {
643
634
  type: NodeType.Identifier
644
- }
635
+ },
636
+ type: NodeType.VariableDeclarator
645
637
  }
646
638
  }, (x)=>x.parent.id).otherwise(()=>null);
647
639
  }
@@ -27,15 +27,6 @@ function _interopNamespaceDefault(e) {
27
27
 
28
28
  var eslintUtils__namespace = /*#__PURE__*/_interopNamespaceDefault(eslintUtils);
29
29
 
30
- /**
31
- * @since 2.0.0
32
- */
33
-
34
- /**
35
- * @category type lambdas
36
- * @since 2.0.0
37
- */
38
-
39
30
  /**
40
31
  * Tests if a value is a `function`.
41
32
  *
@@ -52,6 +43,9 @@ var eslintUtils__namespace = /*#__PURE__*/_interopNamespaceDefault(eslintUtils);
52
43
  */
53
44
  const isFunction$2 = input => typeof input === "function";
54
45
 
46
+ /**
47
+ * @since 2.0.0
48
+ */
55
49
  /**
56
50
  * Tests if a value is a `string`.
57
51
  *
@@ -68,7 +62,6 @@ const isFunction$2 = input => typeof input === "function";
68
62
  * @since 2.0.0
69
63
  */
70
64
  const isString = input => typeof input === "string";
71
-
72
65
  /**
73
66
  * Tests if a value is a `function`.
74
67
  *
@@ -85,7 +78,7 @@ const isString = input => typeof input === "string";
85
78
  * @since 2.0.0
86
79
  */
87
80
  const isFunction$1 = isFunction$2;
88
-
81
+ const isRecordOrArray = input => typeof input === "object" && input !== null;
89
82
  /**
90
83
  * Tests if a value is an `object`.
91
84
  *
@@ -103,8 +96,7 @@ const isFunction$1 = isFunction$2;
103
96
  * @category guards
104
97
  * @since 2.0.0
105
98
  */
106
- const isObject = input => typeof input === "object" && input !== null || isFunction$1(input);
107
-
99
+ const isObject = input => isRecordOrArray(input) || isFunction$1(input);
108
100
  /**
109
101
  * A guard that succeeds when the input is `null` or `undefined`.
110
102
  *
@@ -638,10 +630,10 @@ const isParenthesized = eslintUtils__namespace.isParenthesized;
638
630
  }, (x)=>x.id).with({
639
631
  type: NodeType.ClassExpression,
640
632
  parent: {
641
- type: NodeType.VariableDeclarator,
642
633
  id: {
643
634
  type: NodeType.Identifier
644
- }
635
+ },
636
+ type: NodeType.VariableDeclarator
645
637
  }
646
638
  }, (x)=>x.parent.id).otherwise(()=>null);
647
639
  }
@@ -6,15 +6,6 @@ import { ASTUtils } from '@typescript-eslint/utils';
6
6
  import * as eslintUtils from '@eslint-community/eslint-utils';
7
7
  import { toLowerCase, delimiterCase, replace } from 'string-ts';
8
8
 
9
- /**
10
- * @since 2.0.0
11
- */
12
-
13
- /**
14
- * @category type lambdas
15
- * @since 2.0.0
16
- */
17
-
18
9
  /**
19
10
  * Tests if a value is a `function`.
20
11
  *
@@ -31,6 +22,9 @@ import { toLowerCase, delimiterCase, replace } from 'string-ts';
31
22
  */
32
23
  const isFunction$2 = input => typeof input === "function";
33
24
 
25
+ /**
26
+ * @since 2.0.0
27
+ */
34
28
  /**
35
29
  * Tests if a value is a `string`.
36
30
  *
@@ -47,7 +41,6 @@ const isFunction$2 = input => typeof input === "function";
47
41
  * @since 2.0.0
48
42
  */
49
43
  const isString = input => typeof input === "string";
50
-
51
44
  /**
52
45
  * Tests if a value is a `function`.
53
46
  *
@@ -64,7 +57,7 @@ const isString = input => typeof input === "string";
64
57
  * @since 2.0.0
65
58
  */
66
59
  const isFunction$1 = isFunction$2;
67
-
60
+ const isRecordOrArray = input => typeof input === "object" && input !== null;
68
61
  /**
69
62
  * Tests if a value is an `object`.
70
63
  *
@@ -82,8 +75,7 @@ const isFunction$1 = isFunction$2;
82
75
  * @category guards
83
76
  * @since 2.0.0
84
77
  */
85
- const isObject = input => typeof input === "object" && input !== null || isFunction$1(input);
86
-
78
+ const isObject = input => isRecordOrArray(input) || isFunction$1(input);
87
79
  /**
88
80
  * A guard that succeeds when the input is `null` or `undefined`.
89
81
  *
@@ -617,10 +609,10 @@ const isParenthesized = eslintUtils.isParenthesized;
617
609
  }, (x)=>x.id).with({
618
610
  type: NodeType.ClassExpression,
619
611
  parent: {
620
- type: NodeType.VariableDeclarator,
621
612
  id: {
622
613
  type: NodeType.Identifier
623
- }
614
+ },
615
+ type: NodeType.VariableDeclarator
624
616
  }
625
617
  }, (x)=>x.parent.id).otherwise(()=>null);
626
618
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "0.8.6-beta.3",
3
+ "version": "0.8.6-beta.5",
4
4
  "description": "TSESTree AST primitive utility module.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/tools",
3
- "version": "0.8.6-beta.3",
3
+ "version": "0.8.6-beta.5",
4
4
  "description": "Std library and primitives for @eslint-react packages.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
@@ -57,7 +57,7 @@ type NegativeDescriptive = "complicated" | "confusing" | "constructed" | "duplic
57
57
  type PositiveDescriptive = "explicit" | "optimal" | "optimized" | "standard" | "strict";
58
58
  type NeutralDescriptive = "access" | "calling" | "inside" | "outside";
59
59
  type Descriptive = NegativeDescriptive | NeutralDescriptive | PositiveDescriptive;
60
- type Term = "argument" | "array" | "array-index" | "arrow-function" | "attribute" | "callback" | "children" | "class" | "class-component" | "class-method" | "class-property" | "clone-element" | "comment" | "component" | "components" | "computed" | "computed-property" | "conditional-rendering" | "const" | "constant" | "constructor" | "context" | "context-consumer" | "context-provider" | "context-value" | "create-ref" | "custom-hooks" | "default-props" | "deps" | "destructuring" | "destructuring-assignment" | "direct-mutation" | "display-name" | "document" | "effect" | "element" | "error" | "event" | "event-handler" | "exhaustive-deps" | "expression" | "false" | "filename" | "forward-ref" | "fragment" | "function" | "function-component" | "function-name" | "global" | "handler" | "hook" | "html" | "id" | "index" | "input" | "key" | "literal" | "map" | "memo" | "memoized-function" | "method" | "name" | "namespace" | "node" | "parameter" | "prop" | "ref" | "render" | "return" | "spread" | "state" | "string" | "string-refs" | "style" | "textnodes" | "use-callback" | "use-context" | "use-effect" | "use-imperative-handle" | "use-layout-effect" | "use-memo" | "use-reducer" | "use-ref" | "use-state" | "value" | "variable";
60
+ type Term = "argument" | "array" | "array-index" | "arrow-function" | "attribute" | "callback" | "children" | "class" | "class-component" | "class-method" | "class-property" | "clone-element" | "comment" | "component" | "components" | "computed" | "computed-property" | "conditional-rendering" | "const" | "constant" | "constructor" | "context" | "context-consumer" | "context-provider" | "context-value" | "create-ref" | "custom-hooks" | "default-props" | "deps" | "destructuring" | "destructuring-assignment" | "direct-mutation" | "display-name" | "document" | "effect" | "element" | "error" | "event" | "event-handler" | "exhaustive-deps" | "expression" | "false" | "filename" | "forward-ref" | "fragment" | "function" | "function-component" | "function-name" | "global" | "handler" | "hook" | "html" | "id" | "index" | "input" | "key" | "list-rendering" | "literal" | "map" | "memo" | "memoized-function" | "method" | "name" | "namespace" | "node" | "parameter" | "prop" | "ref" | "render" | "return" | "spread" | "state" | "string" | "string-refs" | "style" | "textnodes" | "use-callback" | "use-context" | "use-effect" | "use-imperative-handle" | "use-layout-effect" | "use-memo" | "use-reducer" | "use-ref" | "use-state" | "value" | "variable";
61
61
  type Additional = string;
62
62
  type RuleName = `${Ban}-${Term}` | `${NeutralModifier}-${Term}` | `${NegativeModifier}-${NegativeDescriptive}-${Term}` | `${NegativeModifier}-${NeutralDescriptive}-${Term}` | `${PositiveModifier}-${NeutralDescriptive}-${Term}` | `${PositiveModifier}-${PositiveDescriptive}-${Term}`;
63
63
  type RuleNameWithAdditional = `${RuleName}-${Additional}`;
@@ -57,7 +57,7 @@ type NegativeDescriptive = "complicated" | "confusing" | "constructed" | "duplic
57
57
  type PositiveDescriptive = "explicit" | "optimal" | "optimized" | "standard" | "strict";
58
58
  type NeutralDescriptive = "access" | "calling" | "inside" | "outside";
59
59
  type Descriptive = NegativeDescriptive | NeutralDescriptive | PositiveDescriptive;
60
- type Term = "argument" | "array" | "array-index" | "arrow-function" | "attribute" | "callback" | "children" | "class" | "class-component" | "class-method" | "class-property" | "clone-element" | "comment" | "component" | "components" | "computed" | "computed-property" | "conditional-rendering" | "const" | "constant" | "constructor" | "context" | "context-consumer" | "context-provider" | "context-value" | "create-ref" | "custom-hooks" | "default-props" | "deps" | "destructuring" | "destructuring-assignment" | "direct-mutation" | "display-name" | "document" | "effect" | "element" | "error" | "event" | "event-handler" | "exhaustive-deps" | "expression" | "false" | "filename" | "forward-ref" | "fragment" | "function" | "function-component" | "function-name" | "global" | "handler" | "hook" | "html" | "id" | "index" | "input" | "key" | "literal" | "map" | "memo" | "memoized-function" | "method" | "name" | "namespace" | "node" | "parameter" | "prop" | "ref" | "render" | "return" | "spread" | "state" | "string" | "string-refs" | "style" | "textnodes" | "use-callback" | "use-context" | "use-effect" | "use-imperative-handle" | "use-layout-effect" | "use-memo" | "use-reducer" | "use-ref" | "use-state" | "value" | "variable";
60
+ type Term = "argument" | "array" | "array-index" | "arrow-function" | "attribute" | "callback" | "children" | "class" | "class-component" | "class-method" | "class-property" | "clone-element" | "comment" | "component" | "components" | "computed" | "computed-property" | "conditional-rendering" | "const" | "constant" | "constructor" | "context" | "context-consumer" | "context-provider" | "context-value" | "create-ref" | "custom-hooks" | "default-props" | "deps" | "destructuring" | "destructuring-assignment" | "direct-mutation" | "display-name" | "document" | "effect" | "element" | "error" | "event" | "event-handler" | "exhaustive-deps" | "expression" | "false" | "filename" | "forward-ref" | "fragment" | "function" | "function-component" | "function-name" | "global" | "handler" | "hook" | "html" | "id" | "index" | "input" | "key" | "list-rendering" | "literal" | "map" | "memo" | "memoized-function" | "method" | "name" | "namespace" | "node" | "parameter" | "prop" | "ref" | "render" | "return" | "spread" | "state" | "string" | "string-refs" | "style" | "textnodes" | "use-callback" | "use-context" | "use-effect" | "use-imperative-handle" | "use-layout-effect" | "use-memo" | "use-reducer" | "use-ref" | "use-state" | "value" | "variable";
61
61
  type Additional = string;
62
62
  type RuleName = `${Ban}-${Term}` | `${NeutralModifier}-${Term}` | `${NegativeModifier}-${NegativeDescriptive}-${Term}` | `${NegativeModifier}-${NeutralDescriptive}-${Term}` | `${PositiveModifier}-${NeutralDescriptive}-${Term}` | `${PositiveModifier}-${PositiveDescriptive}-${Term}`;
63
63
  type RuleNameWithAdditional = `${RuleName}-${Additional}`;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/types",
3
- "version": "0.8.6-beta.3",
3
+ "version": "0.8.6-beta.5",
4
4
  "description": "Type definitions for @eslint-react packages.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eslint-react/jsx",
3
- "version": "0.8.6-beta.3",
4
- "description": "ESLint plugin for React Hooks related rules.",
3
+ "version": "0.8.6-beta.5",
4
+ "description": "TSESTree AST utility module for static analysis of JSX.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
7
7
  "url": "https://github.com/rel1cx/eslint-react/issues"
@@ -40,9 +40,9 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "micro-memoize": "4.1.2",
43
- "@eslint-react/ast": "0.8.6-beta.3",
44
- "@eslint-react/tools": "0.8.6-beta.3",
45
- "@eslint-react/types": "0.8.6-beta.3"
43
+ "@eslint-react/ast": "0.8.6-beta.5",
44
+ "@eslint-react/types": "0.8.6-beta.5",
45
+ "@eslint-react/tools": "0.8.6-beta.5"
46
46
  },
47
47
  "bundleDependencies": [
48
48
  "@eslint-react/ast",