flatlint 1.56.0 → 1.57.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.18, v1.57.0
2
+
3
+ feature:
4
+ - 93b8c50 flatlint: convert-comma-to-semicolon: module
5
+
1
6
  2025.01.17, v1.56.0
2
7
 
3
8
  feature:
package/README.md CHANGED
@@ -19,7 +19,7 @@ npm i flatlint
19
19
 
20
20
  </details>
21
21
 
22
- <details><summary>convert <code>,</code> to <code>;</code> at the end of statement</summary>
22
+ <details><summary>convert comma to semicolon</summary>
23
23
 
24
24
  ```diff
25
25
  -const a = 5,
@@ -32,6 +32,10 @@ function x() {
32
32
 
33
33
  -import a from 'a',
34
34
  +import a from 'a';
35
+
36
+ -const a = 3,
37
+ +const a = 3;
38
+ module.exports = 2;
35
39
  ```
36
40
 
37
41
  </details>
@@ -1,16 +1,9 @@
1
- import {
2
- arrow,
3
- closeCurlyBrace,
4
- closeRoundBrace,
5
- isPunctuator,
6
- openCurlyBrace,
7
- openRoundBrace,
8
- } from '#types';
1
+ import {closeRoundBrace} from '#types';
9
2
 
10
3
  export const report = () => 'Add missing round brace';
11
4
 
12
5
  export const match = () => ({
13
- '__a(__args': ({__args}, path) => {
6
+ '__a(__args': (vars, path) => {
14
7
  if (path.isCurrentPunctuator(closeRoundBrace))
15
8
  return false;
16
9
 
@@ -24,4 +17,3 @@ export const replace = () => ({
24
17
  'if (__a.__b(__args) {': 'if (__a.__b(__args)) {',
25
18
  'if (__a(__args) {': 'if (__a(__args)) {',
26
19
  });
27
-
@@ -50,5 +50,8 @@ const check = ({__x}, path) => {
50
50
  if (!path.isNext())
51
51
  return true;
52
52
 
53
+ if (path.isNextIdentifier('module'))
54
+ return true;
55
+
53
56
  return path.isNextKeyword();
54
57
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.56.0",
3
+ "version": "1.57.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",