This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest.ts.lint
41 lines (35 loc) · 1.5 KB
/
test.ts.lint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const fs = require('fs');
const file1 = fs.open('test');
const file1 = fs.open(`test`);
const file2 = fs.open(test);
~~~~~~~ [Found fs.open with non-literal argument at index 0]
const file2 = fs.open(`${ test }`);
~~~~~~~ [Found fs.open with non-literal argument at index 0]
require('fs').symlink(path1, path2);
~~~~~~~~~~~~~~~~~~~~~ [Found fs.symlink with non-literal argument at index 0, 1]
fs.symlink('path1', path2);
~~~~~~~~~~ [Found fs.symlink with non-literal argument at index 1]
require("fs").symlink(path1, 'path2');
~~~~~~~~~~~~~~~~~~~~~ [Found fs.symlink with non-literal argument at index 0]
require("fs").symlink(path1, `${ path2 }`);
~~~~~~~~~~~~~~~~~~~~~ [Found fs.symlink with non-literal argument at index 0, 1]
require("fs").symlink(`${ path1 }`, 'path2');
~~~~~~~~~~~~~~~~~~~~~ [Found fs.symlink with non-literal argument at index 0]
fs.symlink('path1', 'path2');
fs.symlink('path1', `path2`);
fs.symlink(`path1`, 'path2');
fs.toString();
const s = 'test';
const o = {
open(a: string) {},
};
o.open(s);
const _ = require('lodash');
require('lodash-exists');
if (_.exists(memberId)) {
this.memberId = memberId;
}
fs.readFileSync(__dirname + 'filename.txt', 'utf-8')
fs.readFileSync(`${__dirname}filename.txt`, 'utf-8')
fs.readFileSync(`${__dirname}${path1}.txt`, 'utf-8')
~~~~~~~~~~~~~~~ [Found fs.readFileSync with non-literal argument at index 0]