[IMP] test_lint, web, point_of_sale: enable no-unsafe-negation rule

This commit also enables the valid-typeof rule which didn't find any
issues

Part-of: odoo/odoo#84530
This commit is contained in:
Samuel Degueldre
2022-02-15 09:26:53 +00:00
parent 3ed0869558
commit 9b8f77caee
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -185,7 +185,7 @@ var PosDB = core.Class.extend({
add_products: function(products){
var stored_categories = this.product_by_category_id;
if(!products instanceof Array){
if(!(products instanceof Array)){
products = [products];
}
for(var i = 0, len = products.length; i < len; i++){
@@ -633,7 +633,7 @@ var utils = Object.assign({
if (typeof(node) === 'string') {
return sindent + node.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
} else if (typeof(node.tag) !== 'string' || !node.children instanceof Array || !node.attrs instanceof Object) {
} else if (typeof(node.tag) !== 'string' || node.children && !(node.children instanceof Array) || node.attrs && !(node.attrs instanceof Object)) {
throw new Error(
_.str.sprintf(_t("Node [%s] is not a JSONified XML node"),
JSON.stringify(node)));
+3 -1
View File
@@ -13,7 +13,9 @@
"no-restricted-globals": ["error", "event", "self"],
"no-const-assign": ["error"],
"no-debugger": ["error"],
"no-dupe-class-members": ["error"]
"no-dupe-class-members": ["error"],
"no-unsafe-negation": ["error"],
"valid-typeof": ["error"]
},
"globals": {
"owl": "readonly",