@vheissulabs/prettier-config
v1.8.1
Published
Shared Prettier and ESLint configuration for VheissuLabs projects
Maintainers
Readme
@vheissulabs/prettier-config
Shared Prettier and ESLint configuration for VheissuLabs projects.
Installation
npm install --save-dev @vheissulabs/prettier-configPrettier Usage
Run the init script to automatically add the config to your package.json:
npx vheissu-prettier-initOr manually add to your package.json:
{
"prettier": "@vheissulabs/prettier-config"
}Extending Prettier config
module.exports = {
...require('@vheissulabs/prettier-config'),
printWidth: 120
}ESLint Usage (Vue)
Install peer dependencies:
npm install --save-dev eslint eslint-plugin-vueCreate eslint.config.js in your project:
const vheissuConfig = require('@vheissulabs/prettier-config/eslint')
module.exports = [
...vheissuConfig,
// Your overrides here
]What ESLint enforces
Forces Vue template content to new lines:
<!-- Before (Prettier output) -->
<PrimaryButton @click="save">Save</PrimaryButton>
<!-- After (ESLint fix) -->
<PrimaryButton @click="save">
Save
</PrimaryButton>What's included
Prettier
- 4 space indentation
- No semicolons
- Single quotes
- Vue script/style indentation
- Single attribute per line
- HTML whitespace sensitivity: ignore
- Import sorting (no blank lines between groups)
ESLint (Vue)
- Single-line element content forced to new line
- Closing bracket on new line for multiline elements
- Max 1 attribute per line
- 4 space HTML indentation
