How to enforce exactly 1 space before blocks (space-before-blocks) with eslint?

323 Views Asked by At

the problem in vscode: eslint ignores extra spaces when fixing:

function() { - i need exactly 1 space here.

the same happens with object notation:

const test = { prop: true }; -> const test = {prop: true}; (doesnt work).

either there're some other rules to force proper formatting or eslint is pretty limited at formatting.

on the other hand i dont like prettier since it destroys empty lines and js-beautify is limited in options also.

any suggestions how to fix this problem?

1

There are 1 best solutions below

0
teppic On BEST ANSWER

Add

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