Trying to lighten the neutron star that is core/package.json.
Opinionated lint requirements on top of CMS cores for custom themes.
npm i --save-dev @almunnings/eslint-config
.eslintrc
{
"extends": ["@almunnings/eslint-config/drupal"],
"root": true
}
.stylelintrc
{
"extends": ["@almunnings/eslint-config/style"]
}
.prettierrc.js
module.exports = {
...require("@almunnings/eslint-config/prettier"),
};
or
package.json
{
"devDependencies": {
"@almunnings/eslint-config": "^0.0.3"
},
"eslintConfig": {
"extends": ["@almunnings/eslint-config/drupal"],
"root": true
},
"stylelint": { "extends": ["@almunnings/eslint-config/style"] },
"prettier": "@almunnings/eslint-config/prettier"
}
- EsLint
- Prettier - Code formatter
- Stylelint
"[javascript]": {
"editor.formatOnSave": false,
"editor.formatOnType": false,
"editor.formatOnPaste": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.formatOnSave": true,
"editor.formatOnType": false,
"editor.formatOnPaste": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": true
}
},
"[vue]": {
"editor.formatOnSave": true,
"editor.formatOnType": false,
"editor.formatOnPaste": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"javascript.format.insertSpaceBeforeFunctionParenthesis": false,