mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
refactor: make ESLint path detection cross-platform compatible
This commit is contained in:
parent
376e8617f3
commit
e98645698b
1 changed files with 4 additions and 4 deletions
|
@ -30,13 +30,13 @@ class Linter:
|
||||||
|
|
||||||
def _check_eslint(self):
|
def _check_eslint(self):
|
||||||
eslint_paths = [
|
eslint_paths = [
|
||||||
"./node_modules/.bin/eslint",
|
Path("node_modules") / ".bin" / "eslint",
|
||||||
f"{self.root}/node_modules/.bin/eslint" if self.root else None,
|
Path(self.root) / "node_modules" / ".bin" / "eslint" if self.root else None,
|
||||||
]
|
]
|
||||||
|
|
||||||
for path in eslint_paths:
|
for path in eslint_paths:
|
||||||
if path and os.path.isfile(path):
|
if path and path.is_file():
|
||||||
self.languages["typescript"] = f"{path} --format unix"
|
self.languages["typescript"] = f'"{path}" --format unix'
|
||||||
break
|
break
|
||||||
|
|
||||||
def set_linter(self, lang, cmd):
|
def set_linter(self, lang, cmd):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue