A VS Code extension for opinionated developers.
Prettier is an opinionated code formatter with a handful of configuration options. ESLint, while typically not thought of as a code formatting tool, has a wide range of style rules that can be used for more fine-grained control over your code's appearance than what Prettier allows.
Prettiest ESLint combines the two tools to provide a more flexible and powerful code formatting experience. First Prettier formats your code followed by ESLint in "fix" mode on the Prettier-formatted code. This allows you to use Prettier's formatting rules as a base, then layer on additional rules and customizations with ESLint.
Any files that are not supported by ESLint will be formatted by Prettier only.
- Install Prettier and ESLint in your project:
npm install --save-dev prettier eslint
- Install the Prettiest ESLint extension from the VS Code Marketplace.
- Add the following to your
.vscode/settings.json
:{ "editor.defaultFormatter": "mattbrannon.prettiest-eslint", "editor.formatOnSave": true, "files.autoSave": "onFocusChange" // Optional but recommended }
- Save a file, and your code will be formatted automatically with Prettiest ESLint!
- VS Code 1.91.0 or higher
- Node.js installed
- Prettier installed in your project
- ESLint installed in your project
- Any plugins or parsers defined in your ESLint config installed in your project
Contributions are welcome! Please open an issue to discuss any significant changes.
This extension is inspired by:
This project is licensed under the MIT License.