diff --git a/packages/editor/.eslintrc.json b/packages/editor/.eslintrc.json index 463a34a3..3c2b5b5c 100644 --- a/packages/editor/.eslintrc.json +++ b/packages/editor/.eslintrc.json @@ -9,8 +9,23 @@ "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "plugin:cypress/recommended" - ], + "settings": { + "react": { + "version": "detect" + }, + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".ts" + ] + }, + "webpack": { + "config": "./webpack.common.js" + } + } + }, "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaFeatures": { diff --git a/packages/webapp/.eslintrc.json b/packages/webapp/.eslintrc.json index a692e0bc..64097285 100644 --- a/packages/webapp/.eslintrc.json +++ b/packages/webapp/.eslintrc.json @@ -1,4 +1,20 @@ { + "settings": { + "react": { + "version": "detect" + }, + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".ts" + ] + }, + "webpack": { + "config": "./webpack.common.js" + } + } + }, "env": { "browser": true, "es2021": true diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/import-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/import-dialog/index.tsx index c98cb774..b10bb35e 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/import-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/import-dialog/index.tsx @@ -89,7 +89,7 @@ const ImportDialog = ({ onClose }: CreateProps): React.ReactElement => { const extensionFile = file.name.split('.').pop(); const extensionAccept = ['wxml', 'mm']; - if (!extensionAccept.includes(extensionFile!)) { + if (!extensionFile || !extensionAccept.includes(extensionFile)) { setErrorFile({ error: true, message: intl.formatMessage( diff --git a/packages/webapp/src/index.tsx b/packages/webapp/src/index.tsx index 0b0ae125..d3e2c624 100644 --- a/packages/webapp/src/index.tsx +++ b/packages/webapp/src/index.tsx @@ -11,5 +11,6 @@ declare global { } const container = document.getElementById('root') as HTMLElement; +// eslint-disable-next-line @typescript-eslint/no-non-null-assertion const root = createRoot(container!); root.render();