flatlint 3.9.0 → 3.10.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
package/README.md
CHANGED
|
@@ -96,6 +96,15 @@ export const rules = [
|
|
|
96
96
|
|
|
97
97
|
</details>
|
|
98
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
|
+
|
|
99
108
|
<details><summary>convert <code>from</code> to <code>require</code></summary>
|
|
100
109
|
|
|
101
110
|
```diff
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
isDeclarationKeyword,
|
|
4
4
|
isKeyword,
|
|
5
5
|
isPunctuator,
|
|
6
|
+
question,
|
|
6
7
|
semicolon,
|
|
7
8
|
} from '#types';
|
|
8
9
|
|
|
@@ -24,7 +25,10 @@ export const match = () => ({
|
|
|
24
25
|
if (path.isNextPunctuator() && !path.isNextPunctuator(semicolon))
|
|
25
26
|
return false;
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
if (isPunctuator(assign, __expr))
|
|
29
|
+
return false;
|
|
30
|
+
|
|
31
|
+
return !isPunctuator(question, __expr);
|
|
28
32
|
},
|
|
29
33
|
});
|
|
30
34
|
|
package/lib/plugins.js
CHANGED
|
@@ -19,6 +19,7 @@ import * as removeUselessRoundBrace from './plugins/remove-useless-round-brace/i
|
|
|
19
19
|
import * as convertSemicolonToComma from './plugins/convert-semicolon-to-comma/index.js';
|
|
20
20
|
import * as convertColonToComma from './plugins/convert-colon-to-comma/index.js';
|
|
21
21
|
import * as convertColonToSemicolon from './plugins/convert-colon-to-semicolon/index.js';
|
|
22
|
+
import * as convertColonToAs from './plugins/convert-colon-to-as/index.js';
|
|
22
23
|
import * as wrapAssignmentInParens from './plugins/wrap-assignment-in-parens/index.js';
|
|
23
24
|
|
|
24
25
|
export const plugins = [
|
|
@@ -36,6 +37,7 @@ export const plugins = [
|
|
|
36
37
|
['convert-assert-to-with', convertAssertToWith],
|
|
37
38
|
['convert-comma-to-semicolon', convertCommaToSemicolon],
|
|
38
39
|
['convert-colon-to-comma', convertColonToComma],
|
|
40
|
+
['convert-colon-to-as', convertColonToAs],
|
|
39
41
|
['convert-colon-to-semicolon', convertColonToSemicolon],
|
|
40
42
|
['convert-semicolon-to-comma', convertSemicolonToComma],
|
|
41
43
|
['convert-from-to-require', convertFromToRequire],
|