eslint-plugin-ts-data-forge 0.10.0 → 0.10.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/plugin.d.mts +1 -1
- package/dist/rule-types.d.mts +1 -1
- package/dist/rules/ast-utils.d.mts +0 -16
- package/dist/rules/ast-utils.d.mts.map +1 -1
- package/dist/rules/ast-utils.mjs +0 -36
- package/dist/rules/ast-utils.mjs.map +1 -1
- package/dist/rules/no-side-effect-import.d.mts +1 -8
- package/dist/rules/no-side-effect-import.d.mts.map +1 -1
- package/dist/rules/no-side-effect-import.mjs +7 -43
- package/dist/rules/no-side-effect-import.mjs.map +1 -1
- package/dist/rules/prefer-arr-is-array.d.mts +1 -5
- package/dist/rules/prefer-arr-is-array.d.mts.map +1 -1
- package/dist/rules/prefer-arr-is-array.mjs +5 -83
- package/dist/rules/prefer-arr-is-array.mjs.map +1 -1
- 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-num-safe-parse-float.d.mts +1 -15
- package/dist/rules/prefer-num-safe-parse-float.d.mts.map +1 -1
- package/dist/rules/prefer-num-safe-parse-float.mjs +6 -123
- package/dist/rules/prefer-num-safe-parse-float.mjs.map +1 -1
- package/dist/rules/prefer-num-safe-parse-int.d.mts +1 -13
- package/dist/rules/prefer-num-safe-parse-int.d.mts.map +1 -1
- package/dist/rules/prefer-num-safe-parse-int.mjs +6 -121
- package/dist/rules/prefer-num-safe-parse-int.mjs.map +1 -1
- package/dist/rules/rules.d.mts +1 -1
- package/package.json +5 -5
- package/src/rule-types.mts +1 -1
- package/src/rules/ast-utils.mts +0 -51
- package/src/rules/no-side-effect-import.mts +7 -61
- package/src/rules/prefer-arr-is-array.mts +5 -122
- package/src/rules/prefer-arr-is-array.test.mts +50 -7
- package/src/rules/prefer-is-non-null-object.mts +4 -274
- package/src/rules/prefer-is-record-and-has-key.mts +4 -318
- package/src/rules/prefer-num-safe-parse-float.mts +6 -193
- package/src/rules/prefer-num-safe-parse-float.test.mts +18 -0
- package/src/rules/prefer-num-safe-parse-int.mts +6 -192
- package/src/rules/prefer-num-safe-parse-int.test.mts +18 -0
package/dist/plugin.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const eslintPluginTsDataForge: {
|
|
|
8
8
|
readonly 'prefer-canonical-length-guard': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useCanonicalGuard" | "useIsBoundedLengthArray" | "useIsFixedLengthArray" | "useIsMaxLengthArray" | "useIsMinLengthArray" | "useIsNonEmpty", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
9
9
|
readonly 'prefer-canonical-length-cast': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useCanonicalCast", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
10
10
|
readonly 'prefer-arr-generate': import("@typescript-eslint/utils/ts-eslint").RuleModule<"suggestArrGenerate" | "useArrGenerate", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
11
|
-
readonly 'prefer-arr-is-array': import("@typescript-eslint/utils/ts-eslint").RuleModule<"
|
|
11
|
+
readonly 'prefer-arr-is-array': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useIsArray", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
12
12
|
readonly 'prefer-arr-scan': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferArrScanAccumulate" | "preferArrScanPrefix", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
13
13
|
readonly 'prefer-arr-sum': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useArrSum" | "useArrSumBy", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
14
14
|
readonly 'prefer-arr-uniq': import("@typescript-eslint/utils/ts-eslint").RuleModule<"suggestArrUniq" | "useArrUniq", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
package/dist/rule-types.d.mts
CHANGED
|
@@ -177,7 +177,7 @@ declare namespace PreferIsRecordAndHasKey {
|
|
|
177
177
|
type RuleEntry = Linter.StringSeverity;
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
|
-
* @description Replace `parseInt(x, 10)` with `Result.unwrapOkOr(Num.safeParseInt(x), Number.NaN)` from ts-data-forge.
|
|
180
|
+
* @description Replace `parseInt(x)` or `Number.parseInt(x, 10)` with `Result.unwrapOkOr(Num.safeParseInt(x), Number.NaN)` from ts-data-forge.
|
|
181
181
|
*
|
|
182
182
|
* ```md
|
|
183
183
|
* | key | value |
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type TSESLint, type TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
import type { DeepReadonly } from 'ts-type-forge';
|
|
3
|
-
import type * as ts from 'typescript';
|
|
4
3
|
/**
|
|
5
4
|
* Whether `node` is an array or a tuple at every layer of type wrappers (see
|
|
6
5
|
* {@link typeWrapperLayers}): a cast does not make a string an array, and the
|
|
@@ -53,20 +52,5 @@ export declare const parseLengthComparison: (wrapped: TSESTree.Expression, sourc
|
|
|
53
52
|
* is still the operand.
|
|
54
53
|
*/
|
|
55
54
|
export declare const isPartOfBoundedLengthCheck: (node: TSESTree.BinaryExpression, sourceCode: TSESLint.SourceCode) => boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Whether `node`, read through its type wrappers, is the identifier `name`:
|
|
58
|
-
* `Number`, `(Number as NumberConstructor)` and `Number!` are the same object.
|
|
59
|
-
*/
|
|
60
|
-
export declare const isIdentifierNamed: (node: TSESTree.Node, name: string) => boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Whether `holds` is true of the type of every layer of type wrappers around
|
|
63
|
-
* `node` (see {@link typeWrapperLayers}), outermost to innermost; `false`
|
|
64
|
-
* without type information. A widening cast (`s as string | number`) is the
|
|
65
|
-
* author saying the value may be more than it is, and is respected; a
|
|
66
|
-
* narrowing one (`s!`, `v as unknown as string`) cannot vouch for what the
|
|
67
|
-
* value's own type does not, and the fix, which keeps the wrapper, has to
|
|
68
|
-
* type-check at every layer too.
|
|
69
|
-
*/
|
|
70
|
-
export declare const typeHoldsAtEveryLayer: (sourceCode: TSESLint.SourceCode, node: TSESTree.Node, holds: (type: ts.Type, typeChecker: ts.TypeChecker) => boolean) => boolean;
|
|
71
55
|
export {};
|
|
72
56
|
//# sourceMappingURL=ast-utils.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-utils.d.mts","sourceRoot":"","sources":["../../src/rules/ast-utils.mts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,QAAQ,EACd,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ast-utils.d.mts","sourceRoot":"","sources":["../../src/rules/ast-utils.mts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,QAAQ,EACd,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAOlD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,aAEzB,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAEzC,QAAQ,CAAC,UAAU,KACxB,OAkBF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,SAC/B,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,cAE3B,QAAQ,CAAC,UAAU,KAC9B,OA0CF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,SAEnB,QAAQ,CAAC,UAAU,KACxB,QAAQ,CAAC,gBAAgB,GAAG,SAS9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,MAEvB,QAAQ,CAAC,UAAU,KAEnB,QAAQ,CAAC,UAAU,cAEV,QAAQ,CAAC,UAAU,KAC9B,OAEsC,CAAC;AAE1C,KAAK,gBAAgB,GAAG,QAAQ,CAAC;IAC/B,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC;IAC3B,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC;IAC3B,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,YAEvB,QAAQ,CAAC,UAAU,cAEhB,QAAQ,CAAC,UAAU,KAC9B,gBAAgB,GAAG,SAuCrB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,SAE/B,QAAQ,CAAC,gBAAgB,cAEnB,QAAQ,CAAC,UAAU,KAC9B,OA8BF,CAAC"}
|
package/dist/rules/ast-utils.mjs
CHANGED
|
@@ -178,40 +178,4 @@ node) => node.parent !== undefined && isTypeWrapper(node.parent)
|
|
|
178
178
|
const isVariableDefinition = (
|
|
179
179
|
|
|
180
180
|
def) => def.type === 'Variable';
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
export const isIdentifierNamed = (
|
|
186
|
-
|
|
187
|
-
node, name) => {
|
|
188
|
-
const unwrapped = skipTypeWrappers(node);
|
|
189
|
-
return (unwrapped.type === AST_NODE_TYPES.Identifier && unwrapped.name === name);
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
export const typeHoldsAtEveryLayer = (
|
|
201
|
-
|
|
202
|
-
sourceCode,
|
|
203
|
-
|
|
204
|
-
node,
|
|
205
|
-
|
|
206
|
-
holds) => {
|
|
207
|
-
const services = sourceCode.parserServices;
|
|
208
|
-
const checker = services?.program?.getTypeChecker();
|
|
209
|
-
if (checker === undefined) {
|
|
210
|
-
return false;
|
|
211
|
-
}
|
|
212
|
-
return typeWrapperLayers(node).every((layer) => {
|
|
213
|
-
const tsNode = services?.esTreeNodeToTSNodeMap?.get(layer);
|
|
214
|
-
return (tsNode !== undefined && holds(checker.getTypeAtLocation(tsNode), checker));
|
|
215
|
-
});
|
|
216
|
-
};
|
|
217
181
|
//# sourceMappingURL=ast-utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-utils.mjs","sourceRoot":"","sources":["../../src/rules/ast-utils.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,QAAQ,GAGT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ast-utils.mjs","sourceRoot":"","sources":["../../src/rules/ast-utils.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,QAAQ,GAGT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,gBAAgB,GAAG,CAAC,IAAuC,EAAW,EAAE,CAC5E,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,OAAO;IACpC,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;IAC9B,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;AACtC,8EAA8E;AAC9E,QAA+C;AAC/C,8EAA8E;AAC9E,I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;IACnC,CAAC,CAAC,IAAI,CAAC;AAQX,MAAM,oBAAoB,GAAG;AAC3B,8EAA8E;AAC9E,GAA8B,EACyB,EAAE,CACxD,GAAG,CAAC,IAAe,KAAK,UAAU,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
-
type Options = readonly [];
|
|
3
|
-
type MessageIds = 'removeSideEffectImport';
|
|
4
1
|
/**
|
|
5
2
|
* `import 'ts-data-forge';` binds nothing and runs nothing: every export is a
|
|
6
3
|
* pure value or function, and the package declares `sideEffects: false`, which
|
|
@@ -8,10 +5,6 @@ type MessageIds = 'removeSideEffectImport';
|
|
|
8
5
|
* a side-effect import in the emitted JavaScript — that is the one kind it
|
|
9
6
|
* never elides — so what is left is a module loaded for no reason, and a
|
|
10
7
|
* bundler that trusts the flag drops it anyway.
|
|
11
|
-
*
|
|
12
|
-
* The rule matches the bare specifier exactly; an import of some other module
|
|
13
|
-
* is none of its business.
|
|
14
8
|
*/
|
|
15
|
-
export declare const noSideEffectImport:
|
|
16
|
-
export {};
|
|
9
|
+
export declare const noSideEffectImport: import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeSideEffectImport", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
17
10
|
//# sourceMappingURL=no-side-effect-import.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-side-effect-import.d.mts","sourceRoot":"","sources":["../../src/rules/no-side-effect-import.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-side-effect-import.d.mts","sourceRoot":"","sources":["../../src/rules/no-side-effect-import.mts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,oKAK7B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNoSideEffectImport } from 'eslint-rule-forge';
|
|
2
2
|
import { TS_DATA_FORGE_MODULE } from './constants.mjs';
|
|
3
3
|
|
|
4
4
|
|
|
@@ -8,46 +8,10 @@ import { TS_DATA_FORGE_MODULE } from './constants.mjs';
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
docs: {
|
|
18
|
-
description: `Remove a side-effect-only \`import '${TS_DATA_FORGE_MODULE}';\`, which binds no name and, the package being \`sideEffects: false\`, does nothing.`,
|
|
19
|
-
},
|
|
20
|
-
fixable: 'code',
|
|
21
|
-
schema: [],
|
|
22
|
-
messages: {
|
|
23
|
-
removeSideEffectImport: `\`import '${TS_DATA_FORGE_MODULE}';\` binds no name, and \`${TS_DATA_FORGE_MODULE}\` declares \`sideEffects: false\`, so loading it does nothing. Remove it, and import what you need by name.`,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
create: (context) => ({
|
|
27
|
-
ImportDeclaration: (node) => {
|
|
28
|
-
if (node.source.value !== TS_DATA_FORGE_MODULE ||
|
|
29
|
-
!Arr.isEmpty(node.specifiers)) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
context.report({
|
|
33
|
-
node,
|
|
34
|
-
messageId: 'removeSideEffectImport',
|
|
35
|
-
fix: (fixer) => removeStatement(fixer, context.sourceCode, node),
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
}),
|
|
39
|
-
defaultOptions: [],
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const removeStatement = (fixer, sourceCode, node) => {
|
|
47
|
-
const restOfLine = /^[^\S\n]*\n/u.exec(sourceCode.getText().slice(node.range[1]));
|
|
48
|
-
return fixer.removeRange([
|
|
49
|
-
node.range[0],
|
|
50
|
-
node.range[1] + (restOfLine?.[0].length ?? 0),
|
|
51
|
-
]);
|
|
52
|
-
};
|
|
11
|
+
export const noSideEffectImport = createNoSideEffectImport({
|
|
12
|
+
moduleName: TS_DATA_FORGE_MODULE,
|
|
13
|
+
type: 'suggestion',
|
|
14
|
+
description: `Remove a side-effect-only \`import '${TS_DATA_FORGE_MODULE}';\`, which binds no name and, the package being \`sideEffects: false\`, does nothing.`,
|
|
15
|
+
message: `\`import '${TS_DATA_FORGE_MODULE}';\` binds no name, and \`${TS_DATA_FORGE_MODULE}\` declares \`sideEffects: false\`, so loading it does nothing. Remove it, and import what you need by name.`,
|
|
16
|
+
});
|
|
53
17
|
//# sourceMappingURL=no-side-effect-import.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-side-effect-import.mjs","sourceRoot":"","sources":["../../src/rules/no-side-effect-import.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-side-effect-import.mjs","sourceRoot":"","sources":["../../src/rules/no-side-effect-import.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;IACzD,UAAU,EAAE,oBAAoB;IAChC,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,uCAAuC,oBAAoB,wFAAwF;IAChK,OAAO,EAAE,aAAa,oBAAoB,6BAA6B,oBAAoB,8GAA8G;CAC1M,CAAC,CAAC"}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type Options = readonly [];
|
|
3
|
-
type MessageIds = 'useArrIsArray';
|
|
4
|
-
export declare const preferArrIsArray: TSESLint.RuleModule<MessageIds, Options>;
|
|
5
|
-
export {};
|
|
1
|
+
export declare const preferArrIsArray: import("@typescript-eslint/utils/ts-eslint").RuleModule<"useIsArray", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
6
2
|
//# sourceMappingURL=prefer-arr-is-array.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-arr-is-array.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-arr-is-array.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prefer-arr-is-array.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-arr-is-array.mts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,wJAG3B,CAAC"}
|
|
@@ -1,85 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { buildNamedImportFix, getImportDeclarations, getNamedImports, skipTypeWrappers, } from 'eslint-rule-forge';
|
|
1
|
+
import { createPreferArrayIsArray } from 'eslint-rule-forge';
|
|
3
2
|
import { TS_DATA_FORGE_MODULE } from './constants.mjs';
|
|
4
|
-
export const preferArrIsArray = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
description: 'Replace `Array.isArray` with `Arr.isArray` from ts-data-forge.',
|
|
9
|
-
},
|
|
10
|
-
fixable: 'code',
|
|
11
|
-
schema: [],
|
|
12
|
-
messages: {
|
|
13
|
-
useArrIsArray: 'Replace `Array.isArray` with `Arr.isArray` from ts-data-forge.',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
create: (context) => {
|
|
17
|
-
const sourceCode = context.sourceCode;
|
|
18
|
-
const program = sourceCode.ast;
|
|
19
|
-
const tsDataForgeImports = getImportDeclarations(program, TS_DATA_FORGE_MODULE);
|
|
20
|
-
const mut_nodesToFix = [];
|
|
21
|
-
return {
|
|
22
|
-
CallExpression: (node) => {
|
|
23
|
-
if (!isArrayIsArrayCall(node)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
mut_nodesToFix.push(node);
|
|
27
|
-
},
|
|
28
|
-
'Program:exit': () => {
|
|
29
|
-
|
|
30
|
-
const hasArrImport = getNamedImports(tsDataForgeImports).includes('Arr');
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
for (const [index, node] of mut_nodesToFix.entries()) {
|
|
36
|
-
context.report({
|
|
37
|
-
node,
|
|
38
|
-
messageId: 'useArrIsArray',
|
|
39
|
-
fix: (fixer) => {
|
|
40
|
-
const callee = node.callee;
|
|
41
|
-
if (callee.type !== AST_NODE_TYPES.MemberExpression) {
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const importFixes = index === 0 && !hasArrImport
|
|
48
|
-
? buildNamedImportFix(fixer, program, TS_DATA_FORGE_MODULE, [
|
|
49
|
-
'Arr',
|
|
50
|
-
])
|
|
51
|
-
: [];
|
|
52
|
-
return [...importFixes, fixer.replaceText(callee, 'Arr.isArray')];
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
defaultOptions: [],
|
|
60
|
-
};
|
|
61
|
-
const isArrayIsArrayCall = (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
node) => {
|
|
65
|
-
if (node.callee.type !== AST_NODE_TYPES.MemberExpression) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
const { property } = node.callee;
|
|
69
|
-
|
|
70
|
-
const object = skipTypeWrappers(node.callee.object);
|
|
71
|
-
if (object.type !== AST_NODE_TYPES.Identifier) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
if (object.name !== 'Array') {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
if (property.type !== AST_NODE_TYPES.Identifier) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
if (property.name !== 'isArray') {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
};
|
|
3
|
+
export const preferArrIsArray = createPreferArrayIsArray({
|
|
4
|
+
moduleName: TS_DATA_FORGE_MODULE,
|
|
5
|
+
namespace: 'Arr',
|
|
6
|
+
});
|
|
85
7
|
//# sourceMappingURL=prefer-arr-is-array.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-arr-is-array.mjs","sourceRoot":"","sources":["../../src/rules/prefer-arr-is-array.mts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"prefer-arr-is-array.mjs","sourceRoot":"","sources":["../../src/rules/prefer-arr-is-array.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;IACvD,UAAU,EAAE,oBAAoB;IAChC,SAAS,EAAE,KAAK;CACjB,CAAC,CAAC"}
|
|
@@ -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_DATA_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-data-forge.',
|
|
9
|
-
},
|
|
10
|
-
fixable: 'code',
|
|
11
|
-
schema: [],
|
|
12
|
-
messages: {
|
|
13
|
-
useIsNonNullObject: 'Replace the object/null check with `isNonNullObject()` from ts-data-forge.',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
create: (context) => {
|
|
17
|
-
const sourceCode = context.sourceCode;
|
|
18
|
-
const program = sourceCode.ast;
|
|
19
|
-
const tsDataForgeImports = getImportDeclarations(program, TS_DATA_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(tsDataForgeImports).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_DATA_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_DATA_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,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;IAC/D,UAAU,EAAE,oBAAoB;CACjC,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"}
|