@foray1010/eslint-config 7.1.0 → 7.2.0
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/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/presets/base.js +23 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.2.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.1.0...@foray1010/eslint-config@7.2.0) (2022-07-27)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **eslint-config:** reenable @typescript-eslint/restrict-template-expressions ([772d768](https://github.com/foray1010/common-presets/commit/772d76811189b79efc0c49dcb4225ca6741da26c))
|
|
11
|
+
- **eslint-config:** reenable @typescript-eslint/unbound-method ([8451f92](https://github.com/foray1010/common-presets/commit/8451f92d0a983a84bbb7181d75652bab84e6bedc))
|
|
12
|
+
- **eslint-config:** separate type imports which allow certain optimizations within compilers ([15a15c9](https://github.com/foray1010/common-presets/commit/15a15c9f57dc9b58e52109d523b95df15c725b8e))
|
|
13
|
+
|
|
6
14
|
## [7.1.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.0.1...@foray1010/eslint-config@7.1.0) (2022-06-14)
|
|
7
15
|
|
|
8
16
|
### Features
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@foray1010/eslint-config",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.2.0",
|
|
5
5
|
"homepage": "https://github.com/foray1010/common-presets/tree/master/packages/eslint-config#readme",
|
|
6
6
|
"bugs": "https://github.com/foray1010/common-presets/issues",
|
|
7
7
|
"repository": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "6ce675a1301bd6b284c44406938f33efda4839fa"
|
|
52
52
|
}
|
package/presets/base.js
CHANGED
|
@@ -149,6 +149,11 @@ module.exports = {
|
|
|
149
149
|
},
|
|
150
150
|
plugins: ['@typescript-eslint/eslint-plugin'],
|
|
151
151
|
rules: {
|
|
152
|
+
// separate type imports which allow certain optimizations within compilers
|
|
153
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
154
|
+
'error',
|
|
155
|
+
{ prefer: 'type-imports' },
|
|
156
|
+
],
|
|
152
157
|
// encourage to use private accessibility modifier
|
|
153
158
|
'@typescript-eslint/explicit-member-accessibility': [
|
|
154
159
|
'error',
|
|
@@ -183,8 +188,6 @@ module.exports = {
|
|
|
183
188
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
184
189
|
// some third party packages doesn't offer typings
|
|
185
190
|
'@typescript-eslint/no-unsafe-return': 'off',
|
|
186
|
-
// must remove unused variables and types
|
|
187
|
-
'@typescript-eslint/no-unused-vars': 'error',
|
|
188
191
|
// do not block functions referring to other functions
|
|
189
192
|
'@typescript-eslint/no-use-before-define': [
|
|
190
193
|
'error',
|
|
@@ -205,11 +208,24 @@ module.exports = {
|
|
|
205
208
|
],
|
|
206
209
|
// fault alarms in 4.29.3
|
|
207
210
|
'@typescript-eslint/restrict-plus-operands': 'off',
|
|
208
|
-
//
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
// allow primitive value in template string
|
|
212
|
+
'@typescript-eslint/restrict-template-expressions': [
|
|
213
|
+
'error',
|
|
214
|
+
{
|
|
215
|
+
allowNumber: true,
|
|
216
|
+
allowBoolean: true,
|
|
217
|
+
allowAny: true, // mistakenly recognize string as any in 4.29.3
|
|
218
|
+
allowNullish: true,
|
|
219
|
+
allowRegExp: true,
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
// ignore static function as those are not supposed to use `this`
|
|
223
|
+
'@typescript-eslint/unbound-method': [
|
|
224
|
+
'error',
|
|
225
|
+
{
|
|
226
|
+
ignoreStatic: true,
|
|
227
|
+
},
|
|
228
|
+
],
|
|
213
229
|
},
|
|
214
230
|
overrides: [
|
|
215
231
|
{
|