Add lint to editor

This commit is contained in:
Paulo Gustavo Veiga 2022-11-02 18:17:00 -07:00
parent 7598a8562b
commit 38a2e5865d
10 changed files with 632 additions and 897 deletions

View File

@ -7,6 +7,7 @@ const prodConfig = {
optimization: {
splitChunks: {
chunks: 'all',
usedExports: true,
},
},
};

View File

@ -30,6 +30,15 @@
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-unused-vars": "error",
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn" // Checks effect dependencies
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"no-restricted-imports": [
"error",
{
"patterns": [
"@mui/*/*/*",
"!@mui/material/test-utils/*"
]
}
]
}
}

View File

@ -0,0 +1,6 @@
node_modules
public
dist
lang
coverage
*.json

View File

@ -0,0 +1,7 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"printWidth": 100
}

View File

@ -6,6 +6,7 @@
"build": "webpack --config webpack.prod.js",
"playground": "webpack serve --config webpack.playground.js",
"cy:run": "cypress run",
"lint": "eslint src",
"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,9 +29,12 @@
"css-loader": "^6.7.1",
"cypress": "^10.11.0",
"cypress-image-snapshot": "^4.0.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-react-hooks": "^4.6.0",
"html-webpack-plugin": "^5.5.0",
"jest-transform-stub": "^2.0.0",
"prettier": "^2.7.1",
"react": "^18.2.0",
"style-loader": "^3.3.1",
"ts-jest": "^27.1.0",
@ -47,12 +51,15 @@
"styled-components": "^5.3.6"
},
"peerDependencies": {
"@emotion": "^11.10.5",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@mui/icons-material": "^5.9.3",
"@mui/material": "^5.10.11",
"lodash": "^4.17.14",
"react": "^18.2.0",
"react-intl": "^6.2.1",
"react-dom": "^18.2.0",
"react-intl": "^6.2.1",
"styled-components": "^5.3.6"
}
}

View File

@ -12,8 +12,7 @@ const prodConfig = {
'react-dom': 'react-dom',
'react-intl': 'react-intl',
'@emotion/styled': '@emotion/styled',
'@mui/icons-material': '@mui/icons-material',
'@mui/material': '@mui/material',
'@emotion/react': '@emotion/react',
},
plugins: [new CleanWebpackPlugin()],
};

View File

@ -32,7 +32,6 @@
"@babel/preset-env": "^7.19.4",
"babel-loader": "^8.2.2",
"clean-webpack-plugin": "^4.0.0",
"core-js": "^3.15.2",
"cypress": "^10.11.0",
"cypress-image-snapshot": "^4.0.1",
"eslint": "^5.16.0",
@ -42,7 +41,6 @@
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-import": "^2.25.3",
"html-webpack-plugin": "^5.3.2",
"jquery": "3.6.0",
"nodemon": "^2.0.12",
"start-server-and-test": "^1.14.0",
"webpack": "^5.74.0",
@ -51,6 +49,13 @@
"webpack-merge": "^5.8.0"
},
"dependencies": {
"@wisemapping/core-js": "^0.4.0"
"@wisemapping/core-js": "^0.4.0",
"jquery": "^3.6.0",
"core-js": "^3.15.2"
},
"peerDependencies": {
"@wisemapping/core-js": "^0.4.0",
"jquery": "^3.6.0",
"core-js": "^3.15.2"
}
}

View File

@ -30,7 +30,16 @@
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-unused-vars": "error",
"react-hooks/rules-of-hooks": "warn" // Checks rules of Hooks
// "react-hooks/exhaustive-deps": "warn" // Checks effect dependencies
"react-hooks/rules-of-hooks": "warn", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"no-restricted-imports": [
"error",
{
"patterns": [
"@mui/*/*/*",
"!@mui/material/test-utils/*"
]
}
]
}
}

View File

@ -72,9 +72,7 @@ const App = (): ReactElement => {
</Suspense>
</Route>
<Route exact path="/c/maps/:id/edit">
<Suspense fallback={<div></div>}>
<EnhacedEditorPage isTryMode={false} />
</Suspense>
</Route>
<Route exact path="/c/maps/:id/try">
<Suspense fallback={<div></div>}>

1462
yarn.lock

File diff suppressed because it is too large Load Diff