javascript - tslint:disable not working properly - Stack Overflow

I'm using VSCode, and have TSLint plugin installed. Apart from this I also have eslint configured

I'm using VSCode, and have TSLint plugin installed. Apart from this I also have eslint configured for my app. However, for one line, I'm trying to disable eslint with the below code.

if (!Intl) {
  // eslint-disable-next-line global-require no-global-assign
  Intl = require('intl')
}

However, when I run my linter it still shows an error. What am I doing wrong?

I'm using VSCode, and have TSLint plugin installed. Apart from this I also have eslint configured for my app. However, for one line, I'm trying to disable eslint with the below code.

if (!Intl) {
  // eslint-disable-next-line global-require no-global-assign
  Intl = require('intl')
}

However, when I run my linter it still shows an error. What am I doing wrong?

Share Improve this question asked Mar 20, 2018 at 12:58 SoorajSooraj 10.6k12 gold badges67 silver badges103 bronze badges 1
  • Do you have the eslint plugin for vscode installed? Are you using a eslint config file? How are you running the linter? – joshvito Commented Mar 20, 2018 at 14:14
Add a ment  | 

2 Answers 2

Reset to default 3

Usually with vs code, you can just put your cursor on the offending line and type Ctrl + . and the ide will add the appropriate rule.

the syntax you are looking for is // tslint:disable-next-line:max-line-length

Turn out that when specifying multiple rules a , is required in between the rules.

if (!Intl) {
  // eslint-disable-next-line global-require, no-global-assign
  Intl = require('intl')
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744360842a4570462.html

相关推荐

  • javascript - tslint:disable not working properly - Stack Overflow

    I'm using VSCode, and have TSLint plugin installed. Apart from this I also have eslint configured

    7天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信