Reputation: 2308
I like to keep my imports like this:
import { ValidationError } from "../errors/validation.error";
// Blank
// Blank
function doSomething() {
}
With two blank lines after the imports. Prettier formats the JS with only one blank line after the imports. How do I set it to as much blank lines as I want?
Upvotes: 8
Views: 7899
Reputation: 26732
If you happen to be using ESLint in conjunction with Prettier...
yarn add eslint-plugin-import --dev
👉 here
.eslintrc.js
import/newline-after-import": ["error", { "count": 2 }]
👉 here
If you happen to be using the eslint settings for AirBnB Style Guide then just do #2 and you're done!
Upvotes: 8