- 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. closes odoo/odoo#105165 Related: odoo/enterprise#34048 Signed-off-by: Michaël Mattiello <mcm@odoo.com>
31 lines
1.0 KiB
JSON
31 lines
1.0 KiB
JSON
{
|
|
"name": "odoo-js-config",
|
|
"version": "1.0.0",
|
|
"description": "JS Config for better DX in javascript",
|
|
"scripts": {
|
|
"format-all": "eslint --fix '**/*.js'",
|
|
"lint-all": "eslint '**/*.js'",
|
|
"lint-web": "eslint '**/web/**/*.js'",
|
|
"format-staged": "lint-staged",
|
|
"lint-diff": "echo '{\"extends\": [\"plugin:diff/diff\"]}' | eslint --resolve-plugins-relative-to . -c /dev/stdin '**/*.js'",
|
|
"format-diff": "echo '{\"extends\": [\"plugin:diff/diff\"]}' | eslint --fix --resolve-plugins-relative-to . -c /dev/stdin '**/*.js'"
|
|
},
|
|
"devDependencies": {
|
|
"eslint": "^8.27.0",
|
|
"eslint-config-prettier": "^8.5.0",
|
|
"eslint-plugin-diff": "^2.0.1",
|
|
"eslint-plugin-prettier": "^4.2.1",
|
|
"lint-staged": "^13.0.3",
|
|
"prettier": "^2.7.1",
|
|
"@types/jquery": "^3.5.14",
|
|
"@types/luxon": "^3.1.0",
|
|
"@types/qunit": "^2.19.3",
|
|
"@odoo/owl": "^2.0.1"
|
|
},
|
|
"lint-staged": {
|
|
"*.{js}": [
|
|
"eslint --fix"
|
|
]
|
|
}
|
|
}
|