-
-
Save shivrajbadu/33f480675d9701911e95f10fd9a8388d to your computer and use it in GitHub Desktop.
Eslint for react with prettier
This file contains hidden or 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
Show hidden characters
| { | |
| "extends": ["airbnb", "prettier", "prettier/react"], | |
| "plugins": ["prettier"], | |
| "parser": "babel-eslint", | |
| "parserOptions": { | |
| "ecmaVersion": 2016, | |
| "sourceType": "module", | |
| "ecmaFeatures": { | |
| "jsx": true | |
| } | |
| }, | |
| "env": { | |
| "es6": true, | |
| "browser": true, | |
| "node": true | |
| }, | |
| "rules": { | |
| "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }] | |
| } | |
| } |
This file contains hidden or 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
| # Installation guide | |
| # https://github.com/prettier/prettier/tree/master/editors/vim | |
| # I am using Plug 'w0rp/ale' so here is a setup for ale | |
| let g:ale_fixers = {} | |
| let g:ale_fixers['javascript'] = ['prettier'] | |
| let g:ale_fix_on_save = 1 | |
| let g:ale_javascript_prettier_options = '--single-quote --trailing-comma es5' | |
| # keybinding | |
| nnoremap gp :silent %!prettier --stdin --trailing-comma all --single-quote<CR> |
This file contains hidden or 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
| yarn add --dev eslint prettier eslint-config-airbnb@^15.0.1 eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y@^5.1.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment