flatlint 1.71.0 → 1.73.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,3 +1,13 @@
1
+ 2025.01.22, v1.73.0
2
+
3
+ feature:
4
+ - e6555ef flatlint: add-missing-comma: exclude throw
5
+
6
+ 2025.01.22, v1.72.0
7
+
8
+ feature:
9
+ - 6cab396 remove-useless-comma: object
10
+
1
11
  2025.01.22, v1.71.0
2
12
 
3
13
  feature:
@@ -2,7 +2,6 @@ import {
2
2
  assign,
3
3
  isOneOfKeywords,
4
4
  isOneOfPunctuators,
5
- openCurlyBrace,
6
5
  semicolon,
7
6
  } from '#types';
8
7
 
@@ -39,11 +39,22 @@ export const match = () => ({
39
39
 
40
40
  return !path.isNext();
41
41
  },
42
+ '__a(__args),': (vars, path) => {
43
+ if (!path.isNext())
44
+ return true;
45
+
46
+ for (const current of path.getAllPrev()) {
47
+ if (isPunctuator(current, colon))
48
+ return false;
49
+ }
50
+
51
+ return true;
52
+ },
42
53
  });
43
54
 
44
55
  export const replace = () => ({
45
56
  '__a(__args) {},': '__a(__args) {}',
46
- '__a(),': '__a()',
57
+ '__a(__args),': '__a(__args)',
47
58
  '},': '}',
48
59
  '}),': '})',
49
60
  });
@@ -32,6 +32,7 @@ export const isKeyword = (token) => {
32
32
  'const',
33
33
  'continue',
34
34
  'for',
35
+ 'function',
35
36
  'var',
36
37
  'let',
37
38
  'else',
@@ -39,7 +40,7 @@ export const isKeyword = (token) => {
39
40
  'from',
40
41
  'import',
41
42
  'return',
42
- 'function',
43
+ 'throw',
43
44
  'of',
44
45
  'if',
45
46
  'yield',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.71.0",
3
+ "version": "1.73.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",