-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
156 lines (154 loc) · 5.75 KB
/
index.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
module.exports = {
extends: [
'plugin:vue/recommended',
'plugin:vue/vue3-recommended',
'@vue/typescript/recommended',
'plugin:deprecation/recommended',
],
parser: 'vue-eslint-parser',
parserOptions: {
parser: {
// Script parser for `<script>`
js: '@typescript-eslint/parser',
// Script parser for `<script lang="ts">`
ts: '@typescript-eslint/parser',
// Script parser for vue directives (e.g. `v-if=` or `:attribute=`)
// and vue interpolations (e.g. `{{variable}}`).
// If not specified, the parser determined by `<script lang ="...">` is used.
'<template>': 'espree',
},
extraFileExtensions: ['.vue'],
project: ['./tsconfig.json'],
},
plugins: [
'import',
'import-newlines',
'unused-imports',
'disable-autofix',
'no-barrel-files'
],
settings: {
'import/resolver': {
'typescript': true,
'node': true
}
},
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/brace-style': 'error',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/consistent-generic-constructors': ['error', 'constructor'],
'@typescript-eslint/consistent-indexed-object-style': ['error', 'record'],
'@typescript-eslint/consistent-type-exports': ['error', { fixMixedExportsWithInlineTypeSpecifier: true }],
'@typescript-eslint/consistent-type-imports': ['error', {
prefer: 'type-imports',
fixStyle: 'inline-type-imports'
}],
'@typescript-eslint/indent': ['error', 2, {
FunctionExpression: { parameters: 'first' },
ignoredNodes: [
"PropertyDefinition[decorators]",
'FunctionExpression > .params[decorators.length > 0]',
'FunctionExpression > .params > :matches(Decorator, :not(:first-child))',
'ClassBody.body > PropertyDefinition[decorators.length > 0] > .key',
],
}],
'@typescript-eslint/member-delimiter-style': ['error', {
multiline: { delimiter: 'none' },
singleline: { delimiter: 'comma' }
}],
// temporarily disabled due to "Maximum call stack size exceeded" error
// '@typescript-eslint/no-confusing-void-expression': ['error', { ignoreVoidOperator: true }],
'object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
'@typescript-eslint/semi': ['error', 'never'],
'array-bracket-spacing': ['error', 'never'],
'arrow-spacing': ['error', { before: true, after: true }],
'brace-style': 'off',
'camelcase': 'off',
'comma-spacing': ['error', { before: false, after: true }],
'comma-style': ['error', 'last', { exceptions: { ImportDeclaration: false } }],
'computed-property-spacing': ['error', 'never'],
'func-call-spacing': ['error', 'never'],
'function-call-argument-newline': ['error', 'consistent'],
'function-paren-newline': ['error', 'consistent'],
'import/no-unresolved': 'error',
'import/named': 'error',
'import/namespace': 'error',
'import/default': 'error',
'import/export': 'error',
'import/order': [
'error',
{
'newlines-between': 'never',
'named': { enabled: true, import: true, export: true, require: true, types: 'types-first' },
'alphabetize': {
order: 'asc',
},
'groups': [
'builtin',
['external', 'internal'],
'parent',
['sibling', 'index'],
'object',
]
}
],
'import/no-cycle': 'error',
'import/no-duplicates': 'error',
'import/no-self-import': 'error',
'import/no-useless-path-segments': ['error', {
noUselessIndex: true,
}],
'import-newlines/enforce': ['error', {
'items': 5,
'max-len': 100,
'semi': false
}],
'indent': 'off',
'keyword-spacing': ['error', { before: true, after: true }],
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-barrel-files/no-barrel-files': 'error',
'no-debugger': 'error',
'no-multi-spaces': 'error',
'no-undef': 'off',
'no-restricted-imports': ['error', {
'patterns': [{
'group': ['@luminsports/**/export', '@luminsports/**/index', './**/export', './**/index', '../**/export', '../**/index'],
'message': 'Do not import from barrel files. Import from the specific file instead.'
}]
}],
'object-curly-newline': ['error', { multiline: true, consistent: true }],
'object-curly-spacing': ['error', 'always'],
'prefer-const': 'error',
'quote-props': ['error', 'consistent-as-needed'],
'semi': 'off',
'space-before-blocks': ['error', 'always'],
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': ['error', { words: true, nonwords: false, overrides: { '!': true } }],
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': ['error', { args: 'none', ignoreRestSiblings: true }],
'vue/html-closing-bracket-newline': ['error', { singleline: 'never', multiline: 'never' }],
'vue/max-attributes-per-line': ['error', { singleline: 3, multiline: 1 }],
'vue/singleline-html-element-content-newline': 'off',
'vue/valid-v-slot': ['error', {
'allowModifiers': true
}],
// vue3 compatibility warnings
'vue/no-v-for-template-key-on-child': 'warn',
'vue/no-deprecated-v-bind-sync': 'off',
'disable-autofix/vue/no-deprecated-v-bind-sync': 'warn',
},
overrides: [{
files: ['**/export.ts'],
rules: {
'no-barrel-files/no-barrel-files': 'off'
}
}]
}