flatlint 1.98.2 → 1.99.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.04, v1.99.0
2
+
3
+ feature:
4
+ - 0e3f738 flatlint: convert-semicolon-to-comma: improve
5
+
1
6
  2025.02.04, v1.98.2
2
7
 
3
8
  feature:
package/README.md CHANGED
@@ -175,6 +175,13 @@ const a = {
175
175
  - b: 'hello';
176
176
  + b: 'hello',
177
177
  }
178
+
179
+ const b = [
180
+ 1,
181
+ - 2;
182
+ + 2,
183
+ 3,
184
+ ]
178
185
  ```
179
186
 
180
187
  </details>
@@ -13,7 +13,7 @@ import {
13
13
  spread,
14
14
  } from '#types';
15
15
 
16
- export const report = () => 'Use semicolon instead of trailing comma';
16
+ export const report = () => `Use ';' instead of ','`;
17
17
  export const match = () => ({
18
18
  '__a(__args),': (vars, path) => {
19
19
  const punctuators = [colon, spread];
@@ -1,8 +1,18 @@
1
- import {isIdentifier} from '#types';
1
+ import {
2
+ closeSquareBrace,
3
+ isIdentifier,
4
+ isPunctuator,
5
+ } from '#types';
2
6
 
3
7
  export const report = () => `Use ',' instead of ';'`;
4
8
 
5
9
  export const match = () => ({
10
+ '__a;': (vars, path) => {
11
+ for (const token of path.getAllNext()) {
12
+ if (isPunctuator(token, closeSquareBrace))
13
+ return true;
14
+ }
15
+ },
6
16
  '__a: __expr;': (vars, path) => {
7
17
  for (const token of path.getAllPrev()) {
8
18
  if (isIdentifier(token, 'interface'))
@@ -15,4 +25,5 @@ export const match = () => ({
15
25
 
16
26
  export const replace = () => ({
17
27
  '__a: __expr;': '__a: __expr,',
28
+ '__a;': '__a,',
18
29
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.98.2",
3
+ "version": "1.99.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",