mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
feat: support Windows ESLint executables in linter detection
This commit is contained in:
parent
e98645698b
commit
bb5bca5227
1 changed files with 9 additions and 5 deletions
|
@ -29,15 +29,19 @@ class Linter:
|
||||||
self._check_eslint()
|
self._check_eslint()
|
||||||
|
|
||||||
def _check_eslint(self):
|
def _check_eslint(self):
|
||||||
|
eslint_names = ["eslint", "eslint.cmd", "eslint.exe"]
|
||||||
eslint_paths = [
|
eslint_paths = [
|
||||||
Path("node_modules") / ".bin" / "eslint",
|
Path("node_modules") / ".bin",
|
||||||
Path(self.root) / "node_modules" / ".bin" / "eslint" if self.root else None,
|
Path(self.root) / "node_modules" / ".bin" if self.root else None,
|
||||||
]
|
]
|
||||||
|
|
||||||
for path in eslint_paths:
|
for path in eslint_paths:
|
||||||
if path and path.is_file():
|
if path:
|
||||||
self.languages["typescript"] = f'"{path}" --format unix'
|
for name in eslint_names:
|
||||||
break
|
eslint_file = path / name
|
||||||
|
if eslint_file.is_file():
|
||||||
|
self.languages["typescript"] = f'"{eslint_file}" --format unix'
|
||||||
|
return
|
||||||
|
|
||||||
def set_linter(self, lang, cmd):
|
def set_linter(self, lang, cmd):
|
||||||
if lang:
|
if lang:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue