Skip to content
Snippets Groups Projects
  • Simon Genin (ges)'s avatar
    396fec39
    [ADD] cli: add a command to generate tsconfig · 396fec39
    Simon Genin (ges) authored
    
    With the new native JS module system, we have a lot of new features for
    the developer: autocompletion, docstrings, ...
    
    However, it does not work across modules: if a JS file in
    /addons/stock/static/src/some_file.js want to import a file in web, say
    /addons/web/static/src/blabla.js, we will need to use a statement like
    this:
    
    import { something } from '@web/blabla';
    
    Obviously, there is no automatic way for IDEs to know that '@web' should
    map to 'addons/web'.
    
    This is why we propose to use a tsconfig.json that defines the mapping
    between modules and their paths.  This is not mandatory, and only
    affects those developers that work commonly in JS.
    
    Part of PR 63177
    
    Co-authored-by: default avatarFrancois (fge) <fge@odoo.com>
    396fec39
    History
    [ADD] cli: add a command to generate tsconfig
    Simon Genin (ges) authored
    
    With the new native JS module system, we have a lot of new features for
    the developer: autocompletion, docstrings, ...
    
    However, it does not work across modules: if a JS file in
    /addons/stock/static/src/some_file.js want to import a file in web, say
    /addons/web/static/src/blabla.js, we will need to use a statement like
    this:
    
    import { something } from '@web/blabla';
    
    Obviously, there is no automatic way for IDEs to know that '@web' should
    map to 'addons/web'.
    
    This is why we propose to use a tsconfig.json that defines the mapping
    between modules and their paths.  This is not mandatory, and only
    affects those developers that work commonly in JS.
    
    Part of PR 63177
    
    Co-authored-by: default avatarFrancois (fge) <fge@odoo.com>