angulartypescriptangular7eslintlint

How to disable es-lint error in angular 7 typescript


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.

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

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

Solution

  • If you want to disable an ESLint rule in a file or on a specific line, you can add a comment.

    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);