flatlint 5.4.1 → 5.5.0
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/ChangeLog
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
closeCurlyBrace,
|
|
3
|
+
closeSquareBrace,
|
|
3
4
|
isPunctuator,
|
|
4
5
|
} from '#types';
|
|
5
6
|
|
|
@@ -7,8 +8,12 @@ export const report = () => 'Add missing square brace';
|
|
|
7
8
|
|
|
8
9
|
export const match = () => ({
|
|
9
10
|
'["__a"': (vars, path) => !path.isNext(),
|
|
10
|
-
'[__array;': ({__array}) => {
|
|
11
|
+
'[__array;': ({__array}, path) => {
|
|
11
12
|
const last = __array.at(-1);
|
|
13
|
+
|
|
14
|
+
if (path.isNextPunctuator(closeSquareBrace))
|
|
15
|
+
return false;
|
|
16
|
+
|
|
12
17
|
return !isPunctuator(last, closeCurlyBrace);
|
|
13
18
|
},
|
|
14
19
|
});
|
|
@@ -99,6 +99,9 @@ export const match = () => ({
|
|
|
99
99
|
return path.isNextPunctuator(closeCurlyBrace);
|
|
100
100
|
},
|
|
101
101
|
'";': (vars, path) => {
|
|
102
|
+
if (path.isNextPunctuator(closeSquareBrace))
|
|
103
|
+
return true;
|
|
104
|
+
|
|
102
105
|
return path.isNextPunctuator(quote);
|
|
103
106
|
},
|
|
104
107
|
';': (vars, path) => {
|