redlint 3.0.1 → 3.1.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
@@ -1,3 +1,13 @@
1
+ 2023.12.19, v3.1.1
2
+
3
+ fix:
4
+ - e3cda54 help: newline
5
+
6
+ 2023.12.19, v3.1.0
7
+
8
+ feature:
9
+ - 128faa9 redlint: choose
10
+
1
11
  2023.12.18, v3.0.1
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/a7657733-8d11-4f09-8191-4a9576bb45ed)
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
@@ -8,7 +8,7 @@ import formatterCodeFrame from '@putout/formatter-codeframe';
8
8
  import formatterDump from '@putout/formatter-dump';
9
9
  import ora from 'ora';
10
10
  import {help} from '../lib/help.js';
11
- import {start} from '../lib/start.js';
11
+ import {choose} from '../lib/choose.js';
12
12
  import {buildTree} from '../lib/redlint.js';
13
13
  import {convertToSimple} from '../lib/simple.js';
14
14
  import {masterLint} from '../lib/master.js';
@@ -21,7 +21,7 @@ let [arg] = process.argv.slice(2);
21
21
  let header = true;
22
22
 
23
23
  if (!arg) {
24
- const cmd = await start();
24
+ const cmd = await choose();
25
25
 
26
26
  if (!cmd)
27
27
  process.exit(1);
@@ -30,6 +30,9 @@ if (!arg) {
30
30
  header = false;
31
31
  }
32
32
 
33
+ if (arg === 'exit')
34
+ process.exit();
35
+
33
36
  if (arg === 'help') {
34
37
  help({
35
38
  header,
@@ -43,7 +46,7 @@ const result = await buildTree(process.cwd());
43
46
 
44
47
  spinner.succeed();
45
48
 
46
- if (arg === 'simple') {
49
+ if (arg === 'generate:simple') {
47
50
  await writeFile('.filesystem.json', lintJSON(stringify(convertToSimple(result))));
48
51
  process.exit(0);
49
52
  }
@@ -1,18 +1,20 @@
1
1
  import {logo} from './logo.js';
2
2
  import process from 'node:process';
3
- import {choose} from '@putout/cli-choose';
3
+ import {choose as chooseDialog} from '@putout/cli-choose';
4
4
 
5
- export const start = async () => {
5
+ export const choose = async () => {
6
6
  console.log('Lint your files according to 🐊Putout rules.\n');
7
7
  process.stdout.write(logo);
8
8
  console.log('');
9
9
 
10
- const command = await choose('Command:', [
10
+ const command = await chooseDialog('Command:', [
11
11
  'scan',
12
12
  'scan:frame',
13
13
  'fix',
14
14
  'help',
15
15
  'generate',
16
+ 'generate:simple',
17
+ 'exit',
16
18
  ]);
17
19
 
18
20
  console.log('');
package/lib/help.js CHANGED
@@ -11,12 +11,11 @@ export const help = ({header = true}) => {
11
11
  console.log(`Usage: redlint [command]`);
12
12
 
13
13
  console.log(`Commands:
14
- scan - scan files according to 🐊Putout rules
15
- scan:frame - scan files, show results in code frame
16
- fix - fix files according to 🐊Putout rules
17
- help - show help screen and exit
18
- generate - generate .filesystem.json file and exit
14
+ scan - scan files according to 🐊Putout rules
15
+ scan:frame - scan files, show results in code frame
16
+ fix - fix files according to 🐊Putout rules
17
+ help - show help screen and exit
18
+ generate - generate .filesystem.json file and exit
19
+ generate:simple - generate simple .filesystem.json file and exit
19
20
  `);
20
-
21
- console.log('');
22
21
  };
package/lib/master.js CHANGED
@@ -130,8 +130,7 @@ function run(filesystem, {fix, start, end, push, fail, success}) {
130
130
  });
131
131
  worker.on('error', reject);
132
132
  worker.on('exit', (code) => {
133
- if (code)
134
- reject(Error(`Worker stopped with exit code ${code}`));
133
+ reject(Error(`Worker stopped with exit code ${code}`));
135
134
  });
136
135
  });
137
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redlint",
3
- "version": "3.0.1",
3
+ "version": "3.1.1",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Lint Filesystem with 🐊Putout",