-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
#16437 introduced a new linter which unfortunately uses only synchronous I/O: existsSync
, existsSync
(multiple times on the same file!), readFileSync
, readdirSync
.
browser-compat-data/test/lint.js
Line 34 in 2888cf5
if (!fs.existsSync(file)) { |
browser-compat-data/test/lint.js
Line 39 in 2888cf5
if (fs.statSync(file).isFile() && path.extname(file) === '.json') { |
browser-compat-data/test/lint.js
Line 47 in 2888cf5
const rawFileData = fs.readFileSync(file, 'utf-8').trim(); |
browser-compat-data/test/lint.js
Line 63 in 2888cf5
if (fs.statSync(file).isDirectory()) { |
browser-compat-data/test/lint.js
Line 65 in 2888cf5
.readdirSync(file) |
This makes linter very slow, on a decent laptop with an SSD time npm run lint
produces:
real 0m8.531s
user 0m0.046s
sys 0m0.106s
I like async I/O a lot and if you would be interested in reviewing a PR for async I/O, I can create one.