-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
100 lines (94 loc) · 2.68 KB
/
index.js
File metadata and controls
100 lines (94 loc) · 2.68 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
import eslintJs from '@eslint/js'
import eslintConfigPrettier from 'eslint-config-prettier'
import eslintReactPlugin from 'eslint-plugin-react'
import eslintPluginVue from 'eslint-plugin-vue'
import globals from 'globals'
import neostandard from 'neostandard'
import eslintTs from 'typescript-eslint'
const eslintBase = [
{ languageOptions: { globals: globals.browser } },
eslintJs.configs.recommended,
...neostandard({ noStyle: true, ts: true }),
{
rules: { 'no-console': 'warn' },
},
]
const vuePostPrettier = {
rules: {
'vue/multi-word-component-names': 'off',
'vue/html-self-closing': ['error', { html: { void: 'any' } }],
'vue/block-order': [
'error',
{
order: ['template', 'script', 'style'],
},
],
},
}
const vueTs = {
files: ['**/*.vue'],
languageOptions: { parserOptions: { parser: eslintTs.parser } },
}
export const eslint = {
'base': eslintBase,
'standard': [...eslintBase, eslintConfigPrettier],
'standard-ts': [
...eslintBase,
...eslintTs.configs.recommended,
eslintConfigPrettier,
],
'react': [
...eslintBase,
eslintReactPlugin.configs.flat['jsx-runtime'],
{
rules: {
'react/prop-types': ['warn', { skipUndeclared: true }],
'no-console': 'off',
},
},
eslintConfigPrettier,
],
'vue3': [
...eslintBase,
...eslintPluginVue.configs['flat/recommended'],
eslintConfigPrettier, // Remove stylistic eslint rules
vuePostPrettier,
],
'vue3-ts': [
...eslintBase,
...eslintTs.configs.recommended,
...eslintPluginVue.configs['flat/recommended'],
vueTs,
eslintConfigPrettier, // Remove stylistic eslint rules
vuePostPrettier,
],
'vue2': [
...eslintBase,
...eslintPluginVue.configs['flat/vue2-recommended'],
eslintConfigPrettier, // Remove stylistic eslint rules
vuePostPrettier,
],
'vue2-ts': [
...eslintBase,
...eslintTs.configs.recommended,
...eslintPluginVue.configs['flat/vue2-recommended'],
vueTs,
eslintConfigPrettier, // Remove stylistic eslint rules
vuePostPrettier,
],
}
export default eslint.standard
export const prettier = {
standard: {
tabWidth: 4,
semi: false,
singleQuote: true,
quoteProps: 'consistent',
arrowParens: 'avoid',
organizeImportsSkipDestructiveCodeActions: true,
plugins: [
'prettier-plugin-organize-imports',
'prettier-plugin-tailwindcss',
],
},
}