最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How would I insure NO newline in ESLint - Stack Overflow

programmeradmin3浏览0评论

From ESLint:

.html

You can disable a check verifying that each file has a newline trailing. However, there does not appear to be an equal/opposite rule. How would I insure that my files have no newline at the end using ESLint? Is this possible?

From ESLint:

http://eslint/docs/rules/eol-last.html

You can disable a check verifying that each file has a newline trailing. However, there does not appear to be an equal/opposite rule. How would I insure that my files have no newline at the end using ESLint? Is this possible?

Share Improve this question asked Jan 15, 2016 at 19:06 BTCBTC 4,0926 gold badges29 silver badges42 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

You should be able to use the rule no-multiple-empty-lines.

"no-multiple-empty-lines": [2, {"max": 99999, "maxEOF": 0}]

max sets the maximum number of consecutive blank lines.

maxEOF can be used to set a different number for the end of file. The last blank lines will then be treated differently. If omitted, the max option is applied everywhere.

Assuming you don't care about the number of empty lines between code, just set max to a high number.

Related

1

Below settings for no empty lines at all
is not good:

'no-multiple-empty-lines':['error',{ max:0 }],

2

But below 1 line
looks better:

'no-multiple-empty-lines':['error',{ max:1 }],

For more options:

See https://eslint/docs/latest/rules/no-multiple-empty-lines

发布评论

评论列表(0)

  1. 暂无评论