flatlint 3.11.0 → 4.0.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,13 @@
1
+ 2025.12.31, v4.0.0
2
+
3
+ feature:
4
+ - 1ddfda9 flatlint: drop support of node < 22
5
+
6
+ 2025.12.31, v3.12.0
7
+
8
+ feature:
9
+ - b9e8870 flatlint: add-missing-if: add
10
+
1
11
  2025.12.31, v3.11.0
2
12
 
3
13
  feature:
package/README.md CHANGED
@@ -348,6 +348,18 @@ const a = class {
348
348
 
349
349
  </details>
350
350
 
351
+ <details><summary>add missing <code>if</code></summary>
352
+
353
+ ```diff
354
+ if (a < 0)
355
+ console.log('hello');
356
+ - else (a > 3)
357
+ + else if (a > 3)
358
+ console.log('world');
359
+ ```
360
+
361
+ </details>
362
+
351
363
  ## Template literals
352
364
 
353
365
  **FlatLint** uses language similar to 🐊[**PutoutScript**](https://github.com/coderaiser/putout/blob/master/docs/putout-script.md#-putoutscript).
@@ -0,0 +1,5 @@
1
+ export const report = () => `Add missing 'if'`;
2
+
3
+ export const replace = () => ({
4
+ 'else (': 'else if (',
5
+ });
@@ -1,4 +1,4 @@
1
- export const report = () => 'Remove useless arrow';
1
+ export const report = () => `Remove useless '=>'`;
2
2
 
3
3
  export const replace = () => ({
4
4
  'function __a(__array) => {': 'function __a(__array) {',
@@ -1,4 +1,4 @@
1
- export const report = () => 'Remove useless assign';
1
+ export const report = () => `Remove useless '='`;
2
2
 
3
3
  export const replace = () => ({
4
4
  'import __a = from "__b"': 'import __a from "__b"',
package/lib/plugins.js CHANGED
@@ -6,6 +6,7 @@ import * as addMissingSquireBrace from './plugins/add-missing-square-brace/index
6
6
  import * as addMissingQuote from './plugins/add-missing-quote/index.js';
7
7
  import * as addMissingSemicolon from './plugins/add-missing-semicolon/index.js';
8
8
  import * as addMissingComma from './plugins/add-missing-comma/index.js';
9
+ import * as addMissingIf from './plugins/add-missing-if/index.js';
9
10
  import * as addConstToExport from './plugins/add-const-to-export/index.js';
10
11
  import * as applyImportOrder from './plugins/apply-import-order/index.js';
11
12
  import * as applyImportFrom from './plugins/apply-import-from/index.js';
@@ -26,6 +27,7 @@ import * as wrapAssignmentInParens from './plugins/wrap-assignment-in-parens/ind
26
27
 
27
28
  export const plugins = [
28
29
  ['add-missing-comma', addMissingComma],
30
+ ['add-missing-if', addMissingIf],
29
31
  ['add-missing-quote', addMissingQuote],
30
32
  ['add-const-to-export', addConstToExport],
31
33
  ['add-missing-semicolon', addMissingSemicolon],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "3.11.0",
3
+ "version": "4.0.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",
@@ -95,7 +95,7 @@
95
95
  "supertape": "^11.0.4"
96
96
  },
97
97
  "engines": {
98
- "node": ">=20"
98
+ "node": ">=22"
99
99
  },
100
100
  "publishConfig": {
101
101
  "access": "public"