mirror of
https://github.com/go-vikunja/vikunja.git
synced 2025-12-05 19:16:51 -06:00
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: kolaente <k@knt.li>
93 lines
2.4 KiB
JavaScript
93 lines
2.4 KiB
JavaScript
import pluginVue from 'eslint-plugin-vue'
|
|
import js from '@eslint/js'
|
|
import vueTsEslintConfig from '@vue/eslint-config-typescript'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { dirname } from 'node:path'
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
...pluginVue.configs['flat/recommended'],
|
|
...vueTsEslintConfig(),
|
|
{
|
|
ignores: [
|
|
'**/*.test.ts',
|
|
'./cypress',
|
|
],
|
|
},
|
|
{
|
|
rules: {
|
|
'quotes': ['error', 'single'],
|
|
'comma-dangle': ['error', 'always-multiline'],
|
|
'semi': ['error', 'never'],
|
|
'indent': ['error', 'tab', { 'SwitchCase': 1 }],
|
|
|
|
'vue/v-on-event-hyphenation': ['warn', 'never', {'autofix': true}],
|
|
'vue/multi-word-component-names': 'off',
|
|
|
|
// uncategorized rules:
|
|
'vue/component-api-style': ['error', ['script-setup']],
|
|
'vue/component-name-in-template-casing': ['error', 'PascalCase', {
|
|
'globals': ['RouterView', 'RouterLink', 'Icon', 'Notifications', 'Modal', 'Card'],
|
|
}],
|
|
'vue/custom-event-name-casing': ['error', 'camelCase'],
|
|
'vue/define-macros-order': 'error',
|
|
'vue/match-component-file-name': ['error', {
|
|
'extensions': ['.js', '.jsx', '.ts', '.tsx', '.vue'],
|
|
'shouldMatchCase': true,
|
|
}],
|
|
'vue/match-component-import-name': 'error',
|
|
'vue/prefer-separate-static-class': 'warn',
|
|
|
|
'vue/padding-line-between-blocks': 'error',
|
|
'vue/next-tick-style': ['error', 'promise'],
|
|
'vue/block-lang': [
|
|
'error',
|
|
{'script': {'lang': 'ts'}},
|
|
],
|
|
'vue/no-duplicate-attr-inheritance': 'error',
|
|
'vue/no-empty-component-block': 'error',
|
|
'vue/html-indent': ['error', 'tab'],
|
|
|
|
// vue3
|
|
'vue/no-ref-object-reactivity-loss': 'error',
|
|
'vue/no-setup-props-reactivity-loss': 'error',
|
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
// 'args': 'all',
|
|
// 'argsIgnorePattern': '^_',
|
|
'caughtErrors': 'all',
|
|
'caughtErrorsIgnorePattern': '^_',
|
|
// 'destructuredArrayIgnorePattern': '^_',
|
|
'varsIgnorePattern': '^_',
|
|
'ignoreRestSiblings': true,
|
|
},
|
|
],
|
|
},
|
|
|
|
// files: ['*.vue', '**/*.vue'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
parser: '@typescript-eslint/parser',
|
|
ecmaVersion: 'latest',
|
|
tsconfigRootDir: __dirname,
|
|
},
|
|
},
|
|
|
|
|
|
// 'parser': 'vue-eslint-parser',
|
|
// 'parserOptions': {
|
|
// 'parser': '@typescript-eslint/parser',
|
|
// 'ecmaVersion': 'latest',
|
|
// 'tsconfigRootDir': __dirname,
|
|
// },
|
|
// 'ignorePatterns': [
|
|
// 'cypress/*',
|
|
// ],
|
|
},
|
|
|
|
]
|