From 51f836e87b94a2253469612ccd1ffdda18ecdb54 Mon Sep 17 00:00:00 2001 From: Gerrit Alex Date: Fri, 22 Oct 2021 20:08:46 +0200 Subject: [PATCH] fix: disable eslint-plugin-testing-library temporarily - still incompatible with eslint v8 - see https://github.com/testing-library/eslint-plugin-testing-library/pull/499 --- .../overrides/__snapshots__/jest.test.js.snap | 224 ------------------ src/overrides/jest.js | 4 +- 2 files changed, 2 insertions(+), 226 deletions(-) diff --git a/src/__tests__/overrides/__snapshots__/jest.test.js.snap b/src/__tests__/overrides/__snapshots__/jest.test.js.snap index 1890df5f..c9808f8a 100644 --- a/src/__tests__/overrides/__snapshots__/jest.test.js.snap +++ b/src/__tests__/overrides/__snapshots__/jest.test.js.snap @@ -17,7 +17,6 @@ Object { }, "plugins": Array [ "jest", - "testing-library", ], "rules": Object { "import/no-namespace": "off", @@ -76,32 +75,6 @@ Object { "require-unicode-regexp": "off", "sonarjs/no-duplicate-string": "off", "sonarjs/no-identical-functions": "off", - "testing-library/await-async-query": "error", - "testing-library/await-async-utils": "error", - "testing-library/await-fire-event": "off", - "testing-library/consistent-data-testid": "off", - "testing-library/no-await-sync-events": "error", - "testing-library/no-await-sync-query": "error", - "testing-library/no-container": "warn", - "testing-library/no-debug": "error", - "testing-library/no-dom-import": "off", - "testing-library/no-manual-cleanup": "error", - "testing-library/no-node-access": "warn", - "testing-library/no-promise-in-fire-event": "error", - "testing-library/no-render-in-setup": "off", - "testing-library/no-unnecessary-act": "error", - "testing-library/no-wait-for-empty-callback": "error", - "testing-library/no-wait-for-multiple-assertions": "error", - "testing-library/no-wait-for-side-effects": "error", - "testing-library/no-wait-for-snapshot": "error", - "testing-library/prefer-explicit-assert": "warn", - "testing-library/prefer-find-by": "warn", - "testing-library/prefer-presence-queries": "error", - "testing-library/prefer-query-by-disappearance": "error", - "testing-library/prefer-screen-queries": "error", - "testing-library/prefer-user-event": "error", - "testing-library/prefer-wait-for": "warn", - "testing-library/render-result-naming-convention": "off", }, "settings": Object { "jest": Object { @@ -128,7 +101,6 @@ Object { }, "plugins": Array [ "jest", - "testing-library", ], "rules": Object { "import/no-namespace": "off", @@ -187,32 +159,7 @@ Object { "require-unicode-regexp": "off", "sonarjs/no-duplicate-string": "off", "sonarjs/no-identical-functions": "off", - "testing-library/await-async-query": "error", - "testing-library/await-async-utils": "error", - "testing-library/await-fire-event": "off", - "testing-library/consistent-data-testid": "off", - "testing-library/no-await-sync-events": "error", - "testing-library/no-await-sync-query": "error", - "testing-library/no-container": "warn", - "testing-library/no-debug": "error", - "testing-library/no-dom-import": "off", "testing-library/no-manual-cleanup": "off", - "testing-library/no-node-access": "warn", - "testing-library/no-promise-in-fire-event": "error", - "testing-library/no-render-in-setup": "off", - "testing-library/no-unnecessary-act": "error", - "testing-library/no-wait-for-empty-callback": "error", - "testing-library/no-wait-for-multiple-assertions": "error", - "testing-library/no-wait-for-side-effects": "error", - "testing-library/no-wait-for-snapshot": "error", - "testing-library/prefer-explicit-assert": "warn", - "testing-library/prefer-find-by": "warn", - "testing-library/prefer-presence-queries": "error", - "testing-library/prefer-query-by-disappearance": "error", - "testing-library/prefer-screen-queries": "error", - "testing-library/prefer-user-event": "error", - "testing-library/prefer-wait-for": "warn", - "testing-library/render-result-naming-convention": "off", }, "settings": Object { "jest": Object { @@ -338,7 +285,6 @@ Object { "plugins": Array [ "jest", "jest-dom", - "testing-library", ], "rules": Object { "@typescript-eslint/explicit-member-accessibility": "off", @@ -416,35 +362,6 @@ Object { "require-unicode-regexp": "off", "sonarjs/no-duplicate-string": "off", "sonarjs/no-identical-functions": "off", - "testing-library/await-async-query": "error", - "testing-library/await-async-utils": "error", - "testing-library/await-fire-event": "off", - "testing-library/consistent-data-testid": "off", - "testing-library/no-await-sync-events": "error", - "testing-library/no-await-sync-query": "error", - "testing-library/no-container": "warn", - "testing-library/no-debug": "error", - "testing-library/no-dom-import": Array [ - "warn", - "react", - ], - "testing-library/no-manual-cleanup": "error", - "testing-library/no-node-access": "warn", - "testing-library/no-promise-in-fire-event": "error", - "testing-library/no-render-in-setup": "off", - "testing-library/no-unnecessary-act": "error", - "testing-library/no-wait-for-empty-callback": "error", - "testing-library/no-wait-for-multiple-assertions": "error", - "testing-library/no-wait-for-side-effects": "error", - "testing-library/no-wait-for-snapshot": "error", - "testing-library/prefer-explicit-assert": "warn", - "testing-library/prefer-find-by": "warn", - "testing-library/prefer-presence-queries": "error", - "testing-library/prefer-query-by-disappearance": "error", - "testing-library/prefer-screen-queries": "error", - "testing-library/prefer-user-event": "error", - "testing-library/prefer-wait-for": "warn", - "testing-library/render-result-naming-convention": "off", }, "settings": Object { "jest": Object { @@ -476,7 +393,6 @@ Object { "plugins": Array [ "jest", "jest-dom", - "testing-library", ], "rules": Object { "@typescript-eslint/explicit-member-accessibility": "off", @@ -554,35 +470,6 @@ Object { "require-unicode-regexp": "off", "sonarjs/no-duplicate-string": "off", "sonarjs/no-identical-functions": "off", - "testing-library/await-async-query": "error", - "testing-library/await-async-utils": "error", - "testing-library/await-fire-event": "off", - "testing-library/consistent-data-testid": "off", - "testing-library/no-await-sync-events": "error", - "testing-library/no-await-sync-query": "error", - "testing-library/no-container": "warn", - "testing-library/no-debug": "error", - "testing-library/no-dom-import": Array [ - "warn", - "react", - ], - "testing-library/no-manual-cleanup": "error", - "testing-library/no-node-access": "warn", - "testing-library/no-promise-in-fire-event": "error", - "testing-library/no-render-in-setup": "off", - "testing-library/no-unnecessary-act": "error", - "testing-library/no-wait-for-empty-callback": "error", - "testing-library/no-wait-for-multiple-assertions": "error", - "testing-library/no-wait-for-side-effects": "error", - "testing-library/no-wait-for-snapshot": "error", - "testing-library/prefer-explicit-assert": "warn", - "testing-library/prefer-find-by": "warn", - "testing-library/prefer-presence-queries": "error", - "testing-library/prefer-query-by-disappearance": "error", - "testing-library/prefer-screen-queries": "error", - "testing-library/prefer-user-event": "error", - "testing-library/prefer-wait-for": "warn", - "testing-library/render-result-naming-convention": "off", }, "settings": Object { "jest": Object { @@ -613,7 +500,6 @@ Object { "plugins": Array [ "jest", "jest-dom", - "testing-library", ], "rules": Object { "import/no-namespace": "off", @@ -685,35 +571,6 @@ Object { "require-unicode-regexp": "off", "sonarjs/no-duplicate-string": "off", "sonarjs/no-identical-functions": "off", - "testing-library/await-async-query": "error", - "testing-library/await-async-utils": "error", - "testing-library/await-fire-event": "off", - "testing-library/consistent-data-testid": "off", - "testing-library/no-await-sync-events": "error", - "testing-library/no-await-sync-query": "error", - "testing-library/no-container": "warn", - "testing-library/no-debug": "error", - "testing-library/no-dom-import": Array [ - "warn", - "react", - ], - "testing-library/no-manual-cleanup": "error", - "testing-library/no-node-access": "warn", - "testing-library/no-promise-in-fire-event": "error", - "testing-library/no-render-in-setup": "off", - "testing-library/no-unnecessary-act": "error", - "testing-library/no-wait-for-empty-callback": "error", - "testing-library/no-wait-for-multiple-assertions": "error", - "testing-library/no-wait-for-side-effects": "error", - "testing-library/no-wait-for-snapshot": "error", - "testing-library/prefer-explicit-assert": "warn", - "testing-library/prefer-find-by": "warn", - "testing-library/prefer-presence-queries": "error", - "testing-library/prefer-query-by-disappearance": "error", - "testing-library/prefer-screen-queries": "error", - "testing-library/prefer-user-event": "error", - "testing-library/prefer-wait-for": "warn", - "testing-library/render-result-naming-convention": "off", }, "settings": Object { "jest": Object { @@ -744,7 +601,6 @@ Object { "plugins": Array [ "jest", "jest-dom", - "testing-library", ], "rules": Object { "@typescript-eslint/explicit-member-accessibility": "off", @@ -820,32 +676,6 @@ Object { "require-unicode-regexp": "off", "sonarjs/no-duplicate-string": "off", "sonarjs/no-identical-functions": "off", - "testing-library/await-async-query": "error", - "testing-library/await-async-utils": "error", - "testing-library/await-fire-event": "off", - "testing-library/consistent-data-testid": "off", - "testing-library/no-await-sync-events": "error", - "testing-library/no-await-sync-query": "error", - "testing-library/no-container": "warn", - "testing-library/no-debug": "error", - "testing-library/no-dom-import": "off", - "testing-library/no-manual-cleanup": "error", - "testing-library/no-node-access": "warn", - "testing-library/no-promise-in-fire-event": "error", - "testing-library/no-render-in-setup": "off", - "testing-library/no-unnecessary-act": "error", - "testing-library/no-wait-for-empty-callback": "error", - "testing-library/no-wait-for-multiple-assertions": "error", - "testing-library/no-wait-for-side-effects": "error", - "testing-library/no-wait-for-snapshot": "error", - "testing-library/prefer-explicit-assert": "warn", - "testing-library/prefer-find-by": "warn", - "testing-library/prefer-presence-queries": "error", - "testing-library/prefer-query-by-disappearance": "error", - "testing-library/prefer-screen-queries": "error", - "testing-library/prefer-user-event": "error", - "testing-library/prefer-wait-for": "warn", - "testing-library/render-result-naming-convention": "off", }, "settings": Object { "jest": Object { @@ -873,7 +703,6 @@ Object { "plugins": Array [ "jest", "jest-dom", - "testing-library", ], "rules": Object { "import/no-namespace": "off", @@ -943,32 +772,6 @@ Object { "require-unicode-regexp": "off", "sonarjs/no-duplicate-string": "off", "sonarjs/no-identical-functions": "off", - "testing-library/await-async-query": "error", - "testing-library/await-async-utils": "error", - "testing-library/await-fire-event": "off", - "testing-library/consistent-data-testid": "off", - "testing-library/no-await-sync-events": "error", - "testing-library/no-await-sync-query": "error", - "testing-library/no-container": "warn", - "testing-library/no-debug": "error", - "testing-library/no-dom-import": "off", - "testing-library/no-manual-cleanup": "error", - "testing-library/no-node-access": "warn", - "testing-library/no-promise-in-fire-event": "error", - "testing-library/no-render-in-setup": "off", - "testing-library/no-unnecessary-act": "error", - "testing-library/no-wait-for-empty-callback": "error", - "testing-library/no-wait-for-multiple-assertions": "error", - "testing-library/no-wait-for-side-effects": "error", - "testing-library/no-wait-for-snapshot": "error", - "testing-library/prefer-explicit-assert": "warn", - "testing-library/prefer-find-by": "warn", - "testing-library/prefer-presence-queries": "error", - "testing-library/prefer-query-by-disappearance": "error", - "testing-library/prefer-screen-queries": "error", - "testing-library/prefer-user-event": "error", - "testing-library/prefer-wait-for": "warn", - "testing-library/render-result-naming-convention": "off", }, "settings": Object { "jest": Object { @@ -1279,7 +1082,6 @@ Object { }, "plugins": Array [ "jest", - "testing-library", ], "rules": Object { "import/no-namespace": "off", @@ -1338,32 +1140,6 @@ Object { "require-unicode-regexp": "off", "sonarjs/no-duplicate-string": "off", "sonarjs/no-identical-functions": "off", - "testing-library/await-async-query": "error", - "testing-library/await-async-utils": "error", - "testing-library/await-fire-event": "off", - "testing-library/consistent-data-testid": "off", - "testing-library/no-await-sync-events": "error", - "testing-library/no-await-sync-query": "error", - "testing-library/no-container": "warn", - "testing-library/no-debug": "error", - "testing-library/no-dom-import": "off", - "testing-library/no-manual-cleanup": "error", - "testing-library/no-node-access": "warn", - "testing-library/no-promise-in-fire-event": "error", - "testing-library/no-render-in-setup": "off", - "testing-library/no-unnecessary-act": "error", - "testing-library/no-wait-for-empty-callback": "error", - "testing-library/no-wait-for-multiple-assertions": "error", - "testing-library/no-wait-for-side-effects": "error", - "testing-library/no-wait-for-snapshot": "error", - "testing-library/prefer-explicit-assert": "warn", - "testing-library/prefer-find-by": "warn", - "testing-library/prefer-presence-queries": "error", - "testing-library/prefer-query-by-disappearance": "error", - "testing-library/prefer-screen-queries": "error", - "testing-library/prefer-user-event": "error", - "testing-library/prefer-wait-for": "warn", - "testing-library/render-result-naming-convention": "off", }, "settings": Object { "jest": Object { diff --git a/src/overrides/jest.js b/src/overrides/jest.js index 6803b77d..b858d013 100644 --- a/src/overrides/jest.js +++ b/src/overrides/jest.js @@ -57,14 +57,14 @@ const createJestOverride = ({ const plugins = [ 'jest', hasJestDom && 'jest-dom', - hasTestingLibrary && 'testing-library', + // hasTestingLibrary && 'testing-library', ...customPlugins, ].filter(Boolean); const rules = { ...jestRules, ...(hasJestDom ? jestDomRules : null), - ...(hasTestingLibrary ? getTestingLibraryRules({ react }) : null), + // ...(hasTestingLibrary ? getTestingLibraryRules({ react }) : null), ...getTestOverrides({ typescript, react }), ...customRules, };