@foray1010/eslint-config 6.2.0 → 6.3.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,17 @@
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
+ ## [6.3.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@6.2.0...@foray1010/eslint-config@6.3.0) (2022-04-25)
7
+
8
+ ### Features
9
+
10
+ - enable testing-library/no-global-regexp-flag-in-query ([6343da2](https://github.com/foray1010/common-presets/commit/6343da2038fca9c5ef03aa2ae02129f42ff00b82))
11
+ - reenable testing-library/no-await-sync-events for fire events only ([966eb24](https://github.com/foray1010/common-presets/commit/966eb24ad9c3f7b15cb3c856de61516dace2075b))
12
+
13
+ ### Bug Fixes
14
+
15
+ - **eslint-config:** use jsx-runtime config from react plugin ([806e1ab](https://github.com/foray1010/common-presets/commit/806e1ab25ac42b0bb5a269e01eef659bc12aa616))
16
+
6
17
  ## [6.2.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@6.1.3...@foray1010/eslint-config@6.2.0) (2022-04-05)
7
18
 
8
19
  ### 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": "6.2.0",
4
+ "version": "6.3.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": {
@@ -36,7 +36,7 @@
36
36
  "eslint-plugin-react": "^7.23.2",
37
37
  "eslint-plugin-react-hooks": "^4.2.0",
38
38
  "eslint-plugin-simple-import-sort": "^7.0.0",
39
- "eslint-plugin-testing-library": "^5.0.0"
39
+ "eslint-plugin-testing-library": "^5.3.1"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "eslint": ">=7.28.0 <9",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "4ef900b508bad3ab5f5c29a904ddd9021af43310"
51
+ "gitHead": "7fe04c3ba7497afa72c5cd089519ccb107925882"
52
52
  }
package/presets/react.js CHANGED
@@ -3,7 +3,11 @@
3
3
  const { testFileGlobs } = require('./utils/testUtil')
4
4
 
5
5
  module.exports = {
6
- extends: ['plugin:react/recommended', 'eslint-config-prettier'],
6
+ extends: [
7
+ 'plugin:react/recommended',
8
+ 'plugin:react/jsx-runtime',
9
+ 'eslint-config-prettier',
10
+ ],
7
11
  parserOptions: {
8
12
  sourceType: 'module',
9
13
  ecmaFeatures: {
@@ -32,8 +36,6 @@ module.exports = {
32
36
  ],
33
37
  // rely on typescript instead, and it does not work well with types that are imported from elsewhere
34
38
  'react/prop-types': 'off',
35
- // because we are using automatic react runtime
36
- 'react/react-in-jsx-scope': 'off',
37
39
  'react-hooks/rules-of-hooks': 'error',
38
40
  'react-hooks/exhaustive-deps': [
39
41
  'error',
@@ -51,15 +53,16 @@ module.exports = {
51
53
  plugins: ['eslint-plugin-jest-dom', 'eslint-plugin-testing-library'],
52
54
  rules: {
53
55
  // avoid using unnecessary `await` as workaround for `not wrapped in act(...)` warnings
54
- 'testing-library/no-wait-for-empty-callback': 'error',
55
- // avoid side effects inside `waitFor`
56
- 'testing-library/no-wait-for-snapshot': 'error',
56
+ 'testing-library/no-await-sync-events': [
57
+ 'error',
58
+ {
59
+ eventModules: ['fire-event'],
60
+ },
61
+ ],
62
+ // global flag /g holds state and might cause false-positives while querying for elements
63
+ 'testing-library/no-global-regexp-flag-in-query': 'error',
57
64
  // explicitly assert the element to prevent reader missed the test cases
58
65
  'testing-library/prefer-explicit-assert': 'error',
59
- // better error message
60
- 'testing-library/prefer-presence-queries': 'error',
61
- // using `screen` to avoid name collision
62
- 'testing-library/prefer-screen-queries': 'error',
63
66
  // prefer @testing-library/user-event over fireEvent
64
67
  'testing-library/prefer-user-event': 'error',
65
68
  // as `wait` is deprecated