From 397d56f40c9ae606edd70c498efef015753963c6 Mon Sep 17 00:00:00 2001 From: Shannon Moeller Date: Sat, 19 Jun 2021 05:03:39 -0600 Subject: fix(eslint): yarn 2 project cwd (#3684) * eslint-handler: fix getcwd when there is no node_modules --- test/linter/test_eslint.vader | 11 ++++++++++- .../eslint/yarn2-app/.yarn/sdks/eslint/bin/eslint.js | 0 test/test-files/eslint/yarn2-app/subdir/testfile.js | 0 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/test-files/eslint/yarn2-app/.yarn/sdks/eslint/bin/eslint.js create mode 100644 test/test-files/eslint/yarn2-app/subdir/testfile.js (limited to 'test') diff --git a/test/linter/test_eslint.vader b/test/linter/test_eslint.vader index 81518af9..4dde5639 100644 --- a/test/linter/test_eslint.vader +++ b/test/linter/test_eslint.vader @@ -66,7 +66,7 @@ Execute(eslint.js executables should be run with node on Windows): \ (has('win32') ? ale#Escape('node.exe') . ' ' : '') \ . ale#Escape(b:executable) . b:args -Execute(eslint.js should be run from a containing project with eslint): +Execute(eslint.js should be run from a containing project with node_modules): call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-package-json/testfile.js') let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js') @@ -74,3 +74,12 @@ Execute(eslint.js should be run from a containing project with eslint): AssertLinter b:executable, \ (has('win32') ? ale#Escape('node.exe') . ' ' : '') \ . ale#Escape(b:executable) . b:args + +Execute(eslint.js should be run from a containing project with .yarn/sdks): + call ale#test#SetFilename('../test-files/eslint/yarn2-app/subdir/testfile.js') + + let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/yarn2-app/.yarn/sdks/eslint/bin/eslint.js') + AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/yarn2-app') + AssertLinter b:executable, + \ (has('win32') ? ale#Escape('node.exe') . ' ' : '') + \ . ale#Escape(b:executable) . b:args diff --git a/test/test-files/eslint/yarn2-app/.yarn/sdks/eslint/bin/eslint.js b/test/test-files/eslint/yarn2-app/.yarn/sdks/eslint/bin/eslint.js new file mode 100644 index 00000000..e69de29b diff --git a/test/test-files/eslint/yarn2-app/subdir/testfile.js b/test/test-files/eslint/yarn2-app/subdir/testfile.js new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3