Last active
June 17, 2023 21:05
-
-
Save raphaeljcm/cf439ddd5bcab27a0a0588d071696d75 to your computer and use it in GitHub Desktop.
eslint and prettier config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EditorConfig is awesome: https://EditorConfig.org | |
# top-most EditorConfig file | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*/.js | |
node_modules | |
dist | |
webpack/*.js | |
.webpack | |
out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
env: { | |
browser: true, | |
es2021: true, | |
jest: true, | |
}, | |
extends: [ | |
'plugin:react/recommended', | |
'plugin:react-hooks/recommended', | |
'plugin:jsx-a11y/recommended', | |
'plugin:@typescript-eslint/recommended', | |
'plugin:prettier/recommended', | |
], | |
globals: { | |
React: 'readonly', | |
}, | |
parser: '@typescript-eslint/parser', | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, | |
}, | |
ecmaVersion: 'latest', | |
sourceType: 'module', | |
}, | |
plugins: [ | |
'react', | |
'react-hooks', | |
'jsx-a11y', | |
'@typescript-eslint', | |
'prettier', | |
], | |
rules: { | |
'prettier/prettier': 'error', | |
'react/react-in-jsx-scope': 'off', | |
'react/prop-types': 'off', | |
}, | |
settings: { | |
react: { | |
version: 'detect', | |
}, | |
'import/parsers': { | |
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'], | |
}, | |
}, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*/.js | |
node_modules | |
build | |
dist | |
out | |
confs | |
public | |
webpack/*.js | |
.webpack | |
.vs | |
.gitlab-ci.yml | |
*.md | |
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@typescript-eslint/eslint-plugin @typescript-eslint/parser | |
eslint eslint-config-prettier eslint-plugin-jsx-a11y | |
eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks prettier | |
When using tailwind, also install: prettier-plugin-tailwindcss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
printWidth: 80, | |
tabWidth: 2, | |
singleQuote: true, | |
trailingComma: 'all', | |
arrowParens: 'avoid', | |
plugins: [require('prettier-plugin-tailwindcss')], // when using tailwindcss | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment