@foray1010/eslint-config 7.1.0 → 7.3.1

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 CHANGED
@@ -3,6 +3,26 @@
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.3.1](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.3.0...@foray1010/eslint-config@7.3.1) (2022-07-28)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **eslint-config:** allow arrow function in object ([2b7549b](https://github.com/foray1010/common-presets/commit/2b7549ba63f8b9697300becb99504b736c833c23))
11
+
12
+ ## [7.3.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.2.0...@foray1010/eslint-config@7.3.0) (2022-07-28)
13
+
14
+ ### Features
15
+
16
+ - **eslint-config:** use jest/unbound-method for tests ([babe1d7](https://github.com/foray1010/common-presets/commit/babe1d7f9f9f208f60cb08e5ec52ac6b93136644))
17
+
18
+ ## [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)
19
+
20
+ ### Features
21
+
22
+ - **eslint-config:** reenable @typescript-eslint/restrict-template-expressions ([772d768](https://github.com/foray1010/common-presets/commit/772d76811189b79efc0c49dcb4225ca6741da26c))
23
+ - **eslint-config:** reenable @typescript-eslint/unbound-method ([8451f92](https://github.com/foray1010/common-presets/commit/8451f92d0a983a84bbb7181d75652bab84e6bedc))
24
+ - **eslint-config:** separate type imports which allow certain optimizations within compilers ([15a15c9](https://github.com/foray1010/common-presets/commit/15a15c9f57dc9b58e52109d523b95df15c725b8e))
25
+
6
26
  ## [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
27
 
8
28
  ### 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.1.0",
4
+ "version": "7.3.1",
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": "575dc4e4b5d4d3cbb4f2a66f482baffa7655c1b5"
51
+ "gitHead": "cc2b4de0c590bf0c168149ca38e5c49c384a9b3d"
52
52
  }
package/presets/base.js CHANGED
@@ -84,13 +84,7 @@ module.exports = {
84
84
  // do not enforce JSDoc for internal methods
85
85
  'jsdoc/require-jsdoc': 'off',
86
86
  // avoid assigning anonymous function to object key which is harder to trace when debug
87
- 'object-shorthand': [
88
- 'error',
89
- 'always',
90
- {
91
- avoidExplicitReturnArrows: true,
92
- },
93
- ],
87
+ 'object-shorthand': ['error', 'always'],
94
88
  // auto sort export statements
95
89
  'simple-import-sort/exports': 'error',
96
90
  // auto sort import statements
@@ -149,6 +143,11 @@ module.exports = {
149
143
  },
150
144
  plugins: ['@typescript-eslint/eslint-plugin'],
151
145
  rules: {
146
+ // separate type imports which allow certain optimizations within compilers
147
+ '@typescript-eslint/consistent-type-imports': [
148
+ 'error',
149
+ { prefer: 'type-imports' },
150
+ ],
152
151
  // encourage to use private accessibility modifier
153
152
  '@typescript-eslint/explicit-member-accessibility': [
154
153
  'error',
@@ -183,8 +182,6 @@ module.exports = {
183
182
  '@typescript-eslint/no-unsafe-member-access': 'off',
184
183
  // some third party packages doesn't offer typings
185
184
  '@typescript-eslint/no-unsafe-return': 'off',
186
- // must remove unused variables and types
187
- '@typescript-eslint/no-unused-vars': 'error',
188
185
  // do not block functions referring to other functions
189
186
  '@typescript-eslint/no-use-before-define': [
190
187
  'error',
@@ -205,11 +202,22 @@ module.exports = {
205
202
  ],
206
203
  // fault alarms in 4.29.3
207
204
  '@typescript-eslint/restrict-plus-operands': 'off',
208
- // 1. mistakenly recognize string as any in 4.29.3
209
- // 2. allow `any` to be used in template string
210
- '@typescript-eslint/restrict-template-expressions': 'off',
211
- // redundant for composing functions
212
- '@typescript-eslint/unbound-method': 'off',
205
+ // allow primitive value in template string
206
+ '@typescript-eslint/restrict-template-expressions': [
207
+ 'error',
208
+ {
209
+ allowNumber: true,
210
+ allowBoolean: true,
211
+ allowAny: true, // mistakenly recognize string as any in 4.29.3
212
+ allowNullish: true,
213
+ allowRegExp: true,
214
+ },
215
+ ],
216
+ // ignore static function as those are not supposed to use `this`
217
+ '@typescript-eslint/unbound-method': [
218
+ 'error',
219
+ { ignoreStatic: true },
220
+ ],
213
221
  },
214
222
  overrides: [
215
223
  {
@@ -217,6 +225,10 @@ module.exports = {
217
225
  rules: {
218
226
  // doesn't work with jest.fn<void>()
219
227
  '@typescript-eslint/no-invalid-void-type': 'off',
228
+ // replace by jest/unbound-method
229
+ '@typescript-eslint/unbound-method': 'off',
230
+ // allow passing an unbound method to `expect` calls
231
+ 'jest/unbound-method': ['error', { ignoreStatic: true }],
220
232
  },
221
233
  },
222
234
  ],