-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
107 lines (104 loc) · 2.8 KB
/
Copy patheslint.config.ts
File metadata and controls
107 lines (104 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import { defineConfig } from 'eslint/config'
import stylistic from '@stylistic/eslint-plugin'
import ts from 'typescript-eslint'
import vue from 'eslint-plugin-vue'
import vueParser from 'vue-eslint-parser'
import obsidianmd from 'eslint-plugin-obsidianmd'
import globals from 'globals'
export default defineConfig(
{
ignores: [
'node_modules',
'dist',
'vite.config.ts',
'esbuild.config.mjs',
'eslint.config.mjs',
'version-bump.mjs',
'versions.json',
'main.js',
],
},
...(obsidianmd.configs.recommended as unknown[]),
{
files: ['**/*.vue'],
extends: [
...ts.configs.recommended,
...vue.configs['flat/recommended'],
],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: ts.parser,
},
globals: {
...globals.browser,
},
},
rules: {
'vue/html-closing-bracket-newline': ['off'],
'vue/first-attribute-linebreak': ['off'],
'vue/singleline-html-element-content-newline': ['off'],
'vue/html-indent': ['warn', 2, {
alignAttributesVertically: false,
}],
'vue/max-attributes-per-line': ['warn', {
singleline: { max: Number.POSITIVE_INFINITY },
multiline: { max: 1 },
}],
'vue/html-self-closing': ['warn', {
html: { normal: 'never', void: 'always' },
}],
'vue/component-name-in-template-casing': ['warn', 'PascalCase'],
'vue/no-mutating-props': ['warn', {
shallowOnly: true,
}],
'vue/v-for-delimiter-style': ['warn', 'of'],
},
},
{
files: ['**/*.ts'],
extends: [
...ts.configs.recommended,
],
languageOptions: {
globals: {
...globals.browser,
},
parserOptions: {
projectService: {
allowDefaultProject: [
'manifest.json',
],
},
tsconfigRootDir: import.meta.dirname,
extraFileExtensions: ['.json'],
},
},
rules: {
'obsidianmd/ui/sentence-case': 'warn',
},
},
{
files: ['**/*.ts', '**/*.vue'],
rules: {
'@typescript-eslint/no-empty': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'prefer-const': 'warn',
},
},
{
plugins: {
'@stylistic': stylistic,
},
rules: {
// '@stylistic/indent': ['warn', 2, { SwitchCase: 1 }], <- this rule is curently bugged.
'@stylistic/semi': ['warn', 'never'],
'@stylistic/quotes': ['warn', 'single', { allowTemplateLiterals: 'always' }],
'@stylistic/comma-dangle': ['warn', 'always-multiline'],
'@stylistic/arrow-parens': ['warn', 'always'],
'@stylistic/eol-last': ['warn', 'always'],
},
},
)