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.
27 lines
953 B
JSON
27 lines
953 B
JSON
{
|
|
"name": "odoo-js-config",
|
|
"version": "0.0.1",
|
|
"description": "JS Config for better DX in javascript",
|
|
"scripts": {
|
|
"prepare": "husky install",
|
|
"format-web": "prettier-eslint --write 'addons/web/static/src/**/*.js' 'addons/web/static/tests/**/*.js' 'addons/web/doc/**/*.md'",
|
|
"format-staged": "lint-staged",
|
|
"lint-web": "prettier-eslint --list-different 'addons/web/static/src/**/*.js' 'addons/web/static/tests/**/*.js' 'addons/web/doc/**/*.md'",
|
|
"format-all": "prettier-eslint --write '**/*.js' '**/*.md'"
|
|
},
|
|
"devDependencies": {
|
|
"eslint": "^7.25.0",
|
|
"eslint-config-prettier": "^8.3.0",
|
|
"eslint-plugin-prettier": "^3.4.0",
|
|
"husky": "^6.0.0",
|
|
"lint-staged": "^10.5.4",
|
|
"prettier": "2.2.1",
|
|
"prettier-eslint-cli": "^5.0.1"
|
|
},
|
|
"lint-staged": {
|
|
"*.{js,md}": [
|
|
"prettier-eslint --write"
|
|
]
|
|
}
|
|
}
|