Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: import value name from root of superset-ui/core #17947

Merged
merged 13 commits into from
Jan 8, 2022
Merged
5 changes: 3 additions & 2 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ module.exports = {
moduleDirectory: ['node_modules', '.'],
},
},
// Allow only core/src and core/test, avoid import modules from lib
'import/internal-regex': /^@superset-ui\/core\/(src|test)\/.*/,
// only allow import from top level of module
'import/core-modules': importCoreModules,
react: {
version: 'detect',
Expand Down Expand Up @@ -156,6 +155,8 @@ module.exports = {
'*.test.tsx',
'*.test.js',
'*.test.jsx',
'*.stories.tsx',
'*.stories.jsx',
'fixtures.*',
],
plugins: ['jest', 'jest-dom', 'no-only-tests', 'testing-library'],
Expand Down
16 changes: 6 additions & 10 deletions superset-frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,20 @@

module.exports = {
testRegex: '\\/(spec|src|plugins|packages)\\/.*(_spec|\\.test)\\.[jt]sx?$',
testPathIgnorePatterns: [
'packages\\/generator-superset\\/.*',
'/node_modules/',
],
moduleNameMapper: {
'\\.(css|less|geojson)$': '<rootDir>/spec/__mocks__/mockExportObject.js',
'\\.(gif|ttf|eot|png|jpg)$': '<rootDir>/spec/__mocks__/mockExportString.js',
'\\.svg$': '<rootDir>/spec/__mocks__/svgrMock.tsx',
'^src/(.*)$': '<rootDir>/src/$1',
'^spec/(.*)$': '<rootDir>/spec/$1',
// mapping to souce code instead of lib or esm module
'@superset-ui/(((?!(core/src)).)*)$':
'<rootDir>/node_modules/@superset-ui/$1/src',
'@superset-ui/core/src/(.*)$':
'<rootDir>/node_modules/@superset-ui/core/src/$1',
// mapping plugins of superset-ui to souce code
'@superset-ui/(.*)$': '<rootDir>/node_modules/@superset-ui/$1/src',
},
testEnvironment: 'jsdom',
modulePathIgnorePatterns: ['<rootDir>/temporary_superset_ui'],
modulePathIgnorePatterns: [
'<rootDir>/temporary_superset_ui',
'<rootDir>/packages/generator-superset',
],
setupFilesAfterEnv: ['<rootDir>/spec/helpers/setup.ts'],
testURL: 'http://localhost',
collectCoverageFrom: [
Expand Down
Loading