-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
97 lines (82 loc) · 3.33 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
const { resolve } = require('path');
module.exports = {
root: 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: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/recommended',
// 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
],
// 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: {
extraFileExtensions: ['.vue'],
//project: resolve(__dirname, './tsconfig.json'),
tsconfigRootDir: __dirname,
ecmaVersion: 2020,
ecmaFeatures: { 'legacyDecorators': true },
parser: '@typescript-eslint/parser',
sourceType: 'module' // Allows for the use of imports
},
env: {
browser: true,
},
globals: {
ga: false, // Google Analytics
cordova: true,
__statics: true,
process: true
},
// add your custom rules here
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow paren-less arrow functions
'arrow-parens': 'off',
'one-var': 'off',
//'import/first': 'off',
//'import/named': 'error',
//'import/namespace': 'error',
//'import/default': 'error',
//'import/export': 'error',
//'import/extensions': 'off',
//'import/no-unresolved': 'off',
//'import/no-extraneous-dependencies': 'off',
'prefer-promise-reject-errors': 'off',
quotes: ['warn', 'single', { avoidEscape: true }],
'@typescript-eslint/explicit-module-boundary-types': 'off',
// 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'],
// Correct typescript linting until at least 2.0.0 major release
// See https://github.com/typescript-eslint/typescript-eslint/issues/501
// See https://github.com/typescript-eslint/typescript-eslint/issues/493
'@typescript-eslint/explicit-function-return-type': 'off'
}
};