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
2 Answers
Reset to default 3Usually 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
评论列表(0条)