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

Update eslint config to include unused imports and indenting #3044

Merged
merged 6 commits into from
Feb 28, 2024

Conversation

rmccar
Copy link
Contributor

@rmccar rmccar commented Feb 20, 2024

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

  • Checkout this PR
  • Make some changes to a js file which includes making indenting errors and adding imports in that aren't being used
  • Create a new branch from this one with the changes and try committing
  • See that the indenting and imports are automatically fixed

Checklist

This needs to be completed by the person raising the PR.

  • I have selected the correct Assignee
  • I have linked the correct Issue

Copy link

netlify bot commented Feb 20, 2024

Deploy Preview for ons-design-system-preview ready!

Name Link
🔨 Latest commit 9164d64
🔍 Latest deploy log https://app.netlify.com/sites/ons-design-system-preview/deploys/65df050cc62e7e000862ffab
😎 Deploy Preview https://deploy-preview-3044--ons-design-system-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@rmccar rmccar self-assigned this Feb 20, 2024
@rmccar rmccar added the Enhancement Change of existing feature label Feb 20, 2024
@rmccar rmccar marked this pull request as ready for review February 22, 2024 16:27
@rmccar rmccar merged commit 502787b into main Feb 28, 2024
9 checks passed
@rmccar rmccar deleted the update-eslint-config branch February 28, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Change of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update eslint config to improve our JS linting
3 participants