@cenk1cenk2/eslint-config 1.0.11 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc.js +4 -0
- package/CHANGELOG.md +148 -169
- package/README.md +12 -32
- package/import.js +44 -0
- package/index.js +23 -27
- package/package.json +29 -11
- package/react-typescript.js +1 -0
- package/react.js +1 -0
- package/typescript-dynamic.js +28 -0
- package/typescript.js +207 -18
- package/vue-typescript.js +1 -0
- package/vue.js +1 -0
- package/typescript-deep.js +0 -16
package/README.md
CHANGED
|
@@ -2,49 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://drone.kilic.dev/cenk1cenk2/eslint-config) [](https://npmjs.org/package/@cenk1cenk2/eslint-config) [](https://npmjs.org/package/@cenk1cenk2/eslint-config) [](https://npmjs.org/package/@cenk1cenk2/eslint-config) [](https://github.com/semantic-release/semantic-release)
|
|
4
4
|
|
|
5
|
+
Some specific rules for my own use case.
|
|
6
|
+
|
|
5
7
|
<!-- toc -->
|
|
6
8
|
|
|
9
|
+
- [Supported Functionality](#supported-functionality)
|
|
7
10
|
- [Extend Typescript Import Path Order](#extend-typescript-import-path-order)
|
|
8
|
-
- [moer headers](#moer-headers)
|
|
9
|
-
- [for test](#for-test)
|
|
10
11
|
|
|
11
12
|
<!-- tocstop -->
|
|
12
13
|
|
|
13
14
|
## Supported Functionality
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
- JavaScript
|
|
17
|
+
- TypeScript
|
|
18
|
+
- Imports
|
|
19
|
+
- Vue
|
|
20
|
+
- React
|
|
21
|
+
- Next
|
|
22
|
+
- Nuxt
|
|
20
23
|
|
|
21
|
-
##
|
|
24
|
+
## Rules
|
|
22
25
|
|
|
23
26
|
```javascript
|
|
24
27
|
module.exports = {
|
|
25
|
-
extends: ['@cenk1cenk2/eslint-config
|
|
26
|
-
rules: {
|
|
27
|
-
'import/order': [
|
|
28
|
-
'error',
|
|
29
|
-
{
|
|
30
|
-
pathGroups: [
|
|
31
|
-
{
|
|
32
|
-
pattern: '@root/**',
|
|
33
|
-
group: 'parent'
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
pathGroupsExcludedImportTypes: ['builtin'],
|
|
37
|
-
groups: [
|
|
38
|
-
['builtin', 'external'],
|
|
39
|
-
['index', 'parent', 'sibling']
|
|
40
|
-
],
|
|
41
|
-
'newlines-between': 'always',
|
|
42
|
-
alphabetize: {
|
|
43
|
-
order: 'asc',
|
|
44
|
-
caseInsensitive: true
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
}
|
|
28
|
+
extends: ['@cenk1cenk2/eslint-config']
|
|
49
29
|
}
|
|
50
30
|
```
|
package/import.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
plugins: [ 'import' ],
|
|
4
|
+
rules: {
|
|
5
|
+
'sort-imports': 'off',
|
|
6
|
+
'import/first': 'error',
|
|
7
|
+
'import/newline-after-import': 'error',
|
|
8
|
+
'import/no-duplicates': 'error',
|
|
9
|
+
'import/order': [
|
|
10
|
+
'error',
|
|
11
|
+
{
|
|
12
|
+
pathGroups: [
|
|
13
|
+
{
|
|
14
|
+
pattern: '@{cenk1cenk2,cenk1cenk2-*}/**',
|
|
15
|
+
group: 'index'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
pattern: '@{src,interfaces,utils,constants,commands}/**',
|
|
19
|
+
group: 'index'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
pattern: '@{src,interfaces,utils,constants,commands}',
|
|
23
|
+
group: 'index'
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
pathGroupsExcludedImportTypes: [ 'builtin' ],
|
|
27
|
+
groups: [
|
|
28
|
+
[ 'builtin', 'external' ],
|
|
29
|
+
[ 'index', 'parent', 'sibling' ]
|
|
30
|
+
],
|
|
31
|
+
'newlines-between': 'always',
|
|
32
|
+
alphabetize: {
|
|
33
|
+
order: 'asc',
|
|
34
|
+
caseInsensitive: true
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
'import/export': 'error',
|
|
39
|
+
'import/exports-last': 'error',
|
|
40
|
+
'import/no-extraneous-dependencies': 'error',
|
|
41
|
+
'import/no-self-import': 'error',
|
|
42
|
+
'import/no-useless-path-segments': 'error'
|
|
43
|
+
}
|
|
44
|
+
}
|
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
1
2
|
module.exports = {
|
|
2
3
|
env: {
|
|
3
4
|
browser: true,
|
|
@@ -9,36 +10,11 @@ module.exports = {
|
|
|
9
10
|
ecmaVersion: 'latest',
|
|
10
11
|
sourceType: 'module'
|
|
11
12
|
},
|
|
12
|
-
|
|
13
|
-
extends: [ 'eslint:recommended' ],
|
|
13
|
+
extends: [ 'eslint:recommended', './import' ],
|
|
14
14
|
rules: {
|
|
15
15
|
semi: [ 'error', 'never' ],
|
|
16
16
|
'linebreak-style': [ 'error', 'unix' ],
|
|
17
17
|
'sort-imports': 'off',
|
|
18
|
-
'import/first': 'error',
|
|
19
|
-
'import/newline-after-import': 'error',
|
|
20
|
-
'import/no-duplicates': 'error',
|
|
21
|
-
'import/order': [
|
|
22
|
-
'error',
|
|
23
|
-
{
|
|
24
|
-
pathGroups: [
|
|
25
|
-
{
|
|
26
|
-
pattern: '@src/**',
|
|
27
|
-
group: 'index'
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
pathGroupsExcludedImportTypes: [ 'builtin' ],
|
|
31
|
-
groups: [
|
|
32
|
-
[ 'builtin', 'external' ],
|
|
33
|
-
[ 'index', 'parent', 'sibling' ]
|
|
34
|
-
],
|
|
35
|
-
'newlines-between': 'always',
|
|
36
|
-
alphabetize: {
|
|
37
|
-
order: 'asc',
|
|
38
|
-
caseInsensitive: true
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
18
|
indent: [ 'error', 2 ],
|
|
43
19
|
'brace-style': [ 'error', '1tbs', { allowSingleLine: true } ],
|
|
44
20
|
'comma-spacing': [ 'error', { before: false, after: true } ],
|
|
@@ -129,6 +105,26 @@ module.exports = {
|
|
|
129
105
|
'spaced-comment': 'error',
|
|
130
106
|
'use-isnan': 'error',
|
|
131
107
|
'valid-typeof': 'warn',
|
|
132
|
-
'arrow-parens': [ 'error', 'always' ]
|
|
108
|
+
'arrow-parens': [ 'error', 'always' ],
|
|
109
|
+
'keyword-spacing': 'error',
|
|
110
|
+
'lines-between-class-members': 'error',
|
|
111
|
+
'padding-line-between-statements': [
|
|
112
|
+
'error',
|
|
113
|
+
{
|
|
114
|
+
blankLine: 'always',
|
|
115
|
+
prev: '*',
|
|
116
|
+
next: 'return'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
blankLine: 'always',
|
|
120
|
+
prev: [ 'const', 'let', 'var' ],
|
|
121
|
+
next: '*'
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
blankLine: 'always',
|
|
125
|
+
prev: [ 'case', 'default' ],
|
|
126
|
+
next: '*'
|
|
127
|
+
}
|
|
128
|
+
]
|
|
133
129
|
}
|
|
134
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cenk1cenk2/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Eslint configuration for my taste.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": "https://github.com/cenk1cenk2/eslint-config",
|
|
@@ -15,32 +15,50 @@
|
|
|
15
15
|
"prepare-commit-msg": "[ -t 1 ] && exec < /dev/tty && git cz --hook || true"
|
|
16
16
|
},
|
|
17
17
|
"lint-staged": {
|
|
18
|
-
"
|
|
18
|
+
"*.{ts,js,tsx,jsx}": [
|
|
19
19
|
"prettier --loglevel warn --write",
|
|
20
20
|
"eslint --fix"
|
|
21
21
|
],
|
|
22
|
-
"
|
|
22
|
+
"*.{json,md}": [
|
|
23
23
|
"prettier --write"
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"eslint": ">= 8"
|
|
27
|
+
"eslint": ">= 8",
|
|
28
|
+
"@nuxtjs/eslint-config": ">= 7",
|
|
29
|
+
"@nuxtjs/eslint-config-typescript": ">= 7",
|
|
30
|
+
"eslint-config-react": ">= 1",
|
|
31
|
+
"eslint-plugin-react-hooks": ">= 4"
|
|
32
|
+
},
|
|
33
|
+
"peerDependenciesMeta": {
|
|
34
|
+
"@nuxtjs/eslint-config": {
|
|
35
|
+
"optional": true
|
|
36
|
+
},
|
|
37
|
+
"@nuxtjs/eslint-config-typescript": {
|
|
38
|
+
"optional": true
|
|
39
|
+
},
|
|
40
|
+
"eslint-config-react": {
|
|
41
|
+
"optional": true
|
|
42
|
+
},
|
|
43
|
+
"eslint-plugin-react-hooks": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
28
46
|
},
|
|
29
47
|
"dependencies": {
|
|
30
|
-
"@nuxtjs/eslint-config": "^7.0.0",
|
|
31
|
-
"@nuxtjs/eslint-config-typescript": "^7.0.2",
|
|
32
48
|
"@typescript-eslint/eslint-plugin": "^5.9.0",
|
|
33
49
|
"@typescript-eslint/parser": "^5.9.0",
|
|
34
|
-
"eslint-
|
|
35
|
-
"eslint-plugin-import": "^2.25.4",
|
|
36
|
-
"eslint-plugin-react-hooks": "^4.3.0"
|
|
50
|
+
"eslint-plugin-import": "^2.25.4"
|
|
37
51
|
},
|
|
38
52
|
"devDependencies": {
|
|
39
53
|
"@cenk1cenk2/cz-cc": "^1.4.11",
|
|
40
|
-
"eslint": "^8.
|
|
54
|
+
"eslint": "^8.8.0",
|
|
41
55
|
"lint-staged": "^12.1.7",
|
|
42
56
|
"prettier": "^2.5.1",
|
|
43
|
-
"simple-git-hooks": "^2.7.0"
|
|
57
|
+
"simple-git-hooks": "^2.7.0",
|
|
58
|
+
"@nuxtjs/eslint-config": "^8.0.0",
|
|
59
|
+
"@nuxtjs/eslint-config-typescript": "^8.0.0",
|
|
60
|
+
"eslint-config-react": "^1.1.7",
|
|
61
|
+
"eslint-plugin-react-hooks": "^4.3.0"
|
|
44
62
|
},
|
|
45
63
|
"config": {
|
|
46
64
|
"commitizen": {
|
package/react-typescript.js
CHANGED
package/react.js
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
extends: [ './typescript' ],
|
|
4
|
+
overrides: [
|
|
5
|
+
{
|
|
6
|
+
files: [ '*.ts', '*.tsx' ],
|
|
7
|
+
parserOptions: {
|
|
8
|
+
ecmaVersion: 'latest',
|
|
9
|
+
sourceType: 'module'
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
13
|
+
'@typescript-eslint/return-await': [ 'error', 'never' ],
|
|
14
|
+
'@typescript-eslint/await-thenable': 'error',
|
|
15
|
+
'@typescript-eslint/consistent-type-exports': [ 'error', { fixMixedExportsWithInlineTypeSpecifier: false } ],
|
|
16
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
17
|
+
'error',
|
|
18
|
+
{
|
|
19
|
+
prefer: 'type-imports',
|
|
20
|
+
disallowTypeAnnotations: true
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
'dot-notation': 'off',
|
|
24
|
+
'@typescript-eslint/dot-notation': [ 'error' ]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
package/typescript.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
1
2
|
module.exports = {
|
|
2
3
|
extends: [ './index' ],
|
|
3
4
|
overrides: [
|
|
@@ -12,9 +13,17 @@ module.exports = {
|
|
|
12
13
|
rules: {
|
|
13
14
|
// this is a bit buggy at the moment
|
|
14
15
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
15
|
-
'@typescript-eslint/explicit-function-return-type':
|
|
16
|
+
'@typescript-eslint/explicit-function-return-type': [
|
|
17
|
+
'error',
|
|
18
|
+
{
|
|
19
|
+
allowExpressions: false,
|
|
20
|
+
allowTypedFunctionExpressions: true,
|
|
21
|
+
allowHigherOrderFunctions: true,
|
|
22
|
+
allowDirectConstAssertionInArrowFunctions: true,
|
|
23
|
+
allowConciseArrowFunctionExpressionsStartingWithVoid: false
|
|
24
|
+
}
|
|
25
|
+
],
|
|
16
26
|
'@typescript-eslint/no-unused-vars': 'error',
|
|
17
|
-
'@typescript-eslint/array-type': 'error',
|
|
18
27
|
'@typescript-eslint/ban-ts-ignore': 'off',
|
|
19
28
|
'@typescript-eslint/explicit-member-accessibility': [
|
|
20
29
|
'off',
|
|
@@ -24,7 +33,7 @@ module.exports = {
|
|
|
24
33
|
],
|
|
25
34
|
'@typescript-eslint/interface-name-prefix': 'off',
|
|
26
35
|
'@typescript-eslint/member-delimiter-style': [
|
|
27
|
-
'
|
|
36
|
+
'error',
|
|
28
37
|
{
|
|
29
38
|
multiline: {
|
|
30
39
|
delimiter: 'none',
|
|
@@ -32,7 +41,7 @@ module.exports = {
|
|
|
32
41
|
},
|
|
33
42
|
singleline: {
|
|
34
43
|
delimiter: 'comma',
|
|
35
|
-
requireLast:
|
|
44
|
+
requireLast: true
|
|
36
45
|
}
|
|
37
46
|
}
|
|
38
47
|
],
|
|
@@ -45,7 +54,133 @@ module.exports = {
|
|
|
45
54
|
allowSingleLine: true
|
|
46
55
|
}
|
|
47
56
|
],
|
|
48
|
-
'@typescript-eslint/member-ordering':
|
|
57
|
+
'@typescript-eslint/member-ordering': [
|
|
58
|
+
'warn',
|
|
59
|
+
{
|
|
60
|
+
default: [
|
|
61
|
+
// Index signature
|
|
62
|
+
'signature',
|
|
63
|
+
|
|
64
|
+
// Fields
|
|
65
|
+
'public-static-field',
|
|
66
|
+
'protected-static-field',
|
|
67
|
+
'private-static-field',
|
|
68
|
+
|
|
69
|
+
'public-instance-field',
|
|
70
|
+
'public-decorated-field',
|
|
71
|
+
'protected-instance-field',
|
|
72
|
+
'protected-decorated-field',
|
|
73
|
+
'private-instance-field',
|
|
74
|
+
'private-decorated-field',
|
|
75
|
+
|
|
76
|
+
'public-abstract-field',
|
|
77
|
+
'protected-abstract-field',
|
|
78
|
+
'private-abstract-field',
|
|
79
|
+
|
|
80
|
+
'public-field',
|
|
81
|
+
'protected-field',
|
|
82
|
+
'private-field',
|
|
83
|
+
|
|
84
|
+
'static-field',
|
|
85
|
+
'instance-field',
|
|
86
|
+
'abstract-field',
|
|
87
|
+
|
|
88
|
+
'decorated-field',
|
|
89
|
+
|
|
90
|
+
'field',
|
|
91
|
+
|
|
92
|
+
// Constructors
|
|
93
|
+
'public-constructor',
|
|
94
|
+
'protected-constructor',
|
|
95
|
+
'private-constructor',
|
|
96
|
+
|
|
97
|
+
'constructor',
|
|
98
|
+
|
|
99
|
+
// Getters
|
|
100
|
+
'public-static-get',
|
|
101
|
+
'protected-static-get',
|
|
102
|
+
'private-static-get',
|
|
103
|
+
|
|
104
|
+
'public-instance-get',
|
|
105
|
+
'public-decorated-get',
|
|
106
|
+
'protected-instance-get',
|
|
107
|
+
'protected-decorated-get',
|
|
108
|
+
'private-instance-get',
|
|
109
|
+
'private-decorated-get',
|
|
110
|
+
|
|
111
|
+
'public-abstract-get',
|
|
112
|
+
'protected-abstract-get',
|
|
113
|
+
'private-abstract-get',
|
|
114
|
+
|
|
115
|
+
'public-get',
|
|
116
|
+
'protected-get',
|
|
117
|
+
'private-get',
|
|
118
|
+
|
|
119
|
+
'static-get',
|
|
120
|
+
'instance-get',
|
|
121
|
+
'abstract-get',
|
|
122
|
+
|
|
123
|
+
'decorated-get',
|
|
124
|
+
|
|
125
|
+
'get',
|
|
126
|
+
|
|
127
|
+
// Setters
|
|
128
|
+
'public-static-set',
|
|
129
|
+
'protected-static-set',
|
|
130
|
+
'private-static-set',
|
|
131
|
+
|
|
132
|
+
'public-instance-set',
|
|
133
|
+
'public-decorated-set',
|
|
134
|
+
'protected-instance-set',
|
|
135
|
+
'protected-decorated-set',
|
|
136
|
+
'private-instance-set',
|
|
137
|
+
'private-decorated-set',
|
|
138
|
+
|
|
139
|
+
'public-abstract-set',
|
|
140
|
+
'protected-abstract-set',
|
|
141
|
+
'private-abstract-set',
|
|
142
|
+
|
|
143
|
+
'public-set',
|
|
144
|
+
'protected-set',
|
|
145
|
+
'private-set',
|
|
146
|
+
|
|
147
|
+
'static-set',
|
|
148
|
+
'instance-set',
|
|
149
|
+
'abstract-set',
|
|
150
|
+
|
|
151
|
+
'decorated-set',
|
|
152
|
+
|
|
153
|
+
'set',
|
|
154
|
+
|
|
155
|
+
// Methods
|
|
156
|
+
'public-static-method',
|
|
157
|
+
'protected-static-method',
|
|
158
|
+
'private-static-method',
|
|
159
|
+
|
|
160
|
+
'public-instance-method',
|
|
161
|
+
'protected-instance-method',
|
|
162
|
+
'private-instance-method',
|
|
163
|
+
|
|
164
|
+
'public-abstract-method',
|
|
165
|
+
'protected-abstract-method',
|
|
166
|
+
'private-abstract-method',
|
|
167
|
+
|
|
168
|
+
'public-method',
|
|
169
|
+
'public-decorated-method',
|
|
170
|
+
'protected-method',
|
|
171
|
+
'protected-decorated-method',
|
|
172
|
+
'private-method',
|
|
173
|
+
'private-decorated-method',
|
|
174
|
+
|
|
175
|
+
'static-method',
|
|
176
|
+
'instance-method',
|
|
177
|
+
'decorated-method',
|
|
178
|
+
'abstract-method',
|
|
179
|
+
|
|
180
|
+
'method'
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
],
|
|
49
184
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
50
185
|
camelcase: 'off',
|
|
51
186
|
'@typescript-eslint/naming-convention': [
|
|
@@ -57,9 +192,15 @@ module.exports = {
|
|
|
57
192
|
|
|
58
193
|
{
|
|
59
194
|
selector: 'variable',
|
|
195
|
+
modifiers: [ 'const' ],
|
|
60
196
|
format: [ 'camelCase', 'UPPER_CASE', 'PascalCase' ]
|
|
61
197
|
},
|
|
62
198
|
|
|
199
|
+
{
|
|
200
|
+
selector: 'variable',
|
|
201
|
+
format: [ 'camelCase' ]
|
|
202
|
+
},
|
|
203
|
+
|
|
63
204
|
{
|
|
64
205
|
selector: 'function',
|
|
65
206
|
format: [ 'camelCase', 'PascalCase' ]
|
|
@@ -73,7 +214,7 @@ module.exports = {
|
|
|
73
214
|
|
|
74
215
|
{
|
|
75
216
|
selector: 'property',
|
|
76
|
-
format: [ 'camelCase', 'UPPER_CASE'
|
|
217
|
+
format: [ 'camelCase', 'UPPER_CASE' ]
|
|
77
218
|
},
|
|
78
219
|
|
|
79
220
|
{
|
|
@@ -85,25 +226,17 @@ module.exports = {
|
|
|
85
226
|
|
|
86
227
|
{
|
|
87
228
|
selector: 'enumMember',
|
|
88
|
-
format: [ '
|
|
229
|
+
format: [ 'UPPER_CASE' ]
|
|
89
230
|
},
|
|
90
231
|
|
|
91
232
|
{
|
|
92
233
|
selector: 'typeLike',
|
|
93
234
|
format: [ 'PascalCase' ]
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
{
|
|
97
|
-
selector: 'interface',
|
|
98
|
-
format: [ 'PascalCase' ]
|
|
99
|
-
// custom: {
|
|
100
|
-
// regex: '^I[A-Z]',
|
|
101
|
-
// match: false
|
|
102
|
-
// }
|
|
103
235
|
}
|
|
104
236
|
],
|
|
105
237
|
'@typescript-eslint/no-parameter-properties': 'off',
|
|
106
|
-
'
|
|
238
|
+
'func-call-spacing': 'off',
|
|
239
|
+
'@typescript-eslint/func-call-spacing': [ 'error' ],
|
|
107
240
|
'@typescript-eslint/prefer-for-of': 'warn',
|
|
108
241
|
'@typescript-eslint/prefer-function-type': 'error',
|
|
109
242
|
'space-before-function-paren': 'off',
|
|
@@ -127,7 +260,63 @@ module.exports = {
|
|
|
127
260
|
'@typescript-eslint/quotes': [ 'error', 'single' ],
|
|
128
261
|
'@typescript-eslint/semi': [ 'error', 'never' ],
|
|
129
262
|
'@typescript-eslint/unified-signatures': 'error',
|
|
130
|
-
'@typescript-eslint/no-use-before-define': 'off'
|
|
263
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
264
|
+
'@typescript-eslint/array-type': [ 'error', { default: 'array' } ],
|
|
265
|
+
'@typescript-eslint/consistent-indexed-object-style': [ 'error', 'record' ],
|
|
266
|
+
'@typescript-eslint/consistent-type-assertions': [ 'error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' } ],
|
|
267
|
+
'@typescript-eslint/consistent-type-definitions': [ 'error', 'interface' ],
|
|
268
|
+
'@typescript-eslint/consistent-type-imports': [ 'error', { prefer: 'type-imports' } ],
|
|
269
|
+
'@typescript-eslint/method-signature-style': [ 'error', 'property' ],
|
|
270
|
+
'@typescript-eslint/no-empty-interface': [
|
|
271
|
+
'error',
|
|
272
|
+
{
|
|
273
|
+
allowSingleExtends: true
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
'@typescript-eslint/no-extra-non-null-assertion': [ 'error' ],
|
|
277
|
+
'@typescript-eslint/no-extraneous-class': [
|
|
278
|
+
'error',
|
|
279
|
+
{
|
|
280
|
+
allowConstructorOnly: true,
|
|
281
|
+
allowEmpty: false,
|
|
282
|
+
allowStaticOnly: false,
|
|
283
|
+
allowWithDecorator: false
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
'@typescript-eslint/no-inferrable-types': 'error',
|
|
287
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
288
|
+
'@typescript-eslint/prefer-enum-initializers': 'error',
|
|
289
|
+
'keyword-spacing': 'off',
|
|
290
|
+
'@typescript-eslint/keyword-spacing': [ 'error' ],
|
|
291
|
+
'lines-between-class-members': 'off',
|
|
292
|
+
'@typescript-eslint/lines-between-class-members': [ 'error' ],
|
|
293
|
+
'no-throw-literal': 'off',
|
|
294
|
+
'@typescript-eslint/no-throw-literal': [ 'error' ],
|
|
295
|
+
'padding-line-between-statements': 'off',
|
|
296
|
+
'@typescript-eslint/padding-line-between-statements': [
|
|
297
|
+
'error',
|
|
298
|
+
{
|
|
299
|
+
blankLine: 'always',
|
|
300
|
+
prev: '*',
|
|
301
|
+
next: 'return'
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
blankLine: 'always',
|
|
305
|
+
prev: [ 'const', 'let', 'var' ],
|
|
306
|
+
next: '*'
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
blankLine: 'always',
|
|
310
|
+
prev: [ 'case', 'default' ],
|
|
311
|
+
next: '*'
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
blankLine: 'always',
|
|
315
|
+
prev: '*',
|
|
316
|
+
next: [ 'interface', 'type' ]
|
|
317
|
+
}
|
|
318
|
+
],
|
|
319
|
+
'@typescript-eslint/prefer-reduce-type-parameter': 'error'
|
|
131
320
|
}
|
|
132
321
|
}
|
|
133
322
|
]
|
package/vue-typescript.js
CHANGED
package/vue.js
CHANGED
package/typescript-deep.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [ './typescript' ],
|
|
3
|
-
overrides: [
|
|
4
|
-
{
|
|
5
|
-
files: [ '*.ts', '*.tsx' ],
|
|
6
|
-
parserOptions: {
|
|
7
|
-
ecmaVersion: 'latest',
|
|
8
|
-
sourceType: 'module'
|
|
9
|
-
},
|
|
10
|
-
rules: {
|
|
11
|
-
'@typescript-eslint/no-floating-promises': 'error',
|
|
12
|
-
'@typescript-eslint/return-await': [ 'error', 'never' ]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
}
|