flatlint 1.2.1 → 1.3.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.29, v1.3.0
2
+
3
+ feature:
4
+ - 6f65833 flatlint: remove-useless-round-brace: add
5
+
1
6
  2024.12.29, v1.2.1
2
7
 
3
8
  feature:
package/README.md CHANGED
@@ -28,17 +28,26 @@ npm i flatlint
28
28
 
29
29
  </details>
30
30
 
31
- <details><summary>forgotten round braces in if statement</summary
31
+ <details><summary>forgotten round braces in if statement</summary>
32
32
 
33
- ```diff¬
33
+ ```diff
34
34
  -if a > 5 {
35
35
  +if (a > 5) {
36
- alert();
36
+ alert();
37
37
  }
38
38
  ```
39
39
 
40
40
  </details>
41
41
 
42
+ <details><summary>remove useless round brace</summary>
43
+
44
+ ```diff
45
+ -const a = 5);
46
+ +const a = 5;
47
+ ```
48
+
49
+ </details>
50
+
42
51
  ## API
43
52
 
44
53
  ```js
@@ -0,0 +1,9 @@
1
+ export function report() {
2
+ return 'Remove useless round brace';
3
+ }
4
+
5
+ export function replace() {
6
+ return {
7
+ 'const __a = __b)': 'const __a = __b',
8
+ };
9
+ }
package/lib/plugins.js CHANGED
@@ -1,9 +1,11 @@
1
1
  import * as wrapAssignmentInParens from './plugins/wrap-assignment-in-parens/index.js';
2
2
  import * as addMissingRoundBraces from './plugins/add-missing-round-braces/index.js';
3
3
  import * as convertCommaToSemicolon from './plugins/convert-comma-to-semicolon/index.js';
4
+ import * as removeUselessRoundBrace from './plugins/remove-useless-round-brace/index.js';
4
5
 
5
6
  export const plugins = [
6
7
  ['wrap-assignment-in-parens', wrapAssignmentInParens],
7
8
  ['add-missing-round-braces', addMissingRoundBraces],
8
9
  ['convert-comma-to-semicolon', convertCommaToSemicolon],
10
+ ['remove-useless-round-brace', removeUselessRoundBrace],
9
11
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",