Add editor config
Opened this issue · 2 comments
Describe the problem
I would like to have a .editorconfig
file as to the recommendation from: https://editorconfig.org/
This is needed since not everyone will be using vscode
Describe the proposed solution
I would like to see a .editorconfig
file in the form of, updated to the needs of this project:
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8
# 4 space indentation
[*.py]
indent_style = space
indent_size = 4
# Tab indentation (no size specified)
[Makefile]
indent_style = tab
# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2
# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
Have you checked if this issue has already been raised?
- I did not find any similar issues
Code of Conduct
- I agree to follow this project's Code of Conduct
I think .editorconfig will potentially have too many conflicts with eslint+prettier and will need to be maintained separately.
If you want to work on this to show an example of what the config will look like, I'm happy to take a look, but do note, we don't want editorconfig conflicting with eslint/prettier.
Stealing some setup instructions from this blog post:
ESLint + Prettier
Install the eslint-config-prettier package from NPM,
npm install eslint-config-prettier --save-dev
This package disabled all ESLint rules that overlap with Prettier, so to enable the prettier rules, add "prettier" to the end of the extends array inside .eslintrc.js file...
extends: ['airbnb-base', 'prettier'],
Now, we should be all good! Prettier should work together with ESLint to enforce coding standards and formatting rules at the same time.
and
While Prettier mostly takes care of code formatting, EditorConfig can enforce additional restrictions on a developer's editor. In some cases, Prettier can also use EditorConfig configurations to auto-format our code as well if, (1) .prettierrc file is not provided and (2) the Prettier VSCode extension is already installed.
This is my first foray into a typescript project, but there seems to be some compatibility with some config
Here's another post that seems to cover a lot of the same setup