Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

space indentation expected - Codacy

I heard that good practice is to use something to check my code. I found something called Codacy. I understand everything except 'space indentation expected' from TSLint and TSLint4. Is it because my ident in project is tab? If yes, how can I change this one rule in codacy?

import {NgModule} from '@angular/core';
import {CommonModule}  from '@angular/common';
import {RouterModule, Routes} from '@angular/router';

import {TranslationModule} from '../translate.module';

const adminRoutes: Routes = [
    {
        path: 'admin',
        children: [
        ]
    }
];

@NgModule({
    imports: [
    CommonModule, RouterModule.forRoot(adminRoutes), TranslationModule
    ],
    declarations: [
    ],
    exports: [
    ]
})
export class AdminModule { }

Codacy show problem with

{
    path: 'admin',
    children: [
    ]
}
like image 798
DonLeo Avatar asked Jun 03 '17 19:06

DonLeo


2 Answers

Have a look at the documentation. for instance:

"indent": [true, "tabs", 2]
like image 139
pedrorijo91 Avatar answered Oct 13 '22 02:10

pedrorijo91


see also : maintain consistent styling with angular style guide using tslint

https://github.com/angular/angular-cli/wiki/lint

"indent": [true, "tabs", 4]
like image 38
mruanova Avatar answered Oct 13 '22 01:10

mruanova