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 CHANGED
@@ -1,3 +1,13 @@
1
+ 2023.12.19, v3.1.2
2
+
3
+ feature:
4
+ - c69f50f version: add
5
+
6
+ 2023.12.19, v3.1.1
7
+
8
+ fix:
9
+ - e3cda54 help: newline
10
+
1
11
  2023.12.19, v3.1.0
2
12
 
3
13
  feature:
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  >
14
14
  > **(c) The Book of Kon, PoKon and ZaKon**
15
15
 
16
- ![image](https://github.com/putoutjs/redlint/assets/1573141/ec0efee1-0bfc-4595-ba85-aaaabe274a34)
16
+ ![image](https://github.com/putoutjs/redlint/assets/1573141/a34a7e75-b30f-4e79-b132-1d411d96ba15)
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
+ ![image](https://github.com/putoutjs/redlint/assets/1573141/1d3c26a6-14f2-43f9-8115-29b28d5d5f26)
35
+
30
36
  ## Scan
31
37
 
32
38
  To scan your files use `redlint scan`:
33
39
 
34
- ![image](https://github.com/putoutjs/redlint/assets/1573141/c17de523-66ea-49a1-b65d-4872ff1ecb37)
40
+ ![image](https://github.com/putoutjs/redlint/assets/1573141/4407e58b-8c99-4bb3-9f0a-751ae3a0f0ce)
35
41
 
36
- ## Scan
42
+ ## Fix
37
43
 
38
44
  To fix your files use `redlint fix`:
39
45
 
40
- ![image](https://github.com/putoutjs/redlint/assets/1573141/5ce7a8de-b5c1-44b7-8302-918b9e58b185)
46
+ ![image](https://github.com/putoutjs/redlint/assets/1573141/dc94146b-2a68-4547-80c9-a874f98c3a2a)
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 {writeFile} from 'node:fs/promises';
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
@@ -11,9 +11,10 @@ export const choose = async () => {
11
11
  'scan',
12
12
  'scan:frame',
13
13
  'fix',
14
- 'help',
15
14
  'generate',
16
15
  'generate:simple',
16
+ 'help',
17
+ 'version',
17
18
  'exit',
18
19
  ]);
19
20
 
package/lib/help.js CHANGED
@@ -18,6 +18,4 @@ export const help = ({header = true}) => {
18
18
  generate - generate .filesystem.json file and exit
19
19
  generate:simple - generate simple .filesystem.json file and exit
20
20
  `);
21
-
22
- console.log('');
23
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redlint",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Lint Filesystem with 🐊Putout",