flatlint 1.85.0 → 1.86.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,11 @@
1
+ 2025.01.28, v1.86.0
2
+
3
+ fix:
4
+ - f3df7fa flatlint: add-missing-semicolon: exclude: if
5
+
6
+ feature:
7
+ - da300c1 flatlint: add-missing-round-brace: break
8
+
1
9
  2025.01.28, v1.85.0
2
10
 
3
11
  feature:
@@ -16,6 +16,9 @@ export const match = () => ({
16
16
 
17
17
  return !path.isNextPunctuator(closeRoundBrace);
18
18
  },
19
+ 'if (__a(__args)': (vars, path) => {
20
+ return path.isNextKeyword();
21
+ },
19
22
  });
20
23
 
21
24
  export const replace = () => ({
@@ -23,4 +26,5 @@ export const replace = () => ({
23
26
  '__a(__args': '__a(__args)',
24
27
  'if (__a.__b(__args) {': 'if (__a.__b(__args)) {',
25
28
  'if (__a(__args) {': 'if (__a(__args)) {',
29
+ 'if (__a(__args)': 'if (__a(__args))',
26
30
  });
@@ -7,6 +7,7 @@ import {
7
7
  question,
8
8
  closeCurlyBrace,
9
9
  isOnlyWhitespaces,
10
+ isKeyword,
10
11
  } from '#types';
11
12
 
12
13
  export const report = () => 'Add missing semicolon';
@@ -35,6 +36,11 @@ export const match = () => ({
35
36
  if (path.isInsideTemplate())
36
37
  return false;
37
38
 
39
+ for (const current of path.getAllPrev()) {
40
+ if (isKeyword(current, 'if'))
41
+ return false;
42
+ }
43
+
38
44
  return !path.isPrevIdentifier('function');
39
45
  },
40
46
  '})': (vars, path) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.85.0",
3
+ "version": "1.86.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",