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:react/recommended",
"plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended",
"plugin:cypress/recommended" "plugin:cypress/recommended"
], ],
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"extensions": [
".js",
".ts"
]
},
"webpack": {
"config": "./webpack.common.js"
}
}
},
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {
"ecmaFeatures": { "ecmaFeatures": {

View File

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

View File

@ -89,7 +89,7 @@ const ImportDialog = ({ onClose }: CreateProps): React.ReactElement => {
const extensionFile = file.name.split('.').pop(); const extensionFile = file.name.split('.').pop();
const extensionAccept = ['wxml', 'mm']; const extensionAccept = ['wxml', 'mm'];
if (!extensionAccept.includes(extensionFile!)) { if (!extensionFile || !extensionAccept.includes(extensionFile)) {
setErrorFile({ setErrorFile({
error: true, error: true,
message: intl.formatMessage( message: intl.formatMessage(

View File

@ -11,5 +11,6 @@ declare global {
} }
const container = document.getElementById('root') as HTMLElement; const container = document.getElementById('root') as HTMLElement;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const root = createRoot(container!); const root = createRoot(container!);
root.render(<App />); root.render(<App />);