redlint 1.0.3 β 1.0.5
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 +4 -0
- package/bin/redlint.js +2 -0
- package/lib/redlint.js +16 -6
- package/package.json +4 -1
package/ChangeLog
CHANGED
package/README.md
CHANGED
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
[CoverageURL]: https://coveralls.io/github/putoutjs/printer?branch=master
|
|
10
10
|
[CoverageIMGURL]: https://coveralls.io/repos/putoutjs/printer/badge.svg?branch=master&service=github
|
|
11
11
|
|
|
12
|
+
> **Karna is the goddess of retribution, a strict and fair Judge in whose hands is the Book of Fates. In this book she records all the deeds and actions of people. Karna works together with the goddess Makosh. Makosh weaves the destinies of people in accordance with the records of the goddess Karna.**
|
|
13
|
+
>
|
|
14
|
+
> **(c) The Book of Kon, PoKon and ZaKon**
|
|
15
|
+
|
|
12
16
|
Lint Filesystem with π[**Putout**](https://github.com/coderaiser/putout). Creates [`.filesystem.json`](https://github.com/putoutjs/redlint/blob/master/.filesystem.json) file for further lint.
|
|
13
17
|
|
|
14
18
|
Checkout in π[**Putout Editor**](https://putout.cloudcmd.io/#/gist/0614c2da35a1864b59ac284f18656328/695a9960c401d4e8f6744f58eac591d8f9185235).
|
package/bin/redlint.js
CHANGED
package/lib/redlint.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import ignore from 'ignore';
|
|
2
|
-
import
|
|
3
|
-
import {opendir} from 'node:fs/promises';
|
|
2
|
+
import parseOptionsOriginal from 'putout/parse-options';
|
|
3
|
+
import {opendir as opendirOriginal} from 'node:fs/promises';
|
|
4
4
|
|
|
5
5
|
const resolveName = (name, cwd) => name.replace(`${cwd}/`, '');
|
|
6
6
|
|
|
7
|
-
export const buildTree = async (cwd) => {
|
|
7
|
+
export const buildTree = async (cwd, {parseOptions = parseOptionsOriginal, opendir = opendirOriginal} = {}) => {
|
|
8
8
|
const options = parseOptions();
|
|
9
9
|
const ig = ignore().add(options.ignore.filter(isExcluded));
|
|
10
10
|
|
|
11
11
|
return {
|
|
12
12
|
type: 'directory',
|
|
13
13
|
filename: cwd,
|
|
14
|
-
files: await walk(
|
|
14
|
+
files: await walk({
|
|
15
|
+
cwd,
|
|
16
|
+
dir: cwd,
|
|
17
|
+
ignore: ig,
|
|
18
|
+
opendir,
|
|
19
|
+
}),
|
|
15
20
|
};
|
|
16
21
|
};
|
|
17
22
|
|
|
18
|
-
async function walk(cwd, dir, ignore, files = []) {
|
|
23
|
+
async function walk({cwd, dir, ignore, files = [], opendir}) {
|
|
19
24
|
for await (const dirent of await opendir(dir)) {
|
|
20
25
|
const {path, name} = dirent;
|
|
21
26
|
const filename = `${path}/${name}`;
|
|
@@ -28,7 +33,12 @@ async function walk(cwd, dir, ignore, files = []) {
|
|
|
28
33
|
files.push({
|
|
29
34
|
type: 'directory',
|
|
30
35
|
filename,
|
|
31
|
-
files: await walk(
|
|
36
|
+
files: await walk({
|
|
37
|
+
cwd,
|
|
38
|
+
filename,
|
|
39
|
+
ignore,
|
|
40
|
+
opendir,
|
|
41
|
+
}),
|
|
32
42
|
});
|
|
33
43
|
continue;
|
|
34
44
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redlint",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Lint Filesystem with πPutout",
|
|
7
7
|
"homepage": "https://github.com/putoutjs/redlint#readme",
|
|
8
8
|
"main": "./lib/redlint.js",
|
|
9
|
+
"bin": {
|
|
10
|
+
"redlint": "bin/redlint.js"
|
|
11
|
+
},
|
|
9
12
|
"exports": {
|
|
10
13
|
".": "./lib/redlint.js"
|
|
11
14
|
},
|