flatlint 1.6.0 → 1.7.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 +11 -0
- package/README.md +10 -1
- package/lib/compare/compare.js +0 -1
- package/lib/flatlint.js +1 -1
- package/lib/parser/string-literal.js +1 -1
- package/lib/plugins/add-missing-square-brace/index.js +9 -0
- package/lib/plugins.js +2 -0
- package/lib/runner/replacer.js +4 -4
- package/package.json +11 -2
- /package/lib/parser/{index.js → parser.js} +0 -0
package/ChangeLog
CHANGED
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ npm i flatlint
|
|
|
28
28
|
|
|
29
29
|
</details>
|
|
30
30
|
|
|
31
|
-
<details><summary>
|
|
31
|
+
<details><summary>add missing round braces in if statement</summary>
|
|
32
32
|
|
|
33
33
|
```diff
|
|
34
34
|
-if a > 5 {
|
|
@@ -39,6 +39,15 @@ npm i flatlint
|
|
|
39
39
|
|
|
40
40
|
</details>
|
|
41
41
|
|
|
42
|
+
<details><summary>add missing squire brace</summary>
|
|
43
|
+
|
|
44
|
+
```diff
|
|
45
|
+
-const a = ['hello', 'world';
|
|
46
|
+
+const a = ['hello', 'world'];
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
</details>
|
|
50
|
+
|
|
42
51
|
<details><summary>remove useless round brace</summary>
|
|
43
52
|
|
|
44
53
|
```diff
|
package/lib/compare/compare.js
CHANGED
package/lib/flatlint.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {loadPlugins} from '@putout/engine-loader';
|
|
2
2
|
import {parse} from '#parser';
|
|
3
|
-
import {run} from '
|
|
3
|
+
import {run} from '#runner';
|
|
4
4
|
|
|
5
5
|
export function lint(source, overrides = {}) {
|
|
6
6
|
const {fix = true, plugins: pluginNames = []} = overrides;
|
package/lib/plugins.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as wrapAssignmentInParens from './plugins/wrap-assignment-in-parens/index.js';
|
|
2
2
|
import * as addMissingRoundBraces from './plugins/add-missing-round-braces/index.js';
|
|
3
|
+
import * as addMissingSquireBrace from './plugins/add-missing-square-brace/index.js';
|
|
3
4
|
import * as addMissingQuote from './plugins/add-missing-quote/index.js';
|
|
4
5
|
import * as convertCommaToSemicolon from './plugins/convert-comma-to-semicolon/index.js';
|
|
5
6
|
import * as removeUselessRoundBrace from './plugins/remove-useless-round-brace/index.js';
|
|
@@ -7,6 +8,7 @@ import * as removeUselessRoundBrace from './plugins/remove-useless-round-brace/i
|
|
|
7
8
|
export const plugins = [
|
|
8
9
|
['wrap-assignment-in-parens', wrapAssignmentInParens],
|
|
9
10
|
['add-missing-round-braces', addMissingRoundBraces],
|
|
11
|
+
['add-missing-squire-brace', addMissingSquireBrace],
|
|
10
12
|
['add-missing-quote', addMissingQuote],
|
|
11
13
|
['convert-comma-to-semicolon', convertCommaToSemicolon],
|
|
12
14
|
['remove-useless-round-brace', removeUselessRoundBrace],
|
package/lib/runner/replacer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import {is} from '#types';
|
|
2
|
+
import {prepare} from '#parser';
|
|
3
|
+
import {compare} from '#compare';
|
|
4
|
+
import {traverse} from '#traverser';
|
|
5
5
|
|
|
6
6
|
const {entries} = Object;
|
|
7
7
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flatlint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "JavaScript tokens-based linter",
|
|
5
5
|
"main": "lib/flatlint.js",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,16 @@
|
|
|
15
15
|
"default": "./lib/types/types.js"
|
|
16
16
|
},
|
|
17
17
|
"#parser": {
|
|
18
|
-
"default": "./lib/parser/
|
|
18
|
+
"default": "./lib/parser/parser.js"
|
|
19
|
+
},
|
|
20
|
+
"#traverser": {
|
|
21
|
+
"default": "./lib/traverser/traverser.js"
|
|
22
|
+
},
|
|
23
|
+
"#compare": {
|
|
24
|
+
"default": "./lib/compare/compare.js"
|
|
25
|
+
},
|
|
26
|
+
"#runner": {
|
|
27
|
+
"default": "./lib/runner/runner.js"
|
|
19
28
|
},
|
|
20
29
|
"#flatlint": {
|
|
21
30
|
"default": "./lib/flatlint.js"
|
|
File without changes
|