lint-rules-alvin 1.1.1 → 1.1.3
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.
|
@@ -58,6 +58,7 @@ export const maxChainPerLineRule = {
|
|
|
58
58
|
if (
|
|
59
59
|
(parent.type === 'MemberExpression' && parent.object === outermostNode)
|
|
60
60
|
|| (parent.type === 'CallExpression' && parent.callee === outermostNode)
|
|
61
|
+
|| (parent.type === 'TSNonNullExpression' && parent.expression === outermostNode)
|
|
61
62
|
) {
|
|
62
63
|
|
|
63
64
|
outermostNode = parent;
|
|
@@ -86,7 +87,11 @@ export const maxChainPerLineRule = {
|
|
|
86
87
|
const links = [];
|
|
87
88
|
let currentNode = node;
|
|
88
89
|
|
|
89
|
-
while (
|
|
90
|
+
while (
|
|
91
|
+
currentNode.type === 'MemberExpression'
|
|
92
|
+
|| currentNode.type === 'CallExpression'
|
|
93
|
+
|| currentNode.type === 'TSNonNullExpression'
|
|
94
|
+
) {
|
|
90
95
|
|
|
91
96
|
if (currentNode.type === 'CallExpression') {
|
|
92
97
|
|
|
@@ -94,6 +99,12 @@ export const maxChainPerLineRule = {
|
|
|
94
99
|
currentNode = currentNode.callee;
|
|
95
100
|
continue;
|
|
96
101
|
|
|
102
|
+
} else if (currentNode.type === 'TSNonNullExpression') {
|
|
103
|
+
|
|
104
|
+
// A non-null assertion is part of the preceding link, so we just traverse through it.
|
|
105
|
+
currentNode = currentNode.expression;
|
|
106
|
+
continue;
|
|
107
|
+
|
|
97
108
|
}
|
|
98
109
|
|
|
99
110
|
// We have a MemberExpression.
|
|
@@ -27,7 +27,8 @@ export const astroReact = defineConfig(
|
|
|
27
27
|
files: [ '**/*.astro' ],
|
|
28
28
|
rules: {
|
|
29
29
|
'@stylistic/jsx-one-expression-per-line': 'off',
|
|
30
|
-
'@stylistic/jsx-curly-brace-presence': 'off'
|
|
30
|
+
'@stylistic/jsx-curly-brace-presence': 'off',
|
|
31
|
+
'import-x/unambiguous': 'off'
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
);
|
|
@@ -33,7 +33,8 @@ export const astroReactTs = defineConfig(
|
|
|
33
33
|
files: [ '**/*.astro' ],
|
|
34
34
|
rules: {
|
|
35
35
|
'@stylistic/jsx-one-expression-per-line': 'off',
|
|
36
|
-
'@stylistic/jsx-curly-brace-presence': 'off'
|
|
36
|
+
'@stylistic/jsx-curly-brace-presence': 'off',
|
|
37
|
+
'import-x/unambiguous': 'off'
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
);
|
package/package.json
CHANGED