Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a JavaScript linter #95

Open
gazayas opened this issue Jun 27, 2023 · 2 comments
Open

Use a JavaScript linter #95

gazayas opened this issue Jun 27, 2023 · 2 comments

Comments

@gazayas
Copy link

gazayas commented Jun 27, 2023

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.

@gazayas
Copy link
Author

gazayas commented Jun 27, 2023

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.

@gazayas
Copy link
Author

gazayas commented Jun 27, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant