[IMP] web: enable prefer-const and curly rules in eslint config

The prefer-const rule disallows using const on variables that are never
reassigned, this improves readability by allowing the reader to know in
advance that all variables that are declared with const are never
reassigned and all variables declared with let will eventually be
reassigned.

The curly rule disallows braceless if/else, for and while which is a
rule we have thus far been enforcing by hand.

Part-of: odoo/odoo#97286
This commit is contained in:
Samuel Degueldre
2022-08-02 11:49:16 +02:00
parent 6be7d3ee4a
commit 4949829e20
+3 -1
View File
@@ -19,7 +19,9 @@
"no-unsafe-negation": ["error"],
"no-duplicate-imports": ["error"],
"valid-typeof": ["error"],
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all", "caughtErrorsIgnorePattern": "^_" }]
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all", "caughtErrorsIgnorePattern": "^_" }],
"curly": ["error", "all"],
"prefer-const": ["error"]
},
"globals": {
"owl": "readonly",