Add lint to editor

This commit is contained in:
Paulo Gustavo Veiga 2022-11-02 18:33:28 -07:00
parent 38a2e5865d
commit b0209e5b3e
5 changed files with 7 additions and 5 deletions

View File

@ -6,7 +6,7 @@
"build": "webpack --config webpack.prod.js", "build": "webpack --config webpack.prod.js",
"playground": "webpack serve --config webpack.playground.js", "playground": "webpack serve --config webpack.playground.js",
"cy:run": "cypress run", "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:integration": "start-server-and-test 'yarn playground' http-get://localhost:8081 'yarn cy:run'",
"test": "yarn test:integration", "test": "yarn test:integration",
"test:unit": "jest ./test/unit/* --detectOpenHandles", "test:unit": "jest ./test/unit/* --detectOpenHandles",
@ -28,6 +28,7 @@
"copy-webpack-plugin": "^10.2.1", "copy-webpack-plugin": "^10.2.1",
"css-loader": "^6.7.1", "css-loader": "^6.7.1",
"cypress": "^10.11.0", "cypress": "^10.11.0",
"eslint": "^7.14.0",
"cypress-image-snapshot": "^4.0.1", "cypress-image-snapshot": "^4.0.1",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "^7.31.10", "eslint-plugin-react": "^7.31.10",

View File

@ -43,7 +43,7 @@ class Capability {
isHidden(action: ActionType): boolean { isHidden(action: ActionType): boolean {
const mapping = ActionConfigByRenderMode[action]; const mapping = ActionConfigByRenderMode[action];
let result: boolean = false; let result = false;
if (mapping) { if (mapping) {
// Has been marked in desktop ... // Has been marked in desktop ...
const desktopCapability: EditorRenderMode[] = mapping.desktop?.hidden; const desktopCapability: EditorRenderMode[] = mapping.desktop?.hidden;

View File

@ -133,7 +133,7 @@ export const ToolbarSubmenu = (props: {
if (!o?.render) { if (!o?.render) {
return ( return (
<ToolbarMenuItem <ToolbarMenuItem
vertical={!!!props.vertical} vertical={!props.vertical}
key={i} key={i}
configuration={o as ActionConfig} configuration={o as ActionConfig}
elevation={props.elevation + 3} elevation={props.elevation + 3}

View File

@ -69,7 +69,7 @@ const WarningDialog = ({ capability, message }: FooterPropsType): React.ReactEle
} }
// if the toolbar is present, the alert must not overlap // if the toolbar is present, the alert must not overlap
var alertTopAdjustmentStyle = 'tryInfoPanelWithToolbar'; const alertTopAdjustmentStyle = 'tryInfoPanelWithToolbar';
return ( return (
<> <>

View File

@ -13,6 +13,7 @@ const prodConfig = {
'react-intl': 'react-intl', 'react-intl': 'react-intl',
'@emotion/styled': '@emotion/styled', '@emotion/styled': '@emotion/styled',
'@emotion/react': '@emotion/react', '@emotion/react': '@emotion/react',
'styled-components': 'styled-components',
}, },
plugins: [new CleanWebpackPlugin()], plugins: [new CleanWebpackPlugin()],
}; };