[IMP] web, test_lint: forbid private class fields

We don't want private class fields to be used in Odoo because they limit
how classes can be patched from the outside, extensibility is one of
Odoo's biggest strength and we do not want to limit it.

This commit adds the `no-restricted-syntax` rule to eslint configs with
a rule that forbids private class fields.

closes odoo/odoo#109664

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
This commit is contained in:
Samuel Degueldre
2023-01-11 17:58:41 +01:00
parent 4b2692ba2e
commit b34429b984
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -30,6 +30,7 @@
"valid-typeof": ["error"],
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all" }],
"curly": ["error", "all"],
"no-restricted-syntax": ["error", "PrivateIdentifier"],
"prefer-const": ["error", {
"destructuring": "all",
"ignoreReadBeforeAssign": true
+1
View File
@@ -19,6 +19,7 @@
"no-unsafe-negation": ["error"],
"no-duplicate-imports": ["error"],
"valid-typeof": ["error"],
"no-restricted-syntax": ["error", "PrivateIdentifier"],
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all" }]
},
"globals": {