Eslint/Prettier Configuration Proposal (Config Only) #140
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.
I have created an example configuration for eslit/prettier to be integrated with the project. The configuration is set only through the .eslintrc and uses prettier for formatting.
Why use prettier with eslint?
Eslint does a poor job in autofix / autoformat of code style. The following styles give only warnings from eslint => max-len, no-mixed-spaces-and-tabs, keyword-spacing, comma-style...
https://prettier.io/docs/en/comparison.html
prettier/prettier-eslint#101 (comment)
Also I moved the eslint config dependencies to dev-dependencies and added the following scripts:
the lint script will check the src folder with the linter and the lint:fix will autofix / format with prettier and eslint the code when possible.
the eslint-check script will show if there are settings conflicts between prettier and eslint. Style configurations should be set with prettier here as they might cause conflict. for example "indent": ["error", "tab"], is one setting that might cause conflict if set with eslint. Running this script will show the conflicts and they can easily be removed
We can also use pretty-quick library to do linting always before commits. This way we will always have consistently styled code.
Let me know what you think.