flatlint 1.62.0 → 1.63.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,8 @@
1
+ 2025.01.19, v1.63.0
2
+
3
+ feature:
4
+ - 7131929 flatlint: add-missing-round-brace: no args
5
+
1
6
  2025.01.19, v1.62.0
2
7
 
3
8
  feature:
@@ -2,18 +2,27 @@ import {
2
2
  closeCurlyBrace,
3
3
  closeRoundBrace,
4
4
  isNewLine,
5
+ isOneOfPunctuators,
5
6
  NOT_OK,
6
7
  OK,
7
8
  openCurlyBrace,
8
9
  openRoundBrace,
10
+ semicolon,
9
11
  } from '#types';
10
12
  import {equal} from './equal.js';
11
13
 
14
+ const NOT_OK_PUNCTUATORS = [
15
+ semicolon,
16
+ closeRoundBrace,
17
+ ];
18
+
12
19
  export const collectArgs = ({currentTokenIndex, tokens}) => {
13
- const n = tokens.length;
14
20
  let index = currentTokenIndex;
15
21
 
16
- if (equal(tokens[index], closeRoundBrace))
22
+ const n = tokens.length;
23
+ const currentToken = tokens[index];
24
+
25
+ if (isOneOfPunctuators(currentToken, NOT_OK_PUNCTUATORS))
17
26
  return [NOT_OK];
18
27
 
19
28
  let curlyBracesBalance = 0;
@@ -52,6 +52,15 @@ export const isKeyword = (token) => {
52
52
  return false;
53
53
  };
54
54
 
55
+ export const isOneOfPunctuators = (token, punctuators) => {
56
+ for (const punctuator of punctuators) {
57
+ if (isPunctuator(token, punctuator))
58
+ return true;
59
+ }
60
+
61
+ return false;
62
+ };
63
+
55
64
  export const isOneOfKeywords = (token, keywords) => {
56
65
  for (const keyword of keywords) {
57
66
  if (isIdentifier(token, keyword))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.62.0",
3
+ "version": "1.63.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",