Eslint-plugin-import: newline-after-import: Proposal to add "number of newlines" option

Created on 23 Aug 2016  路  2Comments  路  Source: benmosher/eslint-plugin-import

Would be useful to enforce the following style:

import 'a';
import 'b';

import Bar from 'bar';
import Baz from 'baz';


/**
 * ^^^^ 2 lines between the imports block and the rest ^^^^
 */
class Foo extends Bar {
}

enhancement help wanted

Most helpful comment

Sounds good to me.

Currently, the rule only checks whether there is an empty line after the import/require statements. Do we want to check whether there is exactly N empty lines after the statements? I'd personally like that, and maybe by default it should only allow exactly 1 empty line.

All 2 comments

Sounds good to me.

Currently, the rule only checks whether there is an empty line after the import/require statements. Do we want to check whether there is exactly N empty lines after the statements? I'd personally like that, and maybe by default it should only allow exactly 1 empty line.

The current option is {count: number}. So how about {count: number, exact: boolean}?

Was this page helpful?
0 / 5 - 0 ratings