eslint-config-gbv
Internal linting rules for GBV projects.
Table of Contents
Install
npm i -D eslint-config-gbv
If you don't have eslint
installed in your project yet, you need to do this:
# For all projects (works with v6 and v7):
npm i -D eslint
# Additionally for Vue.js projects:
npm i -D eslint-plugin-vue
Usage
Add the following to you ESLint config:
"extends": [
"gbv"
]
For Vue.js projects, use the following instead (replace 2
with 3
for Vue 3 projects):
"extends": [
"gbv",
"gbv/vue/2"
]
Please enforce linting before a commit in all projects.
Rules
General
Using eslint:recommended
as a base, with the following overriding rules:
- Indentation: Two spaces, indent
case
in switch statements. - Unix style line endings.
- Double quotes.
- Disallow quotes around object literal property names if they are not needed.
- No semicolons.
- Enforce comma dangle on multiline statements (see this).
- Allow console.
Vue.js
Using plugin:vue/recommended
/plugin:vue/vue3-recommended
as a base, with the following overriding rules:
- Allow v-html.
- No closing bracket newline.
- One space for closing brackets on self-closing tags.
Maintainers
Contribute
PRs are welcome, but we only use this for our own project and it shouldn't be of much interest for anyone else.
If editing the README, please conform to the standard-readme specification.
License
MIT @2020 Verbundzentrale des GBV (VZG)