Skip to content

Reformat code to fix indentation#2459

Merged
uklotzde merged 1 commit intomixxxdj:2.2from
uklotzde:denon-mc6000mk2-midi
Jan 21, 2020
Merged

Reformat code to fix indentation#2459
uklotzde merged 1 commit intomixxxdj:2.2from
uklotzde:denon-mc6000mk2-midi

Conversation

@uklotzde
Copy link
Copy Markdown
Contributor

The result of applying #2458

@uklotzde uklotzde requested a review from Holzhaus January 20, 2020 22:43
@Holzhaus
Copy link
Copy Markdown
Member

If you prefer to indent switch case statements as well, we can also add { "SwitchCase": 1 } to the .eslintrc.json file. The switch cases in the Roland DJ-505 controller script are indented, too.

@Holzhaus
Copy link
Copy Markdown
Member

Btw, I updated the wiki and replaced instructions regarding jshint/jsbeautifier with eslint.

@uklotzde
Copy link
Copy Markdown
Contributor Author

I have selected ESLint as the formatter in VS Code using our configuration.

@Holzhaus
Copy link
Copy Markdown
Member

Ah OK, so there's manual work involved to use eslint for VSCode? I misinterpreted your comment then. Since VSCode is quite popular it might make sense to add the relevant config to the wiki?

In any case, would you rather prefer to merge this PR or change the indent settings for switch cases in .eslintrc.json? .clang-format has IndentCaseLabels set to false, so the current eslint behavior is consistent with our formatting settings for C++ switch cases. That's OK to me, so feel free to merge this PR.

@uklotzde
Copy link
Copy Markdown
Contributor Author

VS Code integration:

  • Install required node_modules (the extension didn't work without this step!?)
  • Install ESLint extension
  • Select ESLint as default formatter (vs. MS TypeScript/JavaScript or Prettier extension)

@uklotzde
Copy link
Copy Markdown
Contributor Author

The ESLint warnings are shown without any extra configuration. Only the formatter requires attention. Not sure if VS Code asked after installation of the extension.

@uklotzde
Copy link
Copy Markdown
Contributor Author

@Holzhaus Let's keep the non-indented case labels here like we do for the C++ style. It's readable and reduces whitespace bloat.

@uklotzde uklotzde merged commit 37470c0 into mixxxdj:2.2 Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants