-
Notifications
You must be signed in to change notification settings - Fork 10
/
.eslintrc.js
73 lines (73 loc) · 1.87 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
const { resolve } = require('path');
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parserOptions: {
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#configuration
// https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#eslint
// Needed to make the parser take into account 'vue' files
extraFileExtensions: ['.vue'],
parser: '@typescript-eslint/parser',
project: resolve(__dirname, './tsconfig.json'),
tsconfigRootDir: __dirname,
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
settings: {
'import/resolver': {
node: {
paths: ['src'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:vue/base',
'airbnb-base',
'prettier',
'prettier/vue',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'prettier', 'vue'],
// add your custom rules here
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'prettier/prettier': ['error'],
'no-console': 'off',
'no-underscore-dangle': 'off',
'import/prefer-default-export': 'off',
'func-names': 'off',
'no-shadow': ['error', { allow: ['state'] }],
'no-param-reassign': [
'error',
{
props: true,
ignorePropertyModificationsFor: [
// All properties except state are in the ignorePropertyModificationsFor array by default.
'state',
'acc',
'e',
'ctx',
'req',
'request',
'res',
'response',
'$scope',
],
},
],
},
};