flatlint 3.8.0 → 3.10.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
package/README.md
CHANGED
|
@@ -28,6 +28,15 @@ npm i flatlint
|
|
|
28
28
|
|
|
29
29
|
</details>
|
|
30
30
|
|
|
31
|
+
<details><summary>apply import <code>from</code></summary>
|
|
32
|
+
|
|
33
|
+
```diff
|
|
34
|
+
-import fs form 'node:fs';
|
|
35
|
+
+import fs from 'node:fs';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
</details>
|
|
39
|
+
|
|
31
40
|
<details><summary>assignment without parentheses after <code>&&</code></summary>
|
|
32
41
|
|
|
33
42
|
```diff
|
|
@@ -87,6 +96,15 @@ export const rules = [
|
|
|
87
96
|
|
|
88
97
|
</details>
|
|
89
98
|
|
|
99
|
+
<details><summary>convert colon to <code>as</code></summary>
|
|
100
|
+
|
|
101
|
+
```diff
|
|
102
|
+
-import {simpleImport: _simpleImport} from './simple-import.js';
|
|
103
|
+
+import {simpleImport as _simpleImport} from './simple-import.js';
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
</details>
|
|
107
|
+
|
|
90
108
|
<details><summary>convert <code>from</code> to <code>require</code></summary>
|
|
91
109
|
|
|
92
110
|
```diff
|
|
@@ -17,13 +17,13 @@ export const match = () => ({
|
|
|
17
17
|
if (isType && path.isNextCompare('__a ='))
|
|
18
18
|
return false;
|
|
19
19
|
|
|
20
|
-
if (
|
|
20
|
+
if (path.isPrevKeyword())
|
|
21
21
|
return false;
|
|
22
22
|
|
|
23
|
-
if (
|
|
23
|
+
if (!isType && isKeyword(__a))
|
|
24
24
|
return false;
|
|
25
25
|
|
|
26
|
-
if (
|
|
26
|
+
if (path.isNextKeyword())
|
|
27
27
|
return false;
|
|
28
28
|
|
|
29
29
|
if (path.isInsideTemplate())
|
|
@@ -59,4 +59,3 @@ export const replace = () => ({
|
|
|
59
59
|
'"__a"': '"__a",',
|
|
60
60
|
'}': '},',
|
|
61
61
|
});
|
|
62
|
-
|
package/lib/plugins.js
CHANGED
|
@@ -8,6 +8,7 @@ import * as addMissingSemicolon from './plugins/add-missing-semicolon/index.js';
|
|
|
8
8
|
import * as addMissingComma from './plugins/add-missing-comma/index.js';
|
|
9
9
|
import * as addConstToExport from './plugins/add-const-to-export/index.js';
|
|
10
10
|
import * as applyImportOrder from './plugins/apply-import-order/index.js';
|
|
11
|
+
import * as applyImportFrom from './plugins/apply-import-from/index.js';
|
|
11
12
|
import * as convertAssertToWith from './plugins/convert-assert-to-with/index.js';
|
|
12
13
|
import * as convertCommaToSemicolon from './plugins/convert-comma-to-semicolon/index.js';
|
|
13
14
|
import * as convertFromToRequire from './plugins/convert-from-to-require/index.js';
|
|
@@ -18,22 +19,25 @@ import * as removeUselessRoundBrace from './plugins/remove-useless-round-brace/i
|
|
|
18
19
|
import * as convertSemicolonToComma from './plugins/convert-semicolon-to-comma/index.js';
|
|
19
20
|
import * as convertColonToComma from './plugins/convert-colon-to-comma/index.js';
|
|
20
21
|
import * as convertColonToSemicolon from './plugins/convert-colon-to-semicolon/index.js';
|
|
22
|
+
import * as convertColonToAs from './plugins/convert-colon-to-as/index.js';
|
|
21
23
|
import * as wrapAssignmentInParens from './plugins/wrap-assignment-in-parens/index.js';
|
|
22
24
|
|
|
23
25
|
export const plugins = [
|
|
26
|
+
['add-missing-comma', addMissingComma],
|
|
27
|
+
['add-missing-quote', addMissingQuote],
|
|
28
|
+
['add-const-to-export', addConstToExport],
|
|
24
29
|
['add-missing-semicolon', addMissingSemicolon],
|
|
25
30
|
['add-missing-arrow', addMissingArrow],
|
|
26
31
|
['add-missing-assign', addMissingAssign],
|
|
27
32
|
['add-missing-curly-brace', addMissingCurlyBrace],
|
|
28
33
|
['add-missing-round-brace', addMissingRoundBrace],
|
|
29
34
|
['add-missing-squire-brace', addMissingSquireBrace],
|
|
30
|
-
['
|
|
31
|
-
['add-missing-quote', addMissingQuote],
|
|
32
|
-
['add-const-to-export', addConstToExport],
|
|
35
|
+
['apply-import-from', applyImportFrom],
|
|
33
36
|
['apply-import-order', applyImportOrder],
|
|
34
37
|
['convert-assert-to-with', convertAssertToWith],
|
|
35
38
|
['convert-comma-to-semicolon', convertCommaToSemicolon],
|
|
36
39
|
['convert-colon-to-comma', convertColonToComma],
|
|
40
|
+
['convert-colon-to-as', convertColonToAs],
|
|
37
41
|
['convert-colon-to-semicolon', convertColonToSemicolon],
|
|
38
42
|
['convert-semicolon-to-comma', convertSemicolonToComma],
|
|
39
43
|
['convert-from-to-require', convertFromToRequire],
|