magic_test
magic_test copied to clipboard
Use a JavaScript linter
Looking at the views, there is a lot of JavaScript there that isn't styled consistently. I'm seeing we don't have a package manager right now, but it might be good to install a package and use a JS linter.
Hmm, might be difficult with our current setup since all of the JavaScript is written inside of HTML files, and because we wrap the code in <script>
tags, we're getting the following error in ESLint:
> yarn run eslint app/views/magic_test/_finders.html
yarn run v1.22.19
$ /home/gazayas/work/bt/magic_test/node_modules/.bin/eslint app/views/magic_test/_finders.html
/home/gazayas/work/bt/magic_test/app/views/magic_test/_finders.html
1:1 error Parsing error: Unexpected token <
✖ 1 problem (1 error, 0 warnings)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I guess my question is why don't we just have these as regular JavaScript files? I can understand for erb files such as app/views/magic_test/_context_menu.html.erb
, but I think it makes sense to put the move the contents of the other files to regular JavaScript files.