flatlint 1.0.2 → 1.1.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
+ 2024.12.28, v1.1.0
2
+
3
+ feature:
4
+ - 8a7c88c flatlint: convert-comma-to-semicolon
5
+
1
6
  2024.12.28, v1.0.2
2
7
 
3
8
  fix:
package/README.md CHANGED
@@ -8,6 +8,26 @@ Token-based JavaScript linter that fixes Syntax Errors
8
8
  npm i flatlint
9
9
  ```
10
10
 
11
+ ## Available fixes
12
+
13
+ <details><summary>Assignment without parentheses after <code>&&</code></summary>
14
+
15
+ ```diff
16
+ -a && b = c;
17
+ +a && (b = c);
18
+ ```
19
+
20
+ </details>
21
+
22
+ <details><summary>Convert <code>,</code> to <code>;</code> at the end of statement</summary>
23
+
24
+ ```diff
25
+ -const a = 5,
26
+ +const a = 5;
27
+ ```
28
+
29
+ </details>
30
+
11
31
  ## API
12
32
 
13
33
  ```js
@@ -0,0 +1,10 @@
1
+ export function report() {
2
+ return 'Use semicolon instead of trailing comma';
3
+ }
4
+
5
+ export function replace() {
6
+ return {
7
+ 'const __a = __b,': 'const __a = __b;',
8
+ };
9
+ }
10
+
@@ -1,9 +1,9 @@
1
+ export function report() {
2
+ return `Wrap the assignment in parentheses after '&&'`;
3
+ }
4
+
1
5
  export function replace() {
2
6
  return {
3
7
  '__a && __b = __c': '__a && (__b = __c)',
4
8
  };
5
9
  }
6
-
7
- export function report() {
8
- return `Wrap the assignment in parentheses after '&&'`;
9
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",
@@ -76,6 +76,7 @@
76
76
  "yargs-parser": "^21.0.0"
77
77
  },
78
78
  "devDependencies": {
79
+ "@putout/eslint-flat": "^2.0.0",
79
80
  "@putout/formatter-json": "^2.0.0",
80
81
  "@putout/test": "^11.1.0",
81
82
  "c8": "^10.1.2",