javascript - disabling dot-notation in eslint -
i'm having trouble disabling dot-notation in eslint. below eslint config (for toy example):
module.exports = { "env": { "browser": true }, "extends": "eslint:recommended", "rules": { "indent": [ "error", 4 ], "dot-notation": 0, "no-console": 0, "linebreak-style": [ "error", "unix" ], "quotes": [ "error", "double" ], "semi": [ "error", "always" ] } };
and here javascript:
var x = { a: 3 }; console.log("x[a] = " + x["a"]);
according this, 0
way turn off eslint option. doing wrong?
setting rule value 0
turns rule off completely. means eslint not complain if try use indexer rather dot notation. sounds you're expecting rule either throw warning or error means need either value of 1
(or warn
) or 2
(or error
) depending on how want eslint behave.
the "configuring rules" section of "configuring eslint" should make little more clear:
https://eslint.org/docs/user-guide/configuring#configuring-rules
Comments
Post a Comment