Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 8d80bf6

Browse files
author
Ian VanSchooten
committed
Move and rename linter-eslint’s eslint lookup
Bringing it out into the function’s closure will avoid repeated syscalls.
1 parent dacef65 commit 8d80bf6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/es5-helpers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const FS = require('fs')
66
const find = require('atom-linter').findFile
77

88
let prefixPath = null
9+
const atomEslintPath = Path.join(FS.realpathSync(Path.join(__dirname, '..')), 'node_modules', 'eslint')
910

1011
function findEslintDir(params) {
11-
const eslintPathLocal = Path.join(FS.realpathSync(Path.join(__dirname, '..')), 'node_modules', 'eslint')
1212
const modulesPath = find(params.fileDir, 'node_modules')
1313
let eslintNewPath = null
1414

@@ -30,7 +30,7 @@ function findEslintDir(params) {
3030
try {
3131
FS.accessSync(eslintNewPath = Path.join(modulesPath, 'eslint'), FS.R_OK)
3232
} catch (_) {
33-
eslintNewPath = eslintPathLocal
33+
eslintNewPath = atomEslintPath
3434
}
3535
}
3636

0 commit comments

Comments
 (0)