Fix warning on lint

This commit is contained in:
Paulo Gustavo Veiga 2023-01-14 08:40:25 -08:00
parent 2f6b681016
commit ab02e12d9f
4 changed files with 34 additions and 2 deletions

View File

@ -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": {

View File

@ -1,4 +1,20 @@
{
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"extensions": [
".js",
".ts"
]
},
"webpack": {
"config": "./webpack.common.js"
}
}
},
"env": {
"browser": true,
"es2021": true

View File

@ -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(

View File

@ -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(<App />);