flatlint 1.102.0 → 1.103.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.02.05, v1.103.0
2
+
3
+ feature:
4
+ - a6d96c8 flatlint: convert-semicolon-to-comma: typings
5
+
1
6
  2025.02.05, v1.102.0
2
7
 
3
8
  feature:
@@ -1,21 +1,29 @@
1
1
  import {
2
2
  closeSquareBrace,
3
3
  isIdentifier,
4
+ isOneOfKeywords,
5
+ isOneOfPunctuators,
4
6
  isPunctuator,
7
+ more,
5
8
  } from '#types';
6
9
 
7
10
  export const report = () => `Use ',' instead of ';'`;
8
11
 
9
12
  export const match = () => ({
10
13
  '__a;': (vars, path) => {
14
+ for (const token of path.getAllPrev()) {
15
+ if (isOneOfKeywords(token, ['readonly', 'static', 'implements']))
16
+ return false;
17
+ }
18
+
11
19
  for (const token of path.getAllNext()) {
12
20
  if (isPunctuator(token, closeSquareBrace))
13
21
  return true;
14
22
  }
15
23
  },
16
- '__a: __expr;': (vars, path) => {
24
+ '__a: __expr;': ({__expr}, path) => {
17
25
  for (const token of path.getAllPrev()) {
18
- if (isIdentifier(token, 'interface'))
26
+ if (isOneOfKeywords(token, ['readonly', 'static', 'implements']))
19
27
  return false;
20
28
  }
21
29
 
@@ -145,9 +145,11 @@ export const comma = Punctuator(',');
145
145
  export const dot = Punctuator('.');
146
146
  export const question = Punctuator('?');
147
147
  export const more = Punctuator('>');
148
+ export const less = Punctuator('<');
148
149
  export const assign = Punctuator('=');
149
150
  export const openRoundBrace = Punctuator('(');
150
151
  export const or = Punctuator('||');
152
+ export const binaryOr = Punctuator('|');
151
153
  export const spread = Punctuator('...');
152
154
  export const rest = Punctuator('...');
153
155
  export const semicolon = Punctuator(';');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.102.0",
3
+ "version": "1.103.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",