From d8d47ce054c7cb877f4fee00f530381d9fad5e75 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Tue, 11 Jan 2022 14:22:56 +0800 Subject: [PATCH] chore: reenable lint for test files (#17979) * chore: reenable lint for test files * fix comments --- superset-frontend/.eslintrc.js | 12 +----------- .../test/dimension/svg/updateTextNode.test.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js index b37c5ff45..a1d110269 100644 --- a/superset-frontend/.eslintrc.js +++ b/superset-frontend/.eslintrc.js @@ -159,6 +159,7 @@ module.exports = { '*.stories.jsx', 'fixtures.*', ], + excludedFiles: 'cypress-base/cypress/**/*', plugins: ['jest', 'jest-dom', 'no-only-tests', 'testing-library'], env: { 'jest/globals': true, @@ -180,17 +181,6 @@ module.exports = { ], 'no-only-tests/no-only-tests': 'error', 'max-classes-per-file': 0, - '@typescript-eslint/no-non-null-assertion': 0, - // TODO: disabled temporarily, re-enable after monorepo - 'jest/consistent-test-it': 'error', - 'jest/expect-expect': 0, - 'jest/no-test-prefixes': 0, - 'jest/valid-expect-in-promise': 0, - 'jest/valid-expect': 0, - 'jest/valid-title': 0, - 'jest-dom/prefer-to-have-attribute': 0, - 'jest-dom/prefer-to-have-text-content': 0, - 'jest-dom/prefer-to-have-style': 0, }, }, ], diff --git a/superset-frontend/packages/superset-ui-core/test/dimension/svg/updateTextNode.test.ts b/superset-frontend/packages/superset-ui-core/test/dimension/svg/updateTextNode.test.ts index f33a4db10..8b1cdb146 100644 --- a/superset-frontend/packages/superset-ui-core/test/dimension/svg/updateTextNode.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/dimension/svg/updateTextNode.test.ts @@ -17,6 +17,11 @@ * under the License. */ +// do not use react-testing-library in plugins +/* eslint-disable jest-dom/prefer-to-have-attribute */ +/* eslint-disable jest-dom/prefer-to-have-text-content */ +/* eslint-disable jest-dom/prefer-to-have-style */ + import updateTextNode from '../../../src/dimension/svg/updateTextNode'; import createTextNode from '../../../src/dimension/svg/createTextNode'; @@ -91,3 +96,7 @@ describe('updateTextNode(node, options)', () => { expect(node.textContent).toEqual(''); }); }); + +/* eslint-enable jest-dom/prefer-to-have-attribute */ +/* eslint-enable jest-dom/prefer-to-have-text-content */ +/* eslint-enable jest-dom/prefer-to-have-style */