mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
feat: add ESLint detection for TypeScript linting
This commit is contained in:
parent
18bf3a9f36
commit
a3d585a4b4
1 changed files with 13 additions and 0 deletions
|
@ -26,6 +26,19 @@ class Linter:
|
|||
)
|
||||
self.all_lint_cmd = None
|
||||
|
||||
self._check_eslint()
|
||||
|
||||
def _check_eslint(self):
|
||||
eslint_paths = [
|
||||
"./node_modules/.bin/eslint",
|
||||
f"{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"
|
||||
break
|
||||
|
||||
def set_linter(self, lang, cmd):
|
||||
if lang:
|
||||
self.languages[lang] = cmd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue