flatlint 1.73.0 → 1.75.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 +10 -0
- package/lib/plugins/remove-useless-comma/index.js +4 -0
- package/lib/types/types.js +3 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
isIdentifier,
|
|
5
5
|
isPunctuator,
|
|
6
6
|
openSquireBrace,
|
|
7
|
+
spread,
|
|
7
8
|
} from '#types';
|
|
8
9
|
|
|
9
10
|
export const report = () => 'Remove useless coma';
|
|
@@ -46,6 +47,9 @@ export const match = () => ({
|
|
|
46
47
|
for (const current of path.getAllPrev()) {
|
|
47
48
|
if (isPunctuator(current, colon))
|
|
48
49
|
return false;
|
|
50
|
+
|
|
51
|
+
if (isPunctuator(current, spread))
|
|
52
|
+
return false;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
return true;
|
package/lib/types/types.js
CHANGED
|
@@ -35,6 +35,7 @@ export const isKeyword = (token) => {
|
|
|
35
35
|
'function',
|
|
36
36
|
'var',
|
|
37
37
|
'let',
|
|
38
|
+
'new',
|
|
38
39
|
'else',
|
|
39
40
|
'export',
|
|
40
41
|
'from',
|
|
@@ -150,6 +151,8 @@ export const more = Punctuator('>');
|
|
|
150
151
|
export const assign = Punctuator('=');
|
|
151
152
|
export const openRoundBrace = Punctuator('(');
|
|
152
153
|
export const or = Punctuator('||');
|
|
154
|
+
export const spread = Punctuator('...');
|
|
155
|
+
export const rest = Punctuator('...');
|
|
153
156
|
export const semicolon = Punctuator(';');
|
|
154
157
|
export const openCurlyBrace = Punctuator('{');
|
|
155
158
|
export const closeCurlyBrace = Punctuator('}');
|