-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc-i18n.cjs
81 lines (78 loc) · 2.1 KB
/
.eslintrc-i18n.cjs
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
'use strict'
const localeDir =
process.env.LINT_I18N === 'vue2' ? './playground/vue2/src/locales/*.json' : './playground/vue3/src/locales/*.json'
const messageSyntaxVersion = process.env.LINT_I18N === 'vue2' ? '^8.0.0' : '^9.0.0'
console.log(`lint i18n target: ${process.env.LINT_I18N}`)
console.log(`localeDir: ${localeDir}`)
console.log(`messageSyntaxVersion: ${messageSyntaxVersion}`)
module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:@intlify/vue-i18n/recommended', 'plugin:import/recommended', 'plugin:import/typescript'],
plugins: ['@typescript-eslint'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module'
},
rules: {
'@intlify/vue-i18n/no-raw-text': 'error',
'@intlify/vue-i18n/no-dynamic-keys': 'warn',
'@intlify/vue-i18n/no-missing-keys-in-other-locales': 'error',
'@intlify/vue-i18n/no-unused-keys': 'error',
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'parent', 'sibling', 'index', 'object', 'type'],
pathGroups: [
{
pattern: '{vue**}',
group: 'builtin',
position: 'before'
},
{
pattern: '{vite**}',
group: 'builtin',
position: 'before'
},
{
pattern: '@/**',
group: 'parent',
position: 'before'
}
],
pathGroupsExcludedImportTypes: ['builtin'],
alphabetize: {
order: 'asc'
},
'newlines-between': 'always'
}
]
},
settings: {
'vue-i18n': {
localeDir,
messageSyntaxVersion
},
'import/resolver': {
/**
* NOTE: https://github.com/import-js/eslint-import-resolver-typescript#configuration
*/
typescript: {
project: ['playground/**/tsconfig.json']
}
}
},
overrides: [
{
files: ['*.json', '*.json5'],
extends: ['plugin:@intlify/vue-i18n/base']
},
{
files: ['*.yaml', '*.yml'],
extends: ['plugin:@intlify/vue-i18n/base']
}
]
}