feat: add ESLint detection for TypeScript linting

This commit is contained in:
Paul Gauthier (aider) 2024-09-04 13:51:53 -07:00
parent 18bf3a9f36
commit a3d585a4b4

View file

@ -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