mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +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):
|
||||
eslint_paths = [
|
||||
"./node_modules/.bin/eslint",
|
||||
f"{self.root}/node_modules/.bin/eslint" if self.root else None,
|
||||
Path("node_modules") / ".bin" / "eslint",
|
||||
Path(self.root) / "node_modules" / ".bin" / "eslint" if self.root else None,
|
||||
]
|
||||
|
||||
for path in eslint_paths:
|
||||
if path and os.path.isfile(path):
|
||||
self.languages["typescript"] = f"{path} --format unix"
|
||||
if path and path.is_file():
|
||||
self.languages["typescript"] = f'"{path}" --format unix'
|
||||
break
|
||||
|
||||
def set_linter(self, lang, cmd):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue