forked from logue/vite-vue2-ts-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yml
95 lines (95 loc) · 2.82 KB
/
.eslintrc.yml
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
env:
browser: true
es2021: true
extends:
- plugin:vue/recommended
- standard-with-typescript
- plugin:import/recommended
- plugin:import/typescript
- plugin:vuejs-accessibility/recommended
- plugin:yaml/recommended
- '@vue/eslint-config-prettier'
parser: vue-eslint-parser
parserOptions:
ecmaVersion: latest
parser: '@typescript-eslint/parser'
sourceType: module
createDefaultProgram: true
project:
- ./tsconfig.app.json
- ./tsconfig.node.json
- ./tsconfig.vitest.json
extraFileExtensions:
- .vue
plugins:
- import
- tsdoc
- html
- yaml
- vue
rules:
require-jsdoc: warn
no-unused-vars: warn
'@typescript-eslint/array-type':
- error
- default: array # const lines: string[] = []; style
'@typescript-eslint/ban-ts-comment': off # Enable @ts-ignore etc.
'@typescript-eslint/consistent-generic-constructors':
- error
- type-annotation # Left-hand side style
'@typescript-eslint/consistent-type-imports': # Enable import sort order, see bellow.
- off
- prefer: type-imports
'@typescript-eslint/explicit-function-return-type': off # Fix for pinia
'@typescript-eslint/no-confusing-void-expression':
- error
- ignoreArrowShorthand: true # Allow short land for pretter
'@typescript-eslint/strict-boolean-expressions': off # Fix for vite import.meta.env
'@typescript-eslint/triple-slash-reference': off # Fix for vite env.d.ts.
import/default: off # Fix for Vue setup style
import/no-default-export: off # Fix for Vue setup style
import/order: # Sort Import Order. see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md#importorder-enforce-a-convention-in-module-import-order
- error
- groups:
['builtin', 'external', 'parent', 'sibling', 'index', 'object', 'type']
pathGroups:
# Vue Core
- pattern: '{vue,vue-router,vuex,@/stores,vue-i18n,pinia,vite,vitest,vitest/**,@vitejs/**,@vue/**,@logue/vue2-helpers}'
group: external
position: before
# Internal Codes
- pattern: '{@/**}'
group: internal
position: before
pathGroupsExcludedImportTypes:
- builtin
alphabetize:
order: asc
newlines-between: always
tsdoc/syntax: warn
vue/html-self-closing: # A tag with no content should be written like <br />.
- error
- html:
void: always
vue/multi-word-component-names: warn # Mitigate non-multiword component name errors to warnings.
settings:
import/parsers:
'@typescript-eslint/parser':
- .ts
- .tsx
vue-eslint-parser:
- .vue
import/resolver:
typescript: true
alias:
map:
- ['@', './src']
- ['~', './node_modules']
extensions:
- .js
- .ts
- .jsx
- .tsx
- .vue
vite:
configPath: ./vite.config.ts