简体   繁体   English

如何禁用Angular 7 Typecript中的es-lint错误

[英]How to disable es-lint error in angular 7 typecript

I am working in angular 7 with VS code.I have es-lint rules.I want to disable es-lint error at some case .Is there any plugins for this problem. 我正在使用VS代码在angular 7中工作。我有es-lint规则。在某些情况下我想禁用es-lint错误。是否有用于此问题的任何插件。

[tslint] object access via string literals is disallowed [no-string-literal]

      this.validate(res['results']);

If you want to disable an ESLint rule in a file or on a specific line, you can add a comment. 如果要在文件或特定行中禁用ESLint规则,则可以添加注释。

On a single line: 在一行上:

const message = 'foo';
console.log(message); // eslint-disable-line no-console

// eslint-disable-next-line no-console
console.log(message);

On the whole (rest of the) file: 在整个(其余)文件上:

/* eslint-disable no-console */
const message = 'foo';
console.log(message);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM