Update eslint config to include unused imports and indenting #3044
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the context of this PR?
Fixes: #3049
Updates the eslint config to automatically fix indenting and unused imports for .js files.
Also adds a vscode recommended settings section to readme.
This sets the indenting for js files at 2 spaces just because thats what we have currently. We use 4 spaces for other files such as the nunjucks ones.
We should have a discussion before this is merged to decide on what we think is the right level of indenting. Personally I prefer 4 spaces as I think it is more readable.Decided to keep it as it is for now and have a think about whether we want to move to 4 spaces in a future PR.Ran linters on all of our js files and also added changes to this pr to establish a baseline.
Had to disable the indenting rule in a couple of test files where we were using a render component function in the middle of a string. This was causing some indentation issues.
How to review this PR
Checklist
This needs to be completed by the person raising the PR.