mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
remove eslint as default linter
This commit is contained in:
parent
a35c532211
commit
e4cbbb1fa8
2 changed files with 0 additions and 24 deletions
|
@ -26,23 +26,6 @@ class Linter:
|
|||
)
|
||||
self.all_lint_cmd = None
|
||||
|
||||
self._check_eslint()
|
||||
|
||||
def _check_eslint(self):
|
||||
eslint_names = ["eslint", "eslint.cmd", "eslint.exe"]
|
||||
eslint_paths = [
|
||||
Path(".") / "node_modules" / ".bin",
|
||||
Path(self.root) / "node_modules" / ".bin" if self.root else None,
|
||||
]
|
||||
|
||||
for path in eslint_paths:
|
||||
if path:
|
||||
for name in eslint_names:
|
||||
eslint_file = path / name
|
||||
if eslint_file.is_file() and " " not in str(eslint_file):
|
||||
self.languages["typescript"] = f"{eslint_file} --format unix"
|
||||
return
|
||||
|
||||
def set_linter(self, lang, cmd):
|
||||
if lang:
|
||||
self.languages[lang] = cmd
|
||||
|
|
|
@ -14,13 +14,6 @@ class TestLinter(unittest.TestCase):
|
|||
self.assertEqual(self.linter.root, "/test/root")
|
||||
self.assertIn("python", self.linter.languages)
|
||||
|
||||
@patch("pathlib.Path.is_file")
|
||||
def test_check_eslint_unix(self, mock_is_file):
|
||||
mock_is_file.return_value = True
|
||||
self.linter._check_eslint()
|
||||
self.assertIn("typescript", self.linter.languages)
|
||||
self.assertTrue(self.linter.languages["typescript"].endswith(" --format unix"))
|
||||
|
||||
def test_set_linter(self):
|
||||
self.linter.set_linter("javascript", "eslint")
|
||||
self.assertEqual(self.linter.languages["javascript"], "eslint")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue