-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
75 lines (64 loc) · 2.66 KB
/
.eslintrc.js
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
module.exports = {
root: true,
// Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
// See https://eslint.vuejs.org/user-guide/#how-to-use-custom-parser
// `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
parserOptions: {
// Needed to make the parser take into account 'vue' files
// See https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#configuration
extraFileExtensions: ['.vue'],
parser: '@typescript-eslint/parser',
project: './tsconfig.json',
sourceType: 'module'
},
env: {
browser: true
},
// Rules order is important, please avoid shuffling them
extends: [
// Base ESLint recommended rules
'eslint:recommended',
// ESLint typescript rules
// See https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
// `plugin:vue/essential` by default, consider switching to `plugin:vue/strongly-recommended`
// or `plugin:vue/recommended` for stricter rules.
// See https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
'plugin:vue/essential',
// Usage with Prettier, provided by 'eslint-config-prettier'.
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage-with-prettier
'prettier',
'prettier/@typescript-eslint',
'prettier/vue'
],
plugins: [
// Required to apply rules which need type information
'@typescript-eslint',
// Required to lint *.vue files
// See https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-file
'vue'
// Prettier has not been included as plugin to avoid performance impact
// See https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674
// Add it as an extension for your IDE
],
globals: {
ga: true, // Google Analytics
cordova: true,
__statics: true,
process: true
},
// add your custom rules here
rules: {
'prefer-promise-reject-errors': 'off',
quotes: ['warn', 'single'],
// allow console.log during development only
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// allow debugger during development only
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// Custom
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
'@typescript-eslint/explicit-function-return-type': 'off'
}
};