redlint 3.1.0 β 3.1.2
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 +10 -0
- package/README.md +10 -4
- package/bin/redlint.js +14 -2
- package/lib/choose.js +2 -1
- package/lib/help.js +0 -2
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
>
|
|
14
14
|
> **(c) The Book of Kon, PoKon and ZaKon**
|
|
15
15
|
|
|
16
|
-

|
|
17
17
|
|
|
18
18
|
What if **Filesystem** was a simple **JSON** file [`.filesystem.json`](https://github.com/putoutjs/redlint/blob/master/.filesystem.json). What if you can transform **JSON** file with π[**Putout**](https://github.com/coderaiser/putout) code transformer and this changes modify **Filesystem**?
|
|
19
19
|
|
|
@@ -27,17 +27,23 @@ First time ever! Linter for you **Filesystem** ππΎ.
|
|
|
27
27
|
npm i redlint -g
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
## Choose
|
|
31
|
+
|
|
32
|
+
You can choose interactively when run `redlint`:
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
30
36
|
## Scan
|
|
31
37
|
|
|
32
38
|
To scan your files use `redlint scan`:
|
|
33
39
|
|
|
34
|
-

|
|
35
41
|
|
|
36
|
-
##
|
|
42
|
+
## Fix
|
|
37
43
|
|
|
38
44
|
To fix your files use `redlint fix`:
|
|
39
45
|
|
|
40
|
-

|
|
41
47
|
|
|
42
48
|
## Generate
|
|
43
49
|
|
package/bin/redlint.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import {lintJSON} from 'putout/lint/json';
|
|
4
4
|
import process from 'node:process';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
readFile,
|
|
7
|
+
writeFile,
|
|
8
|
+
} from 'node:fs/promises';
|
|
6
9
|
import stripAnsi from 'strip-ansi';
|
|
7
10
|
import formatterCodeFrame from '@putout/formatter-codeframe';
|
|
8
11
|
import formatterDump from '@putout/formatter-dump';
|
|
@@ -15,7 +18,7 @@ import {masterLint} from '../lib/master.js';
|
|
|
15
18
|
import {lint} from '../lib/lint.js';
|
|
16
19
|
import {logo} from '../lib/logo.js';
|
|
17
20
|
|
|
18
|
-
const {stringify} = JSON;
|
|
21
|
+
const {stringify, parse} = JSON;
|
|
19
22
|
|
|
20
23
|
let [arg] = process.argv.slice(2);
|
|
21
24
|
let header = true;
|
|
@@ -33,6 +36,15 @@ if (!arg) {
|
|
|
33
36
|
if (arg === 'exit')
|
|
34
37
|
process.exit();
|
|
35
38
|
|
|
39
|
+
if (arg === 'version') {
|
|
40
|
+
const packagePath = new URL('../package.json', import.meta.url);
|
|
41
|
+
const packageData = await readFile(packagePath);
|
|
42
|
+
const {version} = parse(packageData);
|
|
43
|
+
|
|
44
|
+
console.log(`v${version}`);
|
|
45
|
+
process.exit();
|
|
46
|
+
}
|
|
47
|
+
|
|
36
48
|
if (arg === 'help') {
|
|
37
49
|
help({
|
|
38
50
|
header,
|
package/lib/choose.js
CHANGED
package/lib/help.js
CHANGED