Skip to content
Snippets Groups Projects

(eslint): update config to handle ES modules and Odoo JSDoc tags

Merged oury.balde requested to merge topic/18.0/ob into branch/18.0
2 unresolved threads
2 files
+ 8
7
Compare changes
  • Side-by-side
  • Inline
Files
2
  • Make ESLINT happy by fixing:
    9:64  warning  Unexpected comment inline with code                          no-inline-comments
    50:17  error    Variable 'placeholder' should be initialized on declaration  init-declarations
    57:21  warning  Unexpected lexical declaration in case block                 no-case-declarations
    69:13  warning  Comments should not begin with a lowercase character         capitalized-comments
    70:45  error    'InputEvent' is not defined                                  no-undef
    71:45  error    'KeyboardEvent' is not defined                               no-undef
@@ -6,7 +6,7 @@
// Adding a new property for dynamic placeholder button visibility
CharField.props = {
...CharField.props,
rednerDynamicPlaceholder: {type: Boolean, optional: true}, // Dynamic placeholder flag
rednerDynamicPlaceholder: {type: Boolean, optional: true},
buttonVisibilityField: {type: String, optional: true},
converterField: {type: String, optional: true},
};
@@ -47,9 +47,9 @@
this.input.el.focus();
// Build placeholder based on converter type
let placeholder;
let placeholder = "";
switch (this.activeConverterType) {
case "field":
placeholder = `${chain}`;
break;
// Add other converter types here
@@ -51,11 +51,11 @@
switch (this.activeConverterType) {
case "field":
placeholder = `${chain}`;
break;
// Add other converter types here
default:
default: {
const defaultValuePart = defaultValue?.length
? ` ||| ${defaultValue}`
: "";
placeholder = `{{object.${chain}${defaultValuePart}}}`;
break;
@@ -57,8 +57,9 @@
const defaultValuePart = defaultValue?.length
? ` ||| ${defaultValue}`
: "";
placeholder = `{{object.${chain}${defaultValuePart}}}`;
break;
}
}
this.input.el.setRangeText(
placeholder,
@@ -66,9 +67,9 @@
this.selectionStart,
"end"
);
// trigger events to make the field dirty
this.input.el.dispatchEvent(new InputEvent("input"));
this.input.el.dispatchEvent(new KeyboardEvent("keydown"));
// Trigger events to make the field dirty
this.input.el.dispatchEvent(new window.InputEvent("input"));
this.input.el.dispatchEvent(new window.KeyboardEvent("keydown"));
this.input.el.focus();
}
},
Loading