flatlint 1.53.0 → 1.54.1

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.01.17, v1.54.1
2
+
3
+ feature:
4
+ - d92ec6d flatlint: remove-useless-semicolon: exports
5
+
6
+ 2025.01.16, v1.54.0
7
+
8
+ feature:
9
+ - b48b034 flatlint: add-missing-assing: add
10
+
1
11
  2025.01.16, v1.53.0
2
12
 
3
13
  feature:
package/README.md CHANGED
@@ -66,7 +66,16 @@ const m = {
66
66
  }
67
67
  ```
68
68
 
69
- </details>
69
+ </details>
70
+
71
+ <details><summary>add missing assign</summary>
72
+
73
+ ```diff
74
+ -const a 5;
75
+ +const a = 5;
76
+ ```
77
+
78
+ </details>
70
79
 
71
80
  <details><summary>add missing comma</summary>
72
81
 
@@ -0,0 +1,13 @@
1
+ import {isOneOfKeywords} from '#types';
2
+
3
+ export const report = () => 'Add missing assign';
4
+
5
+ export const match = () => ({
6
+ '__x __a __b': ({__x}) => {
7
+ return isOneOfKeywords(__x, ['const', 'let', 'var']);
8
+ },
9
+ });
10
+
11
+ export const replace = () => ({
12
+ '__x __a __b': '__x __a = __b',
13
+ });
@@ -15,4 +15,5 @@ export const match = () => ({
15
15
 
16
16
  export const replace = () => ({
17
17
  '__a: __expr;': '__a: __expr,',
18
+ 'export;': 'export',
18
19
  });
package/lib/plugins.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as addMissingArrow from './plugins/add-missing-arrow/index.js';
2
+ import * as addMissingAssign from './plugins/add-missing-assign/index.js';
2
3
  import * as addMissingRoundBrace from './plugins/add-missing-round-brace/index.js';
3
4
  import * as addMissingSquireBrace from './plugins/add-missing-square-brace/index.js';
4
5
  import * as addMissingQuote from './plugins/add-missing-quote/index.js';
@@ -7,13 +8,15 @@ import * as addMissingComma from './plugins/add-missing-comma/index.js';
7
8
  import * as addConstToExport from './plugins/add-const-to-export/index.js';
8
9
  import * as convertCommaToSemicolon from './plugins/convert-comma-to-semicolon/index.js';
9
10
  import * as convertFromToRequire from './plugins/convert-from-to-require/index.js';
10
- import * as removeUselessRoundBrace from './plugins/remove-useless-round-brace/index.js';
11
11
  import * as removeUselessComma from './plugins/remove-useless-comma/index.js';
12
12
  import * as removeInvalidCharacter from './plugins/remove-invalid-character/index.js';
13
+ import * as removeUselessRoundBrace from './plugins/remove-useless-round-brace/index.js';
14
+ import * as removeUselessSemicolon from './plugins/remove-useless-semicolon/index.js';
13
15
  import * as wrapAssignmentInParens from './plugins/wrap-assignment-in-parens/index.js';
14
16
 
15
17
  export const plugins = [
16
18
  ['add-missing-arrow', addMissingArrow],
19
+ ['add-missing-assign', addMissingAssign],
17
20
  ['add-missing-round-brace', addMissingRoundBrace],
18
21
  ['add-missing-squire-brace', addMissingSquireBrace],
19
22
  ['add-missing-semicolon', addMissingSemicolon],
@@ -23,6 +26,7 @@ export const plugins = [
23
26
  ['convert-comma-to-semicolon', convertCommaToSemicolon],
24
27
  ['convert-from-to-require', convertFromToRequire],
25
28
  ['remove-useless-round-brace', removeUselessRoundBrace],
29
+ ['remove-useless-semicolon', removeUselessSemicolon],
26
30
  ['remove-useless-comma', removeUselessComma],
27
31
  ['remove-invalid-character', removeInvalidCharacter],
28
32
  ['wrap-assignment-in-parens', wrapAssignmentInParens],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.53.0",
3
+ "version": "1.54.1",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",