@foray1010/eslint-config 12.3.0 → 12.4.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 CHANGED
@@ -3,6 +3,23 @@
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
+ ## [12.4.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@12.3.1...@foray1010/eslint-config@12.4.0) (2024-08-20)
7
+
8
+ ### Features
9
+
10
+ - **eslint-config:** support all hooks in use-deep-compare ([e689bce](https://github.com/foray1010/common-presets/commit/e689bceed67924c5b4fa31066d818fa7f73c27a0))
11
+
12
+ ### Bug Fixes
13
+
14
+ - **deps:** update dependency typescript-eslint to v8 ([e755b3e](https://github.com/foray1010/common-presets/commit/e755b3ef4fe40fa86a1e24b78660dd7911eac5d7))
15
+
16
+ ## [12.3.1](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@12.3.0...@foray1010/eslint-config@12.3.1) (2024-07-25)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **deps:** update dependency eslint-plugin-unicorn to v55 ([eb62a86](https://github.com/foray1010/common-presets/commit/eb62a867cd3a5505195f6434f6e1948ce786c9c4))
21
+ - **eslint-config:** does not work on project without typescript installed ([8c8968d](https://github.com/foray1010/common-presets/commit/8c8968d8c43c368111652b07109782bf4daa0166))
22
+
6
23
  ## [12.3.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@12.2.4...@foray1010/eslint-config@12.3.0) (2024-07-21)
7
24
 
8
25
  ### Features
package/bases/base.mjs CHANGED
@@ -7,8 +7,6 @@ import eslintPluginRegexp from 'eslint-plugin-regexp'
7
7
  import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort'
8
8
  import eslintPluginUnicorn from 'eslint-plugin-unicorn'
9
9
  import globals from 'globals'
10
- // eslint-disable-next-line import-x/no-unresolved
11
- import tseslint from 'typescript-eslint'
12
10
 
13
11
  import {
14
12
  testFileGlobs,
@@ -23,6 +21,8 @@ async function generateTypeScriptConfig() {
23
21
  // typescript plugins are depended on `typescript` package
24
22
  if (!hasDep('typescript')) return []
25
23
 
24
+ // eslint-disable-next-line import-x/no-unresolved
25
+ const tseslint = (await import('typescript-eslint')).default
26
26
  const eslintPluginDeprecation = (await import('eslint-plugin-deprecation'))
27
27
  .default
28
28
  const eslintPluginFunctional = (await import('eslint-plugin-functional'))
@@ -57,17 +57,6 @@ async function generateTypeScriptConfig() {
57
57
  },
58
58
  rules: {
59
59
  ...eslintPluginImportX.configs['typescript']?.rules,
60
- // extend existing rule
61
- '@typescript-eslint/ban-types': [
62
- 'error',
63
- {
64
- types: {
65
- // TypeScript team suggests to use `<T extends {}>` https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#unconstrained-generics-no-longer-assignable-to
66
- '{}': false,
67
- },
68
- extendDefaults: true,
69
- },
70
- ],
71
60
  // separate type exports which allow certain optimizations within compilers
72
61
  '@typescript-eslint/consistent-type-exports': [
73
62
  'error',
@@ -106,6 +95,8 @@ async function generateTypeScriptConfig() {
106
95
  '@typescript-eslint/no-duplicate-enum-values': 'error',
107
96
  // need empty function for react context default value
108
97
  '@typescript-eslint/no-empty-function': 'off',
98
+ // TypeScript team suggests to use `<T extends {}>` https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#unconstrained-generics-no-longer-assignable-to
99
+ '@typescript-eslint/no-empty-object-type': 'off',
109
100
  // when using typescript 5.0 with verbatimModuleSyntax flag on, compiler will not remove import statements with only inline type imports which lead to side effects
110
101
  '@typescript-eslint/no-import-type-side-effects': 'error',
111
102
  // enforce correct usage of `void` type
package/bases/browser.mjs CHANGED
@@ -50,11 +50,11 @@ const browserConfig = [
50
50
  ...(await generateJestDomConfig()),
51
51
  {
52
52
  files: testFileGlobs,
53
- plugins: {
54
- 'testing-library': eslintPluginTestingLibrary,
55
- },
53
+ ...eslintPluginTestingLibrary.configs['flat/dom'],
54
+ },
55
+ {
56
+ files: testFileGlobs,
56
57
  rules: {
57
- ...eslintPluginTestingLibrary.configs['dom']?.rules,
58
58
  // allow to use nodejs modules in tests
59
59
  'import-x/no-nodejs-modules': 'off',
60
60
  },
package/bases/react.mjs CHANGED
@@ -53,18 +53,19 @@ const reactConfig = [
53
53
  {
54
54
  // support package `use-deep-compare`
55
55
  additionalHooks:
56
- '(useDeepCompareCallback|useDeepCompareEffect|useDeepCompareMemo)',
56
+ /^(useDeepCompareCallback|useDeepCompareEffect|useDeepCompareImperativeHandle|useDeepCompareLayoutEffect|useDeepCompareMemo)$/u
57
+ .source,
57
58
  },
58
59
  ],
59
60
  },
60
61
  },
61
62
  {
62
63
  files: testFileGlobs,
63
- plugins: {
64
- 'testing-library': eslintPluginTestingLibrary,
65
- },
64
+ ...eslintPluginTestingLibrary.configs['flat/react'],
65
+ },
66
+ {
67
+ files: testFileGlobs,
66
68
  rules: {
67
- ...eslintPluginTestingLibrary.configs['react']?.rules,
68
69
  // avoid using unnecessary `await` as workaround for `not wrapped in act(...)` warnings
69
70
  'testing-library/no-await-sync-events': [
70
71
  'error',
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": "12.3.0",
4
+ "version": "12.4.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": {
@@ -38,14 +38,14 @@
38
38
  "eslint-plugin-react-hooks": "^4.6.0",
39
39
  "eslint-plugin-regexp": "^2.6.0",
40
40
  "eslint-plugin-simple-import-sort": "^12.0.0",
41
- "eslint-plugin-testing-library": "^6.1.2",
42
- "eslint-plugin-unicorn": "^54.0.0",
41
+ "eslint-plugin-testing-library": "^6.3.0",
42
+ "eslint-plugin-unicorn": "^55.0.0",
43
43
  "globals": "^15.4.0",
44
- "typescript-eslint": "^7.16.1"
44
+ "typescript-eslint": "^8.0.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/confusing-browser-globals": "1.0.3",
48
- "@types/eslint": "8.56.10",
48
+ "@types/eslint": "8.56.11",
49
49
  "@types/eslint__js": "8.42.3"
50
50
  },
51
51
  "peerDependencies": {
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "e751b4ba48732b04545e8f4b99e682cf5ba74dab"
71
+ "gitHead": "fae1085ef22d08177b22034905e40dd23a80b95a"
72
72
  }