forked from learningequality/kolibri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
111 lines (108 loc) · 2.29 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
var path = require('path');
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
overrides: [
{
files: ['*.spec.js'],
env: {
es6: true,
browser: true,
node: true,
jest: true,
},
parserOptions: {
ecmaVersion: 8,
},
},
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 7,
ecmaFeatures: {
impliedStrict: true,
experimentalObjectRestSpread: true,
},
},
globals: {
__version: true,
__coreAPISpec: true,
__filename: true,
__publicPath: true,
__copyrightYear: true,
},
extends: [
'eslint:recommended',
'prettier',
'plugin:vue/recommended',
'plugin:import/errors',
'plugin:import/warnings',
],
plugins: ['import', 'vue', 'kolibri'],
settings: {
'import/resolver': {
[path.resolve(
path.join(path.dirname(__filename), './frontend_build/src/alias_import_resolver.js')
)]: {
extensions: ['.js', '.vue'],
},
},
},
rules: {
'comma-style': 2,
'max-len': [
'error',
100,
{
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreUrls: true,
},
],
'vue/attribute-hyphenation': [2, 'never'],
'vue/name-property-casing': [2, 'PascalCase'],
'vue/require-default-prop': 0,
'vue/html-self-closing': [
'error',
{
html: {
void: 'never',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/max-attributes-per-line': [
2,
{
singleline: 5,
multiline: {
max: 1,
allowFirstLine: false,
},
},
],
'vue/html-closing-bracket-newline': [
'error',
{
singleline: 'never',
multiline: 'always',
},
],
'vue/html-closing-bracket-spacing': ['error'],
// Waiting on https://github.com/vuejs/eslint-plugin-vue/pull/397
// 'vue/component-name-in-template-casing': 3
'import/first': 1,
'import/no-duplicates': 1,
'import/newline-after-import': 1,
'import/order': 1,
// Custom vue rules
'kolibri/vue-filename-and-component-name-match': 2,
'kolibri/vue-component-registration-casing': 2,
},
};