flatlint 2.7.0 → 2.9.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.03.14, v2.9.0
2
+
3
+ feature:
4
+ - 4313bf9 flatlint: convert-semicolon-to-comma: exclude keywords
5
+
6
+ 2025.03.14, v2.8.0
7
+
8
+ feature:
9
+ - 1142f23 add-missing-arrow: improve
10
+
1
11
  2025.03.14, v2.7.0
2
12
 
3
13
  feature:
@@ -46,6 +46,8 @@ export const compare = (source, template, {index = 0} = {}) => {
46
46
  nextTemplateToken: templateTokens[templateIndex + 1],
47
47
  });
48
48
 
49
+ delta = 0;
50
+
49
51
  if (!ok) {
50
52
  ++skip;
51
53
  } else if (templateIndex === templateTokensLength - 1) {
@@ -58,4 +58,3 @@ export function parseStringLiteral({i, token, tokens}) {
58
58
 
59
59
  return i;
60
60
  }
61
-
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  colon,
3
3
  isIdentifier,
4
- isKeyword,
5
4
  isOneOfKeywords,
6
5
  isPunctuator,
7
6
  openCurlyBrace,
@@ -19,11 +18,6 @@ export const match = () => ({
19
18
  if (isIdentifier(current))
20
19
  return false;
21
20
 
22
- for (const token of path.getAllPrev()) {
23
- if (isKeyword(token, 'class'))
24
- return false;
25
- }
26
-
27
21
  if (isPunctuator(current, colon))
28
22
  return true;
29
23
 
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  closeSquareBrace,
3
3
  colon,
4
+ isKeyword,
4
5
  isOneOfKeywords,
5
6
  isPunctuator,
6
7
  } from '#types';
@@ -18,7 +19,10 @@ const keywords = [
18
19
  export const report = () => `Use ',' instead of ';'`;
19
20
 
20
21
  export const match = () => ({
21
- '__a;': (vars, path) => {
22
+ '__a;': ({__a}, path) => {
23
+ if (isKeyword(__a))
24
+ return false;
25
+
22
26
  if (path.isNextKeyword())
23
27
  return false;
24
28
 
@@ -74,3 +78,4 @@ export const replace = () => ({
74
78
  ');': '),',
75
79
  '__a];': '__a],',
76
80
  });
81
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",