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
3 files
+ 7
191
Compare changes
  • Side-by-side
  • Inline
Files
3
  • - Remove deprecated .eslintrc.yml file following Odoo v18 module
        template(odoo_module) recommendations.
    
    - 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
@@ -4,7 +4,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},
};
@@ -45,9 +45,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
@@ -49,11 +49,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;
@@ -55,8 +55,9 @@
const defaultValuePart = defaultValue?.length
? ` ||| ${defaultValue}`
: "";
placeholder = `{{object.${chain}${defaultValuePart}}}`;
break;
}
}
this.input.el.setRangeText(
placeholder,
@@ -64,7 +65,7 @@
this.selectionStart,
"end"
);
// trigger events to make the field dirty
// Trigger events to make the field dirty
this.input.el.dispatchEvent(new InputEvent("input"));
this.input.el.dispatchEvent(new KeyboardEvent("keydown"));
this.input.el.focus();
Loading