Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
380 views
in Technique[技术] by (71.8m points)

Rule to set spacing on import statements with eslint?

In my code I have things like this:

import  Something from './Something';

And I would like to normalize it to this:

import Something from './Something';

However, my keyword-spacing rule, although it applies to everything else, doesn't seem to apply to import statements:

'keyword-spacing': ['error', { 'before': true, 'after': true }],

Do I need to use a different rule for this and, if so, which one?

question from:https://stackoverflow.com/questions/65850063/rule-to-set-spacing-on-import-statements-with-eslint

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I use ESLint rule no-multi-spaces for the spacing.

"no-multi-spaces": ["error"]

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...