fix: no undef var error

This commit is contained in:
jialin
2025-03-19 11:23:29 +08:00
parent 4b5f08ccc2
commit 3a05d74a36
3 changed files with 7 additions and 0 deletions
+4
View File
@@ -3,8 +3,12 @@ module.exports = {
rules: { rules: {
'react/no-unstable-nested-components': 1, 'react/no-unstable-nested-components': 1,
'no-unused-vars': 'off', 'no-unused-vars': 'off',
'no-undef': 'error',
'@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/class-name-casing': 'off' '@typescript-eslint/class-name-casing': 'off'
}, },
globals: {
Global: 'readonly'
},
ignorePatterns: ['public/static/'] ignorePatterns: ['public/static/']
}; };
+1
View File
@@ -7,6 +7,7 @@ export default function useWindowResize() {
width: window.innerWidth, width: window.innerWidth,
height: window.innerHeight height: window.innerHeight
}); });
console.log('size:', window.innerWidth, window.innerHeight);
const [isMobile, setIsMobile] = useState<boolean>(false); const [isMobile, setIsMobile] = useState<boolean>(false);
const [isTablet, setIsTablet] = useState<boolean>(false); const [isTablet, setIsTablet] = useState<boolean>(false);
const [isDesktop, setIsDesktop] = useState<boolean>(false); const [isDesktop, setIsDesktop] = useState<boolean>(false);
@@ -22,6 +22,7 @@ import {
ModelscopeTaskMap, ModelscopeTaskMap,
backendOptionsMap, backendOptionsMap,
backendTipsList, backendTipsList,
localPathTipsList,
modelSourceMap, modelSourceMap,
modelTaskMap, modelTaskMap,
ollamaModelOptions, ollamaModelOptions,
@@ -79,6 +80,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
onSourceChange, onSourceChange,
onOk onOk
} = props; } = props;
console.log('DataForm -> props');
const [form] = Form.useForm(); const [form] = Form.useForm();
const intl = useIntl(); const intl = useIntl();
const [modelTask, setModelTask] = useState<Record<string, any>>({ const [modelTask, setModelTask] = useState<Record<string, any>>({