admin管理员组文章数量:1318986
There is errors in my code:
Severity Code Description Project File Line Suppression State Error eqeqeq (ESLint) Expected '!==' and instead saw '!='.
I can't find where to disable ONLY the eqeqeq
option.
Thanks in advance.
There is errors in my code:
Severity Code Description Project File Line Suppression State Error eqeqeq (ESLint) Expected '!==' and instead saw '!='.
I can't find where to disable ONLY the eqeqeq
option.
Thanks in advance.
Share Improve this question edited Aug 16, 2019 at 3:25 craigcaulfield 3,53810 gold badges35 silver badges43 bronze badges asked Nov 2, 2018 at 7:42 Tigran PetrosyanTigran Petrosyan 1373 silver badges9 bronze badges 5- Where is your ESLint config? – VLAZ Commented Nov 2, 2018 at 7:44
- I have no config eslint in my project. The error started after update of Visual Studio – Tigran Petrosyan Commented Nov 2, 2018 at 11:14
- Then I guess you have to figure out where Visual Studio is getting the config from. – VLAZ Commented Nov 2, 2018 at 11:38
- Thanks @vlaz, but I need to change this option in generally, not in my local config file Or maybe we can supress some warning like it is done in framework where in project properties you can add suppress warnings – Tigran Petrosyan Commented Nov 3, 2018 at 13:04
- Hence why I said you have to find where the config for VS is. So you can modify that. – VLAZ Commented Nov 3, 2018 at 13:08
1 Answer
Reset to default 6To turn off the eqeqeq rule everywhere:
- Open Windows Explorer with Windows Key + E
- Paste exactly this into your URL bar:
%USERPROFILE%
and hit Enter - Find the file
.eslintrc
- Right-click
open with...
, Notepad (or your favorite text editor)- Find:
"rules": { "eqeqeq": "always",
and change it to "off" to disable, or "smart" (see below):
"rules": { "eqeqeq": "off",
smart
The "smart" option enforces the use of === and !== except for these cases:
Comparing two literal values Evaluating the value of typeof Comparing against null
- Then, Restart Visual Studio for it to take effect.
Link for more information:
https://eslint/docs/rules/eqeqeq
To turn off the eqeqeq rule on a per file basis, paste this at the top of your .js file:
/*eslint eqeqeq: "off"*/
To turn off the all ESLint functionality on a per-project basis, create a file named .eslintrc.json
in your project's root folder, (or any folder you want ESLint turned off), with the following contents:
{ }
本文标签: javascriptCan39t change ESlint eqeqeq option to quotsmartquotStack Overflow
版权声明:本文标题:javascript - Can't change ESlint eqeqeq option to "smart" - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742055630a2418276.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论