flatlint 1.36.0 → 1.38.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
|
@@ -19,7 +19,7 @@ npm i flatlint
|
|
|
19
19
|
|
|
20
20
|
</details>
|
|
21
21
|
|
|
22
|
-
<details><summary>
|
|
22
|
+
<details><summary>convert <code>,</code> to <code>;</code> at the end of statement</summary>
|
|
23
23
|
|
|
24
24
|
```diff
|
|
25
25
|
-const a = 5,
|
|
@@ -36,7 +36,7 @@ function x() {
|
|
|
36
36
|
|
|
37
37
|
</details>
|
|
38
38
|
|
|
39
|
-
<details><summary>
|
|
39
|
+
<details><summary>convert <code>from</code> to <code>require</code></summary>
|
|
40
40
|
|
|
41
41
|
```diff
|
|
42
42
|
-const a = from 'a';
|
|
@@ -125,6 +125,23 @@ function x() {
|
|
|
125
125
|
|
|
126
126
|
</details>
|
|
127
127
|
|
|
128
|
+
<details><summary>remove invalid character</summary>
|
|
129
|
+
|
|
130
|
+
```diff
|
|
131
|
+
-const {¬
|
|
132
|
+
- is,¬
|
|
133
|
+
- isArgsStr,¬
|
|
134
|
+
- isTypeParamsStr,¬
|
|
135
|
+
-} = require('./is');¬
|
|
136
|
+
+const {
|
|
137
|
+
+ is,
|
|
138
|
+
+ isArgsStr,
|
|
139
|
+
+ isTypeParamsStr,
|
|
140
|
+
+} = require('./is');
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
</details>
|
|
144
|
+
|
|
128
145
|
<details><summary>add missing quote</summary>
|
|
129
146
|
|
|
130
147
|
```diff
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
colon,
|
|
3
|
+
isPunctuator,
|
|
4
|
+
quote,
|
|
5
|
+
} from '#types';
|
|
2
6
|
|
|
3
7
|
export const report = () => 'Use semicolon instead of trailing comma';
|
|
4
8
|
export const match = () => ({
|
|
@@ -14,6 +18,7 @@ export const match = () => ({
|
|
|
14
18
|
'var __a = __b': check,
|
|
15
19
|
'let __a,': check,
|
|
16
20
|
'var __a,': check,
|
|
21
|
+
'return __expr,': ({}, path) => !path.isNextPunctuator(quote),
|
|
17
22
|
});
|
|
18
23
|
|
|
19
24
|
export const replace = () => ({
|
package/lib/plugins.js
CHANGED
|
@@ -7,6 +7,7 @@ import * as convertCommaToSemicolon from './plugins/convert-comma-to-semicolon/i
|
|
|
7
7
|
import * as convertFromToRequire from './plugins/convert-from-to-require/index.js';
|
|
8
8
|
import * as removeUselessRoundBrace from './plugins/remove-useless-round-brace/index.js';
|
|
9
9
|
import * as removeUselessComma from './plugins/remove-useless-comma/index.js';
|
|
10
|
+
import * as removeInvalidCharacter from './plugins/remove-invalid-character/index.js';
|
|
10
11
|
import * as addConstToExport from './plugins/add-const-to-export/index.js';
|
|
11
12
|
|
|
12
13
|
export const plugins = [
|
|
@@ -20,4 +21,5 @@ export const plugins = [
|
|
|
20
21
|
['convert-from-to-require', convertFromToRequire],
|
|
21
22
|
['remove-useless-round-brace', removeUselessRoundBrace],
|
|
22
23
|
['remove-useless-comma', removeUselessComma],
|
|
24
|
+
['remove-invalid-character', removeInvalidCharacter],
|
|
23
25
|
];
|