We don't want private class fields to be used in Odoo because they limit
how classes can be patched from the outside, extensibility is one of
Odoo's biggest strength and we do not want to limit it.
This commit adds the `no-restricted-syntax` rule to eslint configs with
a rule that forbids private class fields.
closesodoo/odoo#109664
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
*: pos_hr, pos_restaurant, pos_six
The Chrome component a bloated "god component" that coordinates entirely
too many things which makes it hard to reason about, navigate, and
debug.
This commit extracts the navbar section of the chrome component into its
own component, and makes the sound player into its own self-contained
service.
This commit also merges the ChromeAdapter component into the Chrome
component, there is no reason for these to be two separate components.
Part-of: odoo/odoo#108891
- Use of jsconfig instead of tsconfig
- jsconfig deployed with tooling, no need for CLI
- ecmascript bumped to version es2022 (static properties)
- prettierrc merged inside the eslintrc
- add a few globals
- cleanup package.json scripts
- add script to lint/format only the diff (opposed to staged files)
- bump up node packages versions
- use eslint as cli instead of prettier-eslint, as eslint does provide
parsable output for runbot.
- add the typescrit types of libs as dependencies + main.d.ts to
improve autompletion.
This upgrade makes it easier to deploy and use the js tooling, as it is
expected more and more people will use it if a lint check is added to
the runbot.
About the runbot:
The commit gets the code ready to enable the lint on the runbot.
It will lint the code with the same rules and same ignore file.
The only difference is the runbot will check only the diff and not the
entire commited file.
The goal will be to progressively (and aggressively) whitelist modules
to converge to a nice formatted codebase.
closesodoo/odoo#105165
Related: odoo/enterprise#34048
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
This commit introduces the new calendar view written in owl.
closesodoo/odoo#101185
X-original-commit: e88988f58582d5b49a32d7102a74a176f40c4c69
Related: odoo/enterprise#31808
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
We recently added the prefer-const eslint rule, but the default
configuration of this rule disallows some things that we often do and
which we do not think are bad practice such as declaring a variable with
let so that it's available to a function defined below, but assign it
only once later, we also sometimes destructure variables with let where
some of the variables could be const but not all, in those cases we
accept that some variables will be mutable even though it's not strictly
necessary in favour of conciseness.
closesodoo/odoo#97384
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The prefer-const rule disallows using const on variables that are never
reassigned, this improves readability by allowing the reader to know in
advance that all variables that are declared with const are never
reassigned and all variables declared with let will eventually be
reassigned.
The curly rule disallows braceless if/else, for and while which is a
rule we have thus far been enforcing by hand.
Part-of: odoo/odoo#97286
On 19e775b3cc we added the same rules that
exists in test_lint on the tooling, but we didn't add the globals.
closesodoo/odoo#86649
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
All named arguments on the catch block must be used. If for some motive
the named argument on the catch block is not used, its name must begin
with '_'.
closesodoo/odoo#85569
Related: odoo/enterprise#24867
Related: odoo/design-themes#552
Signed-off-by: Géry Debongnie <ged@odoo.com>
Provide an opt in js tooling system by adding a node env with prettier and eslint configured.
3 bash scripts are provided: enable.sh, disable.sh and reload.sh.
Enable.sh: add to the community root (and optionaly to the enterprise root) the env.
Disable.sh: remove the env.
Reload.sh: disable then enable.