[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:
@@ -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, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
} 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)));
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user