2020-02-16 19:30:00 +01:00
|
|
|
module.exports = {
|
|
|
|
// https://eslint.org/docs/user-guide/configuring#using-configuration-files-1
|
|
|
|
root: true,
|
|
|
|
|
|
|
|
// https://eslint.org/docs/user-guide/configuring#specifying-environments
|
|
|
|
env: {
|
|
|
|
browser: true,
|
2020-08-05 04:18:39 +02:00
|
|
|
node: true
|
2020-02-16 19:30:00 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
// https://eslint.org/docs/user-guide/configuring#specifying-parser
|
|
|
|
parser: 'vue-eslint-parser',
|
|
|
|
|
2023-01-03 19:19:41 +01:00
|
|
|
// https://eslint.vuejs.org/user-guide/#faq
|
2020-02-16 19:30:00 +01:00
|
|
|
parserOptions: {
|
2023-01-03 19:19:41 +01:00
|
|
|
parser: '@babel/eslint-parser',
|
|
|
|
ecmaVersion: 2022,
|
2020-08-05 04:18:39 +02:00
|
|
|
sourceType: 'module'
|
2020-02-16 19:30:00 +01:00
|
|
|
},
|
|
|
|
|
2023-01-03 19:19:41 +01:00
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: ['*.json'],
|
|
|
|
parser: 'jsonc-eslint-parser',
|
|
|
|
rules: {
|
|
|
|
'no-tabs': 'off',
|
|
|
|
'comma-spacing': 'off'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
|
2020-02-16 19:30:00 +01:00
|
|
|
// https://eslint.org/docs/user-guide/configuring#extending-configuration-files
|
|
|
|
// order matters: from least important to most important in terms of overriding
|
|
|
|
// Prettier + Vue: https://medium.com/@gogl.alex/how-to-properly-set-up-eslint-with-prettier-for-vue-or-nuxt-in-vscode-e42532099a9c
|
|
|
|
extends: [
|
|
|
|
'prettier',
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:vue/recommended',
|
2023-01-03 19:19:41 +01:00
|
|
|
'standard',
|
|
|
|
'plugin:jsonc/recommended-with-json',
|
2022-12-11 08:43:23 +01:00
|
|
|
// 'plugin:vuejs-accessibility/recommended' // uncomment once issues are fixed
|
2020-02-16 19:30:00 +01:00
|
|
|
],
|
|
|
|
|
|
|
|
// https://eslint.org/docs/user-guide/configuring#configuring-plugins
|
2023-01-03 19:19:41 +01:00
|
|
|
plugins: ['vue', 'vuejs-accessibility', 'n', 'unicorn'],
|
2020-02-16 19:30:00 +01:00
|
|
|
|
|
|
|
rules: {
|
2022-09-23 03:04:10 +02:00
|
|
|
'space-before-function-paren': 'off',
|
2022-11-24 18:47:44 +01:00
|
|
|
'comma-dangle': ['error', 'only-multiline'],
|
2020-02-28 04:29:30 +01:00
|
|
|
'vue/no-v-html': 'off',
|
2022-09-23 03:04:10 +02:00
|
|
|
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
|
|
'no-unused-vars': 'warn',
|
|
|
|
'no-undef': 'warn',
|
2023-01-03 19:19:41 +01:00
|
|
|
'object-shorthand': 'off',
|
2022-10-07 03:43:27 +02:00
|
|
|
'vue/no-template-key': 'warn',
|
|
|
|
'vue/no-useless-template-attributes': 'off',
|
2022-12-11 08:43:23 +01:00
|
|
|
'vue/multi-word-component-names': 'off',
|
|
|
|
'vuejs-accessibility/no-onchange': 'off',
|
|
|
|
'vuejs-accessibility/label-has-for': ['error', {
|
|
|
|
required: {
|
|
|
|
some: ['nesting', 'id']
|
|
|
|
}
|
2023-01-03 19:19:41 +01:00
|
|
|
}],
|
|
|
|
'n/no-callback-literal': 'warn',
|
|
|
|
'n/no-path-concat': 'warn',
|
|
|
|
'unicorn/better-regex': 'error',
|
|
|
|
'unicorn/no-array-push-push': 'error',
|
|
|
|
'unicorn/prefer-keyboard-event-key': 'error',
|
|
|
|
'unicorn/prefer-regexp-test': 'error',
|
|
|
|
'unicorn/prefer-string-replace-all': 'error'
|
2020-08-05 04:18:39 +02:00
|
|
|
}
|
2020-02-16 19:30:00 +01:00
|
|
|
}
|