@eslint-react/jsx 0.8.8-beta.6 → 0.8.8

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
  *
@@ -839,6 +831,7 @@ function getExternalRefs(params) {
839
831
  */ function getVariablesUpToGlobal(startScope) {
840
832
  const scopeRef = tools.MutRef.make(startScope);
841
833
  const variablesRef = tools.MutRef.make(tools.MutRef.get(scopeRef).variables);
834
+ // eslint-disable-next-line functional/no-loop-statements
842
835
  while(tools.MutRef.get(scopeRef).type !== scopeManager.ScopeType.global){
843
836
  tools.MutRef.set(scopeRef, tools.MutRef.get(scopeRef).upper);
844
837
  tools.MutRef.update(variablesRef, (variables)=>variables.concat(tools.MutRef.get(scopeRef).variables));
@@ -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
  *
@@ -839,6 +831,7 @@ function getExternalRefs(params) {
839
831
  */ function getVariablesUpToGlobal(startScope) {
840
832
  const scopeRef = tools.MutRef.make(startScope);
841
833
  const variablesRef = tools.MutRef.make(tools.MutRef.get(scopeRef).variables);
834
+ // eslint-disable-next-line functional/no-loop-statements
842
835
  while(tools.MutRef.get(scopeRef).type !== scopeManager.ScopeType.global){
843
836
  tools.MutRef.set(scopeRef, tools.MutRef.get(scopeRef).upper);
844
837
  tools.MutRef.update(variablesRef, (variables)=>variables.concat(tools.MutRef.get(scopeRef).variables));
@@ -6,15 +6,6 @@ import { ASTUtils } from '@typescript-eslint/utils';
6
6
  import { toLowerCase, delimiterCase, replace } from 'string-ts';
7
7
  import * as eslintUtils from '@eslint-community/eslint-utils';
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 * as eslintUtils from '@eslint-community/eslint-utils';
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
  *
@@ -818,6 +810,7 @@ function getExternalRefs(params) {
818
810
  */ function getVariablesUpToGlobal(startScope) {
819
811
  const scopeRef = MutRef.make(startScope);
820
812
  const variablesRef = MutRef.make(MutRef.get(scopeRef).variables);
813
+ // eslint-disable-next-line functional/no-loop-statements
821
814
  while(MutRef.get(scopeRef).type !== ScopeType.global){
822
815
  MutRef.set(scopeRef, MutRef.get(scopeRef).upper);
823
816
  MutRef.update(variablesRef, (variables)=>variables.concat(MutRef.get(scopeRef).variables));
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "0.8.8-beta.6",
3
+ "version": "0.8.8",
4
4
  "description": "ESLint x React's TSESTree AST primitive utility module.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
@@ -9117,7 +9117,7 @@ var effectData_esm = /*#__PURE__*/Object.freeze({
9117
9117
  * @since 0.0.1
9118
9118
  */ const asConst = (a)=>a;
9119
9119
 
9120
- /**
9120
+ /* eslint-disable functional/prefer-immutable-types */ /**
9121
9121
  * Infers embedded primitive type of any type
9122
9122
  * @since 0.0.1
9123
9123
  * @param T Type to infer
@@ -35,7 +35,7 @@ type ArrayElement<A> = A extends readonly (infer T)[] ? T : never;
35
35
  * @param fn The function to get the value to compare.
36
36
  * @returns new array with unique values.
37
37
  */
38
- declare function uniqueBy<T>(arr: T[], fn: (x: T) => unknown): T[];
38
+ declare function uniqueBy<T>(arr: readonly T[], fn: (x: T) => unknown): T[];
39
39
 
40
40
  /**
41
41
  * @since 0.0.1
@@ -35,7 +35,7 @@ type ArrayElement<A> = A extends readonly (infer T)[] ? T : never;
35
35
  * @param fn The function to get the value to compare.
36
36
  * @returns new array with unique values.
37
37
  */
38
- declare function uniqueBy<T>(arr: T[], fn: (x: T) => unknown): T[];
38
+ declare function uniqueBy<T>(arr: readonly T[], fn: (x: T) => unknown): T[];
39
39
 
40
40
  /**
41
41
  * @since 0.0.1
@@ -9117,7 +9117,7 @@ var effectData_esm = /*#__PURE__*/Object.freeze({
9117
9117
  * @since 0.0.1
9118
9118
  */ const asConst = (a)=>a;
9119
9119
 
9120
- /**
9120
+ /* eslint-disable functional/prefer-immutable-types */ /**
9121
9121
  * Infers embedded primitive type of any type
9122
9122
  * @since 0.0.1
9123
9123
  * @param T Type to infer
@@ -9115,7 +9115,7 @@ var effectData_esm = /*#__PURE__*/Object.freeze({
9115
9115
  * @since 0.0.1
9116
9116
  */ const asConst = (a)=>a;
9117
9117
 
9118
- /**
9118
+ /* eslint-disable functional/prefer-immutable-types */ /**
9119
9119
  * Infers embedded primitive type of any type
9120
9120
  * @since 0.0.1
9121
9121
  * @param T Type to infer
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/tools",
3
- "version": "0.8.8-beta.6",
3
+ "version": "0.8.8",
4
4
  "description": "ESLint x React's std library and primitives.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
@@ -45,7 +45,7 @@ type RuleContext = Parameters<CreateRule>[0];
45
45
  */
46
46
  type RuleOptions = Parameters<CreateRule>[1];
47
47
 
48
- type RuleCategory = "complexity" | "correctness" | "deprecated" | "nursery" | "pedantic" | "perf" | "restriction" | "security" | "style" | "suspicious" | "verbose";
48
+ type RuleCategory = "complexity" | "correctness" | "debug" | "deprecated" | "nursery" | "pedantic" | "perf" | "restriction" | "security" | "style" | "suspicious" | "verbose";
49
49
 
50
50
  type Namespace = "debug" | "experimental" | "jsx" | "naming-convention" | "react" | "react-hooks";
51
51
  type Ban = "ban";
@@ -45,7 +45,7 @@ type RuleContext = Parameters<CreateRule>[0];
45
45
  */
46
46
  type RuleOptions = Parameters<CreateRule>[1];
47
47
 
48
- type RuleCategory = "complexity" | "correctness" | "deprecated" | "nursery" | "pedantic" | "perf" | "restriction" | "security" | "style" | "suspicious" | "verbose";
48
+ type RuleCategory = "complexity" | "correctness" | "debug" | "deprecated" | "nursery" | "pedantic" | "perf" | "restriction" | "security" | "style" | "suspicious" | "verbose";
49
49
 
50
50
  type Namespace = "debug" | "experimental" | "jsx" | "naming-convention" | "react" | "react-hooks";
51
51
  type Ban = "ban";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/types",
3
- "version": "0.8.8-beta.6",
3
+ "version": "0.8.8",
4
4
  "description": "ESLint x React's type definitions.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/jsx",
3
- "version": "0.8.8-beta.6",
3
+ "version": "0.8.8",
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": {
@@ -40,9 +40,9 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "micro-memoize": "4.1.2",
43
- "@eslint-react/ast": "0.8.8-beta.6",
44
- "@eslint-react/types": "0.8.8-beta.6",
45
- "@eslint-react/tools": "0.8.8-beta.6"
43
+ "@eslint-react/ast": "0.8.8",
44
+ "@eslint-react/tools": "0.8.8",
45
+ "@eslint-react/types": "0.8.8"
46
46
  },
47
47
  "bundleDependencies": [
48
48
  "@eslint-react/ast",