tsl-dx 0.7.0 → 0.7.2
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.d.ts +1 -1
- package/dist/index.js +0 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,6 @@ type nullishOptions = {
|
|
|
88
88
|
* if (x == null) { }
|
|
89
89
|
* ```
|
|
90
90
|
*/
|
|
91
|
-
declare const nullish: (options?:
|
|
91
|
+
declare const nullish: (options?: "off" | nullishOptions | undefined) => tsl.Rule<unknown>;
|
|
92
92
|
//#endregion
|
|
93
93
|
export { noDuplicateExports, noDuplicateImports, noMultilineTemplateExpressionWithoutAutoDedent, nullish };
|
package/dist/index.js
CHANGED
|
@@ -366,7 +366,6 @@ const nullish = defineRule((options) => ({
|
|
|
366
366
|
},
|
|
367
367
|
visitor: {
|
|
368
368
|
Identifier(ctx, node) {
|
|
369
|
-
if (node.getSourceFile().isDeclarationFile) return;
|
|
370
369
|
if (node.parent.kind === SyntaxKind.BinaryExpression || node.text !== "undefined") return;
|
|
371
370
|
ctx.report({
|
|
372
371
|
node,
|
|
@@ -385,7 +384,6 @@ const nullish = defineRule((options) => ({
|
|
|
385
384
|
});
|
|
386
385
|
},
|
|
387
386
|
UndefinedKeyword(ctx, node) {
|
|
388
|
-
if (node.getSourceFile().isDeclarationFile) return;
|
|
389
387
|
ctx.report({
|
|
390
388
|
node,
|
|
391
389
|
message: messages.useUnitForUndefined,
|
|
@@ -403,7 +401,6 @@ const nullish = defineRule((options) => ({
|
|
|
403
401
|
});
|
|
404
402
|
},
|
|
405
403
|
BinaryExpression(ctx, node) {
|
|
406
|
-
if (node.getSourceFile().isDeclarationFile) return;
|
|
407
404
|
const newOperatorText = match(node.operatorToken.kind).with(SyntaxKind.EqualsEqualsEqualsToken, () => "==").with(SyntaxKind.ExclamationEqualsEqualsToken, () => "!=").otherwise(() => null);
|
|
408
405
|
if (newOperatorText == null) return;
|
|
409
406
|
const offendingChild = [node.left, node.right].find((n) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsl-dx",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "A tsl plugin for better JavaScript/TypeScript DX.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tsl",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"dedent": "^1.7.1",
|
|
28
28
|
"tsdown": "^0.20.3",
|
|
29
|
-
"tsl": "^1.0.
|
|
29
|
+
"tsl": "^1.0.29",
|
|
30
30
|
"vitest": "^4.0.18",
|
|
31
31
|
"@local/configs": "0.0.0",
|
|
32
32
|
"@local/eff": "0.2.9"
|