TSLint , enforce spacing between brackets in import statements
Asked Answered
C

1

34

Which rule do I need to apply to enforce spaces between curly brackets in the import statements?

i.e

Instead of :

import {IPostService} from './api/IPostService';

I want:

import { IPostService } from './api/IPostService';
Concentre answered 14/7, 2018 at 23:0 Comment(2)
Would suggest having a look at Prettier then you will not need any more rules for these kind of things :)Body
Add bracketSpacing to true in visual code .prettierrc or add --bracket-spacing if you are using prittier NPM package.Waxler
B
60

I think this might be what you're looking for:

"whitespace": [true, "check-module"]

check-module - checks for whitespace in import & export statements.

Banff answered 14/7, 2018 at 23:12 Comment(1)
For the documentation: palantir.github.io/tslint/rules/whitespaceSycosis

© 2022 - 2024 — McMap. All rights reserved.