Skip to content

Commit

Permalink
refactor(monorepo): frontend code cleanup after monorepo (#17639)
Browse files Browse the repository at this point in the history
* chore: frontend cleanup

* remove unused files

* remove stylelint

* arrange tsconfig

* updates
  • Loading branch information
zhaoyongjie authored Dec 4, 2021
1 parent 05752e3 commit 4306289
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 170 deletions.
2 changes: 0 additions & 2 deletions superset-frontend/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
const path = require('path');

// Superset's webpack.config.js
const customConfig = require('../webpack.config.js');

Expand Down
8 changes: 0 additions & 8 deletions superset-frontend/jsconfig.json

This file was deleted.

17 changes: 0 additions & 17 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,6 @@
"last 3 safari versions",
"last 3 edge versions"
],
"stylelint": {
"rules": {
"block-opening-brace-space-before": "always",
"no-missing-end-of-source-newline": "never",
"rule-empty-line-before": [
"always",
{
"except": [
"first-nested"
],
"ignore": [
"after-comment"
]
}
]
}
},
"dependencies": {
"@ant-design/icons": "^4.2.2",
"@babel/runtime-corejs3": "^7.12.5",
Expand Down
12 changes: 0 additions & 12 deletions superset-frontend/packages/superset-ui-demo/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const packages = readdirSync(basePath).filter(name => {
return stat.isSymbolicLink();
});

const rootPath = path.resolve(__dirname, '../../../');

const PLUGIN_PACKAGES_PATH_REGEXP = new RegExp(
`${path.resolve(
__dirname,
Expand Down Expand Up @@ -64,16 +62,6 @@ module.exports = {
),
});

// todo: remove hard code after move storybook to superset repo.
config.resolve.alias['@emotion/styled'] = path.resolve(
rootPath,
'./node_modules/@emotion/styled',
);
config.resolve.alias['@emotion/core'] = path.resolve(
rootPath,
'./node_modules/@emotion/core',
);

config.devtool = 'eval-cheap-module-source-map';
config.devServer = {
...config.devServer,
Expand Down
16 changes: 0 additions & 16 deletions superset-frontend/packages/superset-ui-demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,12 @@
"rootDir": "../../",
"emitDeclarationOnly": false,
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"noEmit": false,
"baseUrl": "../../",
"paths": {
"@superset-ui/core": ["./packages/superset-ui-core/src"],
"@superset-ui/chart-controls": [
"./packages/superset-ui-chart-controls/src"
],
"@superset-ui/legacy-plugin-chart-*": [
"./plugins/legacy-plugin-chart-*/src"
],
"@superset-ui/legacy-preset-chart-*": [
"./plugins/legacy-preset-chart-*/src"
],
"@superset-ui/plugin-chart-*": ["./plugins/plugin-chart-*/src"],
"@superset-ui/preset-chart-*": ["./plugins/preset-chart-*/src"],
}
},
"exclude": ["node_modules"],
"include": [
"storybook",
"../**/src",
Expand Down
90 changes: 0 additions & 90 deletions superset-frontend/scripts/check_license.sh

This file was deleted.

63 changes: 38 additions & 25 deletions superset-frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"composite": true,
"declaration": true,
"declarationMap": true,
"esModuleInterop": false,
"forceConsistentCasingInFileNames": true,
"importHelpers": false,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"moduleResolution": "node",
"noEmitOnError": true,
/* Type Checking */
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"outDir": "./dist",
"pretty": true,
"strictNullChecks": true,

/* Modules */
"baseUrl": ".",
"module": "esnext",
"moduleResolution": "node",
"paths": {
"@superset-ui/core": ["./packages/superset-ui-core/src"],
"@superset-ui/chart-controls": [
Expand All @@ -33,20 +24,42 @@
],
"@superset-ui/plugin-chart-*": ["./plugins/plugin-chart-*/src"],
"@superset-ui/preset-chart-*": ["./plugins/preset-chart-*/src"],
// for supressing errors caused by incompatible @types/react when `npm link`
// Ref: https://github.com/Microsoft/typescript/issues/6496#issuecomment-384786222
"react": ["./node_modules/@types/react", "react"]
},
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"target": "esnext",
"types": [
"@emotion/react/types/css-prop",
"jest",
"@testing-library/jest-dom"
]
],

/* Emit */
"declaration": true,
"declarationMap": true,
"importHelpers": false,
"noEmitOnError": true,
"outDir": "./dist",
"sourceMap": true,

/* JavaScript Support */
"allowJs": true,

/* Interop Constraints */
"allowSyntheticDefaultImports": true,
"esModuleInterop": false,
"forceConsistentCasingInFileNames": true,

/* Backwards Compatibility */
"suppressImplicitAnyIndexErrors": true,

/* Language and Environment */
"target": "esnext",
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],

/* Projects */
"composite": true,

/* Completeness */
"skipLibCheck": true
},
"include": [
"./src/**/*",
Expand Down

0 comments on commit 4306289

Please sign in to comment.