@blumintinc/eslint-plugin-blumint 0.1.8 → 0.1.10
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/lib/index.js +1 -1
- package/lib/utils/ASTHelpers.js +15 -1
- package/package.json +1 -1
- package/scripts/make-docs.sh +0 -21
package/lib/index.js
CHANGED
package/lib/utils/ASTHelpers.js
CHANGED
|
@@ -15,6 +15,16 @@ class ASTHelpers {
|
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
17
|
switch (node.type) {
|
|
18
|
+
case 'TSNonNullExpression':
|
|
19
|
+
return this.declarationIncludesIdentifier(node.expression);
|
|
20
|
+
case 'ArrayPattern':
|
|
21
|
+
return node.elements.some((element) => ASTHelpers.declarationIncludesIdentifier(element));
|
|
22
|
+
case 'ObjectPattern':
|
|
23
|
+
return node.properties.some((property) => this.declarationIncludesIdentifier(property.value || null));
|
|
24
|
+
case 'AssignmentPattern':
|
|
25
|
+
return this.declarationIncludesIdentifier(node.left);
|
|
26
|
+
case 'RestElement':
|
|
27
|
+
return this.declarationIncludesIdentifier(node.argument);
|
|
18
28
|
case 'AwaitExpression':
|
|
19
29
|
return this.declarationIncludesIdentifier(node.argument);
|
|
20
30
|
case 'AssignmentExpression':
|
|
@@ -60,7 +70,11 @@ class ASTHelpers {
|
|
|
60
70
|
case 'UpdateExpression':
|
|
61
71
|
return this.declarationIncludesIdentifier(node.argument);
|
|
62
72
|
case 'MemberExpression':
|
|
63
|
-
|
|
73
|
+
if (node.object.type === 'ThisExpression') {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
return (this.declarationIncludesIdentifier(node.object) ||
|
|
77
|
+
this.declarationIncludesIdentifier(node.property));
|
|
64
78
|
case 'CallExpression':
|
|
65
79
|
case 'NewExpression':
|
|
66
80
|
// For function and constructor calls, we care about both the callee and the arguments.
|
package/package.json
CHANGED
package/scripts/make-docs.sh
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Set the directories relative to the script location
|
|
4
|
-
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
5
|
-
SRC_DIR="$SCRIPT_DIR/../src/rules"
|
|
6
|
-
DOCS_DIR="$SCRIPT_DIR/../docs/rules"
|
|
7
|
-
|
|
8
|
-
# Create docs/rules directory if it doesn't exist
|
|
9
|
-
mkdir -p "$DOCS_DIR"
|
|
10
|
-
|
|
11
|
-
# Iterate over every file in src/rules
|
|
12
|
-
for SRC_FILE in $SRC_DIR/*; do
|
|
13
|
-
# Extract the filename without the extension
|
|
14
|
-
FILENAME=$(basename -- "$SRC_FILE")
|
|
15
|
-
FILENAME="${FILENAME%.*}"
|
|
16
|
-
|
|
17
|
-
# Create a corresponding .md file in docs/rules
|
|
18
|
-
touch "$DOCS_DIR/$FILENAME.md"
|
|
19
|
-
done
|
|
20
|
-
|
|
21
|
-
echo "Markdown files have been created in $DOCS_DIR."
|