All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#assert#SetUpLinterTest('javascript', 'eslint')
3 runtime autoload/ale/handlers/eslint.vim
5 let b:args = ' -f json --stdin --stdin-filename %s'
11 call ale#assert#TearDownLinterTest()
13 Execute(The default command should be correct):
15 AssertLinter 'eslint', ale#Escape('eslint') . b:args
17 Execute(create-react-app directories should be detected correctly):
18 call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
20 let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js')
21 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/react-app')
22 AssertLinter b:executable,
23 \ (has('win32') ? ale#Escape('node.exe') . ' ' : '')
24 \ . ale#Escape(b:executable) . b:args
26 Execute(use-global should override create-react-app detection):
27 call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
29 let g:ale_javascript_eslint_use_global = 1
30 let g:ale_javascript_eslint_executable = 'eslint_d'
32 let b:executable = 'eslint_d'
33 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/react-app')
34 AssertLinter b:executable, ale#Escape(b:executable) . b:args
36 Execute(other app directories should be detected correctly):
37 call ale#test#SetFilename('../test-files/eslint/other-app/subdir/testfile.js')
39 let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/node_modules/.bin/eslint')
40 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint')
41 AssertLinter b:executable, ale#Escape(b:executable) . b:args
43 Execute(use-global should override other app directories):
44 call ale#test#SetFilename('../test-files/eslint/other-app/subdir/testfile.js')
46 let g:ale_javascript_eslint_use_global = 1
47 let g:ale_javascript_eslint_executable = 'eslint_d'
49 let b:executable = 'eslint_d'
50 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint')
51 AssertLinter b:executable, ale#Escape(b:executable) . b:args
53 Execute(eslint.js executables should be run with node on Windows):
54 call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
56 let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js')
57 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/react-app')
58 AssertLinter b:executable,
59 \ (has('win32') ? ale#Escape('node.exe') . ' ' : '')
60 \ . ale#Escape(b:executable) . b:args
62 Execute(eslint.js should be run from a containing project with node_modules):
63 call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-package-json/testfile.js')
65 let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js')
66 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/react-app')
67 AssertLinter b:executable,
68 \ (has('win32') ? ale#Escape('node.exe') . ' ' : '')
69 \ . ale#Escape(b:executable) . b:args
71 Execute(eslint.js should be run from a containing project with .yarn/sdks):
72 call ale#test#SetFilename('../test-files/eslint/yarn2-app/subdir/testfile.js')
74 let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/yarn2-app/.yarn/sdks/eslint/bin/eslint.js')
75 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/yarn2-app')
76 AssertLinter b:executable,
77 \ (has('win32') ? ale#Escape('node.exe') . ' ' : '')
78 \ . ale#Escape(b:executable) . b:args
80 Execute(astro directories should be detected correctly):
81 call ale#test#SetFilename('../test-files/eslint/astro-app/src/pages/index.astro')
83 let b:executable = ale#path#Simplify(g:dir . '/../test-files/eslint/astro-app/node_modules/eslint/bin/eslint.js')
84 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/eslint/astro-app')
85 AssertLinter b:executable,
86 \ (has('win32') ? ale#Escape('node.exe') . ' ' : '')
87 \ . ale#Escape(b:executable) . b:args