yarn add --dev prettier eslint-plugin-prettier eslint-config-prettier
- Update
.eslintrc.js
and add.prettierrc
if you does not yet exist (shown above) - Install
prettier-atom
or other Editor Integration plugin of your choice - Optional: Configure your text editor plugin to always run on "File Save"
- Restart
ember serve
-
-
Save xomaczar/927057868fddd8e8b6152529ec12a860 to your computer and use it in GitHub Desktop.
Integrate Prettier with Ember
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
/* | |
'plugin:prettier/recommended' does the following: | |
extends: ['prettier'], | |
plugins: ['prettier'], | |
rules: { | |
'prettier/prettier': 'error' | |
} | |
*/ | |
module.exports = { | |
// ... | |
extends: [ | |
'eslint:recommended', | |
'plugin:ember/recommended', | |
'plugin:prettier/recommended' | |
] | |
// ... | |
}; | |
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
// This allows editors like atom-prettier to hook into these configuration options as well | |
{ | |
"arrowParens": "always", | |
"bracketSpacing": true, | |
"printWidth": 100, | |
"proseWrap": "preserve", | |
"semi": true, | |
"singleQuote": true, | |
"tabWidth": 2, | |
"trailingComma": "none", | |
"useTabs": false | |
} |
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
{ | |
"devDependencies": { | |
"eslint-config-prettier": "^2.9.0", | |
"eslint-plugin-prettier": "^2.6.0", | |
"prettier": "^1.13.4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment