From b0209e5b3e4df6dd308b29668fa494e324ea6756 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 2 Nov 2022 18:33:28 -0700 Subject: [PATCH] Add lint to editor --- packages/editor/package.json | 5 +++-- packages/editor/src/classes/action/capability/index.ts | 2 +- packages/editor/src/components/toolbar/index.tsx | 2 +- packages/editor/src/components/warning-dialog/index.tsx | 2 +- packages/editor/webpack.prod.js | 1 + 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/editor/package.json b/packages/editor/package.json index 6b0eb4c1..dd7ea00f 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -6,7 +6,7 @@ "build": "webpack --config webpack.prod.js", "playground": "webpack serve --config webpack.playground.js", "cy:run": "cypress run", - "lint": "eslint src", + "lint": "eslint src --ext js,ts,tsx", "test:integration": "start-server-and-test 'yarn playground' http-get://localhost:8081 'yarn cy:run'", "test": "yarn test:integration", "test:unit": "jest ./test/unit/* --detectOpenHandles", @@ -28,6 +28,7 @@ "copy-webpack-plugin": "^10.2.1", "css-loader": "^6.7.1", "cypress": "^10.11.0", + "eslint": "^7.14.0", "cypress-image-snapshot": "^4.0.1", "eslint-config-prettier": "^8.5.0", "eslint-plugin-react": "^7.31.10", @@ -62,4 +63,4 @@ "react-intl": "^6.2.1", "styled-components": "^5.3.6" } -} +} \ No newline at end of file diff --git a/packages/editor/src/classes/action/capability/index.ts b/packages/editor/src/classes/action/capability/index.ts index 1090d88a..1e582ae1 100644 --- a/packages/editor/src/classes/action/capability/index.ts +++ b/packages/editor/src/classes/action/capability/index.ts @@ -43,7 +43,7 @@ class Capability { isHidden(action: ActionType): boolean { const mapping = ActionConfigByRenderMode[action]; - let result: boolean = false; + let result = false; if (mapping) { // Has been marked in desktop ... const desktopCapability: EditorRenderMode[] = mapping.desktop?.hidden; diff --git a/packages/editor/src/components/toolbar/index.tsx b/packages/editor/src/components/toolbar/index.tsx index 1cc75bed..590fa50d 100644 --- a/packages/editor/src/components/toolbar/index.tsx +++ b/packages/editor/src/components/toolbar/index.tsx @@ -133,7 +133,7 @@ export const ToolbarSubmenu = (props: { if (!o?.render) { return ( diff --git a/packages/editor/webpack.prod.js b/packages/editor/webpack.prod.js index ab543d64..0a89bc5f 100644 --- a/packages/editor/webpack.prod.js +++ b/packages/editor/webpack.prod.js @@ -13,6 +13,7 @@ const prodConfig = { 'react-intl': 'react-intl', '@emotion/styled': '@emotion/styled', '@emotion/react': '@emotion/react', + 'styled-components': 'styled-components', }, plugins: [new CleanWebpackPlugin()], };