eslint-plugin-ts-std-forge 0.1.10 → 0.1.12
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/plugin.d.mts +3 -3
- package/dist/rules/prefer-is-non-null-object.d.mts +1 -5
- package/dist/rules/prefer-is-non-null-object.d.mts.map +1 -1
- package/dist/rules/prefer-is-non-null-object.mjs +4 -184
- package/dist/rules/prefer-is-non-null-object.mjs.map +1 -1
- package/dist/rules/prefer-is-record-and-has-key.d.mts +1 -5
- package/dist/rules/prefer-is-record-and-has-key.d.mts.map +1 -1
- package/dist/rules/prefer-is-record-and-has-key.mjs +4 -219
- package/dist/rules/prefer-is-record-and-has-key.mjs.map +1 -1
- package/dist/rules/prefer-safe-array-is-array.d.mts +1 -5
- package/dist/rules/prefer-safe-array-is-array.d.mts.map +1 -1
- package/dist/rules/prefer-safe-array-is-array.mjs +5 -78
- package/dist/rules/prefer-safe-array-is-array.mjs.map +1 -1
- package/dist/rules/prefer-safe-array-length-guard.mjs +1 -2
- package/dist/rules/prefer-safe-array-length-guard.mjs.map +1 -1
- package/dist/rules/prefer-safe-number-parse-integer.d.mts +1 -12
- package/dist/rules/prefer-safe-number-parse-integer.d.mts.map +1 -1
- package/dist/rules/prefer-safe-number-parse-integer.mjs +6 -108
- package/dist/rules/prefer-safe-number-parse-integer.mjs.map +1 -1
- package/dist/rules/prefer-safe-number-parse.d.mts +1 -12
- package/dist/rules/prefer-safe-number-parse.d.mts.map +1 -1
- package/dist/rules/prefer-safe-number-parse.mjs +6 -103
- package/dist/rules/prefer-safe-number-parse.mjs.map +1 -1
- package/dist/rules/rules.d.mts +3 -3
- package/package.json +6 -6
- package/src/rules/prefer-is-non-null-object.mts +4 -274
- package/src/rules/prefer-is-record-and-has-key.mts +4 -322
- package/src/rules/prefer-is-record-and-has-key.test.mts +48 -0
- package/src/rules/prefer-safe-array-is-array.mts +5 -119
- package/src/rules/prefer-safe-array-is-array.test.mts +18 -14
- package/src/rules/prefer-safe-array-length-guard.mts +1 -1
- package/src/rules/prefer-safe-number-parse-integer.mts +6 -172
- package/src/rules/prefer-safe-number-parse-integer.test.mts +22 -8
- package/src/rules/prefer-safe-number-parse.mts +6 -163
- package/src/rules/prefer-safe-number-parse.test.mts +30 -9
- package/dist/rules/ast-utils.d.mts +0 -18
- package/dist/rules/ast-utils.d.mts.map +0 -1
- package/dist/rules/ast-utils.mjs +0 -39
- package/dist/rules/ast-utils.mjs.map +0 -1
- package/src/rules/ast-utils.mts +0 -57
package/dist/plugin.d.mts
CHANGED
|
@@ -6,10 +6,10 @@ export declare const eslintPluginTsStdForge: {
|
|
|
6
6
|
readonly rules: {
|
|
7
7
|
readonly 'prefer-is-non-null-object': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useIsNonNullObject", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
8
8
|
readonly 'prefer-is-record-and-has-key': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useHasKey" | "useIsRecordAndHasKey", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
9
|
-
readonly 'prefer-safe-array-is-array': import("@typescript-eslint/utils/ts-eslint").RuleModule<"
|
|
9
|
+
readonly 'prefer-safe-array-is-array': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useIsArray", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
10
10
|
readonly 'prefer-safe-array-length-guard': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useIsEmpty" | "useIsNonEmpty", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
11
|
-
readonly 'prefer-safe-number-parse': import("@typescript-eslint/utils/ts-eslint").RuleModule<"
|
|
12
|
-
readonly 'prefer-safe-number-parse-integer': import("@typescript-eslint/utils/ts-eslint").RuleModule<"
|
|
11
|
+
readonly 'prefer-safe-number-parse': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useSafeParseFloat", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
12
|
+
readonly 'prefer-safe-number-parse-integer': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useSafeParseInt", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
13
13
|
};
|
|
14
14
|
readonly configs: {
|
|
15
15
|
/** Enables every rule of this plugin at `error`. */
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type Options = readonly [];
|
|
3
|
-
type MessageIds = 'useIsNonNullObject';
|
|
4
|
-
export declare const preferIsNonNullObject: TSESLint.RuleModule<MessageIds, Options>;
|
|
5
|
-
export {};
|
|
1
|
+
export declare const preferIsNonNullObject: import("@typescript-eslint/utils/ts-eslint").RuleModule<"useIsNonNullObject", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
6
2
|
//# sourceMappingURL=prefer-is-non-null-object.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-is-non-null-object.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-is-non-null-object.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prefer-is-non-null-object.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-is-non-null-object.mts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,gKAEhC,CAAC"}
|
|
@@ -1,186 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { buildNamedImportFix, getImportDeclarations, getNamedImports, getRangeWithParens, parenthesesDepth, skipTypeWrappers, } from 'eslint-rule-forge';
|
|
1
|
+
import { createPreferIsNonNullObject } from 'eslint-rule-forge';
|
|
3
2
|
import { TS_STD_FORGE_MODULE } from './constants.mjs';
|
|
4
|
-
export const preferIsNonNullObject = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
docs: {
|
|
8
|
-
description: 'Replace `typeof u === "object" && u !== null`, in either order and anywhere in an `&&` chain, with `isNonNullObject(u)` from ts-std-forge.',
|
|
9
|
-
},
|
|
10
|
-
fixable: 'code',
|
|
11
|
-
schema: [],
|
|
12
|
-
messages: {
|
|
13
|
-
useIsNonNullObject: 'Replace the object/null check with `isNonNullObject()` from ts-std-forge.',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
create: (context) => {
|
|
17
|
-
const sourceCode = context.sourceCode;
|
|
18
|
-
const program = sourceCode.ast;
|
|
19
|
-
const tsStdForgeImports = getImportDeclarations(program, TS_STD_FORGE_MODULE);
|
|
20
|
-
const mut_pairsToFix = [];
|
|
21
|
-
return {
|
|
22
|
-
LogicalExpression: (node) => {
|
|
23
|
-
|
|
24
|
-
if (node.operator !== '&&' || isChainOperand(sourceCode, node)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
mut_pairsToFix.push(...findNonNullObjectPairs(sourceCode, node));
|
|
28
|
-
},
|
|
29
|
-
'Program:exit': () => {
|
|
30
|
-
const hasIsNonNullObjectImport = getNamedImports(tsStdForgeImports).includes('isNonNullObject');
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
for (const [index, { range, identifierName },] of mut_pairsToFix.entries()) {
|
|
37
|
-
context.report({
|
|
38
|
-
loc: {
|
|
39
|
-
start: sourceCode.getLocFromIndex(range[0]),
|
|
40
|
-
end: sourceCode.getLocFromIndex(range[1]),
|
|
41
|
-
},
|
|
42
|
-
messageId: 'useIsNonNullObject',
|
|
43
|
-
fix: (fixer) => {
|
|
44
|
-
const replacement = `isNonNullObject(${identifierName})`;
|
|
45
|
-
const importFixes = index === 0 && !hasIsNonNullObjectImport
|
|
46
|
-
? buildNamedImportFix(fixer, program, TS_STD_FORGE_MODULE, [
|
|
47
|
-
'isNonNullObject',
|
|
48
|
-
])
|
|
49
|
-
: [];
|
|
50
|
-
return [
|
|
51
|
-
...importFixes,
|
|
52
|
-
fixer.replaceTextRange(range, replacement),
|
|
53
|
-
];
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
defaultOptions: [],
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const isChainOperand = (
|
|
67
|
-
|
|
68
|
-
sourceCode,
|
|
69
|
-
|
|
70
|
-
node) => node.parent.type === AST_NODE_TYPES.LogicalExpression &&
|
|
71
|
-
node.parent.operator === '&&' &&
|
|
72
|
-
parenthesesDepth(sourceCode, node) === 0;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const findNonNullObjectPairs = (
|
|
80
|
-
|
|
81
|
-
sourceCode,
|
|
82
|
-
|
|
83
|
-
node) => {
|
|
84
|
-
const operands = chainOperands(sourceCode, node);
|
|
85
|
-
const pairsFrom = (index) => {
|
|
86
|
-
const first = operands[index];
|
|
87
|
-
const second = operands[index + 1];
|
|
88
|
-
if (first === undefined || second === undefined) {
|
|
89
|
-
return [];
|
|
90
|
-
}
|
|
91
|
-
const identifierName = pairIdentifierName(first, second) ?? pairIdentifierName(second, first);
|
|
92
|
-
return identifierName === undefined
|
|
93
|
-
? pairsFrom(index + 1)
|
|
94
|
-
: [
|
|
95
|
-
{
|
|
96
|
-
range: [
|
|
97
|
-
getRangeWithParens(sourceCode, first)[0],
|
|
98
|
-
getRangeWithParens(sourceCode, second)[1],
|
|
99
|
-
],
|
|
100
|
-
identifierName,
|
|
101
|
-
},
|
|
102
|
-
...pairsFrom(index + 2),
|
|
103
|
-
];
|
|
104
|
-
};
|
|
105
|
-
return pairsFrom(0);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const chainOperands = (
|
|
112
|
-
|
|
113
|
-
sourceCode,
|
|
114
|
-
|
|
115
|
-
node) => [node.left, node.right].flatMap((operand) => operand.type === AST_NODE_TYPES.LogicalExpression &&
|
|
116
|
-
operand.operator === '&&' &&
|
|
117
|
-
parenthesesDepth(sourceCode, operand) === 0
|
|
118
|
-
? chainOperands(sourceCode, operand)
|
|
119
|
-
: [operand]);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const pairIdentifierName = (
|
|
127
|
-
|
|
128
|
-
typeofCheck,
|
|
129
|
-
|
|
130
|
-
nullCheck) => {
|
|
131
|
-
const identifierName = getTypeofObjectIdentifierName(skipTypeWrappers(typeofCheck));
|
|
132
|
-
return identifierName !== undefined &&
|
|
133
|
-
identifierName ===
|
|
134
|
-
getNonNullCheckIdentifierName(skipTypeWrappers(nullCheck))
|
|
135
|
-
? identifierName
|
|
136
|
-
: undefined;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const getTypeofObjectIdentifierName = (
|
|
140
|
-
|
|
141
|
-
node) => {
|
|
142
|
-
if (node.type !== AST_NODE_TYPES.BinaryExpression ||
|
|
143
|
-
node.operator !== '===') {
|
|
144
|
-
return undefined;
|
|
145
|
-
}
|
|
146
|
-
const left = skipTypeWrappers(node.left);
|
|
147
|
-
const right = skipTypeWrappers(node.right);
|
|
148
|
-
const typeofSide = isLiteralOf(right, 'object')
|
|
149
|
-
? left
|
|
150
|
-
: isLiteralOf(left, 'object')
|
|
151
|
-
? right
|
|
152
|
-
: undefined;
|
|
153
|
-
if (typeofSide?.type !== AST_NODE_TYPES.UnaryExpression ||
|
|
154
|
-
typeofSide.operator !== 'typeof') {
|
|
155
|
-
return undefined;
|
|
156
|
-
}
|
|
157
|
-
const argument = skipTypeWrappers(typeofSide.argument);
|
|
158
|
-
return argument.type === AST_NODE_TYPES.Identifier
|
|
159
|
-
? argument.name
|
|
160
|
-
: undefined;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const getNonNullCheckIdentifierName = (
|
|
168
|
-
|
|
169
|
-
node) => {
|
|
170
|
-
if (node.type !== AST_NODE_TYPES.BinaryExpression ||
|
|
171
|
-
(node.operator !== '!==' && node.operator !== '!=')) {
|
|
172
|
-
return undefined;
|
|
173
|
-
}
|
|
174
|
-
const left = skipTypeWrappers(node.left);
|
|
175
|
-
const right = skipTypeWrappers(node.right);
|
|
176
|
-
const checked = isLiteralOf(right, null)
|
|
177
|
-
? left
|
|
178
|
-
: isLiteralOf(left, null)
|
|
179
|
-
? right
|
|
180
|
-
: undefined;
|
|
181
|
-
return checked?.type === AST_NODE_TYPES.Identifier ? checked.name : undefined;
|
|
182
|
-
};
|
|
183
|
-
const isLiteralOf = (
|
|
184
|
-
|
|
185
|
-
node, value) => node.type === AST_NODE_TYPES.Literal && node.value === value;
|
|
3
|
+
export const preferIsNonNullObject = createPreferIsNonNullObject({
|
|
4
|
+
moduleName: TS_STD_FORGE_MODULE,
|
|
5
|
+
});
|
|
186
6
|
//# sourceMappingURL=prefer-is-non-null-object.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-is-non-null-object.mjs","sourceRoot":"","sources":["../../src/rules/prefer-is-non-null-object.mts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"prefer-is-non-null-object.mjs","sourceRoot":"","sources":["../../src/rules/prefer-is-non-null-object.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;IAC/D,UAAU,EAAE,mBAAmB;CAChC,CAAC,CAAC"}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
type Options = readonly [];
|
|
3
|
-
type MessageIds = 'useIsRecordAndHasKey' | 'useHasKey';
|
|
4
|
-
export declare const preferIsRecordAndHasKey: TSESLint.RuleModule<MessageIds, Options>;
|
|
5
|
-
export {};
|
|
1
|
+
export declare const preferIsRecordAndHasKey: import("@typescript-eslint/utils/ts-eslint").RuleModule<"useHasKey" | "useIsRecordAndHasKey", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
6
2
|
//# sourceMappingURL=prefer-is-record-and-has-key.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-is-record-and-has-key.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-is-record-and-has-key.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prefer-is-record-and-has-key.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-is-record-and-has-key.mts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,gLAElC,CAAC"}
|
|
@@ -1,221 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { buildNamedImportFix, getArgumentText, getImportDeclarations, getNamedImports, skipTypeWrappers, } from 'eslint-rule-forge';
|
|
3
|
-
import { SafeArray } from 'ts-std-forge';
|
|
4
|
-
import * as ts from 'typescript';
|
|
5
|
-
import { isIdentifierNamed, typeHoldsAtEveryLayer } from './ast-utils.mjs';
|
|
1
|
+
import { createPreferIsRecordAndHasKey } from 'eslint-rule-forge';
|
|
6
2
|
import { TS_STD_FORGE_MODULE } from './constants.mjs';
|
|
7
|
-
export const preferIsRecordAndHasKey = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
docs: {
|
|
11
|
-
description: 'Replace `Object.hasOwn(obj, key)` or `key in obj` with `isRecord(obj) && hasKey(obj, key)` from ts-std-forge',
|
|
12
|
-
},
|
|
13
|
-
fixable: 'code',
|
|
14
|
-
schema: [],
|
|
15
|
-
messages: {
|
|
16
|
-
useIsRecordAndHasKey: 'Replace `{{original}}` with `isRecord({{objName}}) && hasKey({{objName}}, {{keyName}})` from ts-std-forge.',
|
|
17
|
-
useHasKey: 'Replace `{{original}}` with `hasKey({{objName}}, {{keyName}})` from ts-std-forge.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
create: (context) => {
|
|
21
|
-
const sourceCode = context.sourceCode;
|
|
22
|
-
const program = sourceCode.ast;
|
|
23
|
-
const tsStdForgeImports = getImportDeclarations(program, TS_STD_FORGE_MODULE);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const isKnownRecord = (
|
|
34
|
-
|
|
35
|
-
expression) => typeHoldsAtEveryLayer(sourceCode, expression, (type, checker) => isAlreadyRecordType(checker, type));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const mayBeArray = (
|
|
44
|
-
|
|
45
|
-
expression) => sourceCode.parserServices?.program != null &&
|
|
46
|
-
!typeHoldsAtEveryLayer(sourceCode, expression, (type, checker) => !mayBeArrayType(checker, type));
|
|
47
|
-
const mut_nodesToFix = [];
|
|
48
|
-
return {
|
|
49
|
-
|
|
50
|
-
CallExpression: (node) => {
|
|
51
|
-
const callee = skipTypeWrappers(node.callee);
|
|
52
|
-
if (callee.type !== AST_NODE_TYPES.MemberExpression ||
|
|
53
|
-
!isIdentifierNamed(callee.object, 'Object') ||
|
|
54
|
-
callee.property.type !== AST_NODE_TYPES.Identifier ||
|
|
55
|
-
callee.property.name !== 'hasOwn') {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (node.arguments.length !== 2) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const objArg = node.arguments[0];
|
|
63
|
-
const keyArg = node.arguments[1];
|
|
64
|
-
if (objArg === undefined || keyArg === undefined) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (objArg.type === AST_NODE_TYPES.SpreadElement ||
|
|
69
|
-
keyArg.type === AST_NODE_TYPES.SpreadElement ||
|
|
70
|
-
mayBeArray(objArg)) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
mut_nodesToFix.push({
|
|
74
|
-
node,
|
|
75
|
-
objExpression: objArg,
|
|
76
|
-
keyExpression: keyArg,
|
|
77
|
-
});
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
BinaryExpression: (node) => {
|
|
81
|
-
if (node.operator !== 'in') {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const keyExpression = node.left;
|
|
85
|
-
const objExpression = node.right;
|
|
86
|
-
|
|
87
|
-
if (keyExpression.type === AST_NODE_TYPES.PrivateIdentifier ||
|
|
88
|
-
mayBeArray(objExpression)) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
mut_nodesToFix.push({
|
|
92
|
-
node,
|
|
93
|
-
objExpression,
|
|
94
|
-
keyExpression,
|
|
95
|
-
});
|
|
96
|
-
},
|
|
97
|
-
'Program:exit': () => {
|
|
98
|
-
const namedImports = getNamedImports(tsStdForgeImports);
|
|
99
|
-
const rewrites = mut_nodesToFix.map((entry) => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const needsIsRecord = !isKnownRecord(entry.objExpression);
|
|
103
|
-
return {
|
|
104
|
-
...entry,
|
|
105
|
-
needsIsRecord,
|
|
106
|
-
|
|
107
|
-
fixable: !needsIsRecord || isSideEffectFree(entry.objExpression),
|
|
108
|
-
};
|
|
109
|
-
});
|
|
110
|
-
const fixableRewrites = rewrites.filter(({ fixable }) => fixable);
|
|
111
|
-
const importsToAdd = SafeArray.isEmpty(fixableRewrites)
|
|
112
|
-
? []
|
|
113
|
-
: [
|
|
114
|
-
...(fixableRewrites.some(({ needsIsRecord }) => needsIsRecord) && !namedImports.includes('isRecord')
|
|
115
|
-
? ['isRecord']
|
|
116
|
-
: []),
|
|
117
|
-
...(namedImports.includes('hasKey') ? [] : ['hasKey']),
|
|
118
|
-
];
|
|
119
|
-
const importCarrier = fixableRewrites[0];
|
|
120
|
-
for (const rewrite of rewrites) {
|
|
121
|
-
const { node, objExpression, keyExpression, needsIsRecord } = rewrite;
|
|
122
|
-
const objText = getArgumentText(sourceCode, objExpression);
|
|
123
|
-
const keyText = getArgumentText(sourceCode, keyExpression);
|
|
124
|
-
const originalText = sourceCode.getText(node);
|
|
125
|
-
context.report({
|
|
126
|
-
node,
|
|
127
|
-
messageId: needsIsRecord ? 'useIsRecordAndHasKey' : 'useHasKey',
|
|
128
|
-
data: {
|
|
129
|
-
original: originalText,
|
|
130
|
-
objName: objText,
|
|
131
|
-
keyName: keyText,
|
|
132
|
-
},
|
|
133
|
-
fix: !rewrite.fixable
|
|
134
|
-
? undefined
|
|
135
|
-
: (fixer) => {
|
|
136
|
-
const replacement = needsIsRecord
|
|
137
|
-
? `(isRecord(${objText}) && hasKey(${objText}, ${keyText}))`
|
|
138
|
-
: `hasKey(${objText}, ${keyText})`;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const importFixes = rewrite === importCarrier && importsToAdd.length > 0
|
|
144
|
-
? buildNamedImportFix(fixer, program, TS_STD_FORGE_MODULE, importsToAdd)
|
|
145
|
-
: [];
|
|
146
|
-
return [
|
|
147
|
-
...importFixes,
|
|
148
|
-
fixer.replaceText(node, replacement),
|
|
149
|
-
];
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
};
|
|
155
|
-
},
|
|
156
|
-
defaultOptions: [],
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const isSideEffectFree = (
|
|
163
|
-
|
|
164
|
-
wrapped) => {
|
|
165
|
-
const node = skipTypeWrappers(wrapped);
|
|
166
|
-
return (node.type === AST_NODE_TYPES.Identifier ||
|
|
167
|
-
node.type === AST_NODE_TYPES.ThisExpression ||
|
|
168
|
-
(node.type === AST_NODE_TYPES.MemberExpression &&
|
|
169
|
-
!node.computed &&
|
|
170
|
-
isSideEffectFree(node.object)));
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
const mayBeArrayType = (
|
|
178
|
-
|
|
179
|
-
checker,
|
|
180
|
-
|
|
181
|
-
type) => {
|
|
182
|
-
if (type.isUnionOrIntersection()) {
|
|
183
|
-
return type.types.some((member) => mayBeArrayType(checker, member));
|
|
184
|
-
}
|
|
185
|
-
if ((type.flags &
|
|
186
|
-
(ts.TypeFlags.TypeParameter |
|
|
187
|
-
ts.TypeFlags.IndexedAccess |
|
|
188
|
-
ts.TypeFlags.Conditional |
|
|
189
|
-
ts.TypeFlags.Substitution)) !==
|
|
190
|
-
0) {
|
|
191
|
-
const constraint = checker.getBaseConstraintOfType(type);
|
|
192
|
-
return constraint !== undefined && mayBeArrayType(checker, constraint);
|
|
193
|
-
}
|
|
194
|
-
return checker.isArrayType(type) || checker.isTupleType(type);
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
const isAlreadyRecordType = (
|
|
211
|
-
|
|
212
|
-
checker,
|
|
213
|
-
|
|
214
|
-
type) => type.isUnion()
|
|
215
|
-
? type.types.every((member) => isAlreadyRecordType(checker, member))
|
|
216
|
-
: checker.getIndexInfoOfType(type, ts.IndexKind.String) !== undefined &&
|
|
217
|
-
SafeArray.isEmpty(checker.getSignaturesOfType(type, ts.SignatureKind.Call)) &&
|
|
218
|
-
SafeArray.isEmpty(checker.getSignaturesOfType(type, ts.SignatureKind.Construct)) &&
|
|
219
|
-
!checker.isArrayType(type) &&
|
|
220
|
-
!checker.isTupleType(type);
|
|
3
|
+
export const preferIsRecordAndHasKey = createPreferIsRecordAndHasKey({
|
|
4
|
+
moduleName: TS_STD_FORGE_MODULE,
|
|
5
|
+
});
|
|
221
6
|
//# sourceMappingURL=prefer-is-record-and-has-key.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-is-record-and-has-key.mjs","sourceRoot":"","sources":["../../src/rules/prefer-is-record-and-has-key.mts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"prefer-is-record-and-has-key.mjs","sourceRoot":"","sources":["../../src/rules/prefer-is-record-and-has-key.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,CAAC;IACnE,UAAU,EAAE,mBAAmB;CAChC,CAAC,CAAC"}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type Options = readonly [];
|
|
3
|
-
type MessageIds = 'useSafeArrayIsArray';
|
|
4
|
-
export declare const preferSafeArrayIsArray: TSESLint.RuleModule<MessageIds, Options>;
|
|
5
|
-
export {};
|
|
1
|
+
export declare const preferSafeArrayIsArray: import("@typescript-eslint/utils/ts-eslint").RuleModule<"useIsArray", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
6
2
|
//# sourceMappingURL=prefer-safe-array-is-array.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-safe-array-is-array.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-safe-array-is-array.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prefer-safe-array-is-array.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-safe-array-is-array.mts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,wJAGjC,CAAC"}
|
|
@@ -1,80 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { buildNamedImportFix, getImportDeclarations, getNamedImports, getRangeWithParens, skipTypeWrappers, } from 'eslint-rule-forge';
|
|
3
|
-
import { isIdentifierNamed } from './ast-utils.mjs';
|
|
1
|
+
import { createPreferArrayIsArray } from 'eslint-rule-forge';
|
|
4
2
|
import { TS_STD_FORGE_MODULE } from './constants.mjs';
|
|
5
|
-
export const preferSafeArrayIsArray = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
description: 'Replace `Array.isArray` with `SafeArray.isArray` from ts-std-forge.',
|
|
10
|
-
},
|
|
11
|
-
fixable: 'code',
|
|
12
|
-
schema: [],
|
|
13
|
-
messages: {
|
|
14
|
-
useSafeArrayIsArray: 'Replace `Array.isArray` with `SafeArray.isArray` from ts-std-forge.',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
create: (context) => {
|
|
18
|
-
const sourceCode = context.sourceCode;
|
|
19
|
-
const program = sourceCode.ast;
|
|
20
|
-
const tsStdForgeImports = getImportDeclarations(program, TS_STD_FORGE_MODULE);
|
|
21
|
-
const mut_nodesToFix = [];
|
|
22
|
-
return {
|
|
23
|
-
CallExpression: (node) => {
|
|
24
|
-
if (!isArrayIsArrayCall(node)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
mut_nodesToFix.push(node);
|
|
28
|
-
},
|
|
29
|
-
'Program:exit': () => {
|
|
30
|
-
const hasSafeArrayImport = getNamedImports(tsStdForgeImports).includes('SafeArray');
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
for (const [index, node] of mut_nodesToFix.entries()) {
|
|
37
|
-
context.report({
|
|
38
|
-
node,
|
|
39
|
-
messageId: 'useSafeArrayIsArray',
|
|
40
|
-
fix: (fixer) => {
|
|
41
|
-
const importFixes = index === 0 && !hasSafeArrayImport
|
|
42
|
-
? buildNamedImportFix(fixer, program, TS_STD_FORGE_MODULE, [
|
|
43
|
-
'SafeArray',
|
|
44
|
-
])
|
|
45
|
-
: [];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return [
|
|
50
|
-
...importFixes,
|
|
51
|
-
fixer.replaceTextRange(getRangeWithParens(sourceCode, node.callee), 'SafeArray.isArray'),
|
|
52
|
-
];
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
defaultOptions: [],
|
|
60
|
-
};
|
|
61
|
-
const isArrayIsArrayCall = (
|
|
62
|
-
|
|
63
|
-
node) => {
|
|
64
|
-
const callee = skipTypeWrappers(node.callee);
|
|
65
|
-
if (callee.type !== AST_NODE_TYPES.MemberExpression) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
const { object, property } = callee;
|
|
69
|
-
if (!isIdentifierNamed(object, 'Array')) {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
if (property.type !== AST_NODE_TYPES.Identifier) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
if (property.name !== 'isArray') {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
return true;
|
|
79
|
-
};
|
|
3
|
+
export const preferSafeArrayIsArray = createPreferArrayIsArray({
|
|
4
|
+
moduleName: TS_STD_FORGE_MODULE,
|
|
5
|
+
namespace: 'SafeArray',
|
|
6
|
+
});
|
|
80
7
|
//# sourceMappingURL=prefer-safe-array-is-array.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-safe-array-is-array.mjs","sourceRoot":"","sources":["../../src/rules/prefer-safe-array-is-array.mts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"prefer-safe-array-is-array.mjs","sourceRoot":"","sources":["../../src/rules/prefer-safe-array-is-array.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;IAC7D,UAAU,EAAE,mBAAmB;IAC/B,SAAS,EAAE,WAAW;CACvB,CAAC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AST_NODE_TYPES, } from '@typescript-eslint/utils';
|
|
2
|
-
import { buildNamedImportFix, getArgumentText, getImportDeclarations, getNamedImports, skipTypeWrappers, } from 'eslint-rule-forge';
|
|
3
|
-
import { typeHoldsAtEveryLayer } from './ast-utils.mjs';
|
|
2
|
+
import { buildNamedImportFix, getArgumentText, getImportDeclarations, getNamedImports, skipTypeWrappers, typeHoldsAtEveryLayer, } from 'eslint-rule-forge';
|
|
4
3
|
import { TS_STD_FORGE_MODULE } from './constants.mjs';
|
|
5
4
|
|
|
6
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-safe-array-length-guard.mjs","sourceRoot":"","sources":["../../src/rules/prefer-safe-array-length-guard.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GAGf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,gBAAgB,
|
|
1
|
+
{"version":3,"file":"prefer-safe-array-length-guard.mjs","sourceRoot":"","sources":["../../src/rules/prefer-safe-array-length-guard.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GAGf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAQtD;;;;;;;;;GASG;AACH,MAAM,WAAW,GAAG;IAClB,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EA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,OAAO,GAAG,WAAW,CAAC,IAAI,CAC9B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK,CAC1E,CAAC;IAEF,OAAO,OAAO,KAAK,SAAS;QAC1B,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,EAAE,eAAe,EAAE,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;AACnE,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG;AACrB,8EAA8E;AAC9E,IAAmB,EACgB,EAAE,CACrC,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,gBAAgB;IAC7C,CAAC,IAAI,CAAC,QAAQ;IACd,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU;IAChD,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC"}
|
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type Options = readonly [];
|
|
3
|
-
type MessageIds = 'useSafeNumberParseInteger';
|
|
4
|
-
/**
|
|
5
|
-
* Detects `parseInt(x)` / `Number.parseInt(x, 10)` and replaces them with
|
|
6
|
-
* `Result.unwrapOkOr(SafeNumber.parseInteger(x), Number.NaN)` (ts-std-forge).
|
|
7
|
-
*
|
|
8
|
-
* Only base 10 is rewritten: `SafeNumber.parseInteger` takes no radix, so a
|
|
9
|
-
* call that passes another one means something the replacement cannot say.
|
|
10
|
-
*/
|
|
11
|
-
export declare const preferSafeNumberParseInteger: TSESLint.RuleModule<MessageIds, Options>;
|
|
12
|
-
export {};
|
|
1
|
+
export declare const preferSafeNumberParseInteger: import("@typescript-eslint/utils/ts-eslint").RuleModule<"useSafeParseInt", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
13
2
|
//# sourceMappingURL=prefer-safe-number-parse-integer.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-safe-number-parse-integer.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-safe-number-parse-integer.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prefer-safe-number-parse-integer.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-safe-number-parse-integer.mts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,6JAIvC,CAAC"}
|