我成功为节点配置了eslint(npm run eslint);但我无法将 Angular-CLI 配置为在此配置中使用 eslint;它总是使用 tslint。
我搜索了各种在线资源,但只发现了一个提示,表明这可能根本不受支持。
有可能实现这一目标,还是我在这里坚持使用 tslint?
我有一个使用 ngx-translate 进行本地化的组件。创建模块的基本单元测试不起作用。它失败并出现以下错误:
PatientDataComponent should create FAILED
[ERROR ->]{{ 'patient.information' | translate }}
</p>
The pipe 'translate' could not be found ("<p>[ERROR ->]{{ 'patient.information' | translate }}</p>"): ng:///DynamicTestModule/PatientDataComponent.html@1:2
error properties: Object({ ngSyntaxError: true, ngParseErrors: [ The pipe 'translate' could not be found ("<p>"): ng:///DynamicTestModule/PatientDataComponent.html@1:2 ] })
Run Code Online (Sandbox Code Playgroud)
该应用程序能够切换语言;因此 ngx-translate 似乎有效。除了我的单元测试。测试代码如下:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PatientDataComponent } from './patient-data.component';
describe('PatientDataComponent', () => {
let component: PatientDataComponent;
let fixture: ComponentFixture<PatientDataComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [PatientDataComponent]
}) …Run Code Online (Sandbox Code Playgroud)