перешел на линукс столкнулся с ошибкой
что за ошибка и как поправить?
[nodemon] 2.0.7 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): *.* [nodemon] watching extensions: js,mjs,json [nodemon] starting `node index.js index.js` |
дело было в том что тот же сайт под винду работал а под линукс нет,удалил все заново установил заработала серверная часть. ктеперь лиент выдает ошибки которые в винде не выдавал. я думал у всех выдает одно и тоже поэтому задал такой вопрос.
вот ошибки клиента Compiled with warnings. src/App.js Line 19:8: React Hook useEffect has a missing dependency: 'user'. Either include it or remove the dependency array react-hooks/exhaustive-deps src/components/TypeBar.js Line 4:8: 'Col' is defined but never used no-unused-vars src/components/modals/CreateBrand.js Line 4:22: 'createType' is defined but never used no-unused-vars src/components/modals/CreateDevice.js Line 5:36: 'fetchDevices' is defined but never used no-unused-vars Line 18:8: React Hook useEffect has a missing dependency: 'device'. Either include it or remove the dependency array react-hooks/exhaustive-deps src/http/deviceAPI.js Line 2:8: 'jwt_decode' is defined but never used no-unused-vars src/pages/Auth.js Line 26:17: 'data' is assigned a value but never used no-unused-vars src/pages/DevicePage.js Line 12:8: React Hook useEffect has a missing dependency: 'id'. Either include it or remove the dependency array react-hooks/exhaustive-deps src/pages/Shop.js Line 23:8: React Hook useEffect has a missing dependency: 'device'. Either include it or remove the dependency array react-hooks/exhaustive-deps Line 30:8: React Hook useEffect has a missing dependency: 'device'. Either include it or remove the dependency array react-hooks/exhaustive-deps Search for the keywords to learn more about each warning. To ignore, add // eslint-disable-next-line to the line before. я буду по очередно выкладывать файлы из ошибки и жду ваших подсказок. App.js import React, {useContext, useEffect, useState} from 'react'; import {BrowserRouter} from "react-router-dom"; import AppRouter from "./components/AppRouter"; import NavBar from "./components/NavBar"; import {observer} from "mobx-react-lite"; import {Context} from "./index.js"; import {check} from "./http/userAPI"; import {Spinner} from "react-bootstrap"; const App = observer(() => { const {user} = useContext(Context) const [loading, setLoading] = useState(true) useEffect(() => { check().then(data => { user.setUser(true) user.setIsAuth(true) }).finally(() => setLoading(false)) }, []) if (loading) { return <Spinner animation={"grow"}/> } return ( <BrowserRouter> <NavBar /> <AppRouter /> </BrowserRouter> ); }); export default App; |
У тебя линтер случайно включился, отключи его и не парься.
Можно, конечно, попробовать перевести предупреждения на русский, осмыслить их и устранить их причины, но это пройденный этап, ничего не выйдет. Это слишком сложно. |
как это сделать в vscodium
|
Удали файл eslint.config или .eslintrc в корне проекта.
|
удаляю он снова появляется
npm uninstall -g eslint ✔ npm uninstall eslint --save npm uninstall eslint --save-dev npm uninstall eslint-config-prettier npm remove eslint даже так удалял не помогает |
нашел такое что можно игнорить в линтере с помощю .eslintignore
написал там **/src/App.js но название файла почему то все равновыводит в предупреждении линтера |
Часовой пояс GMT +3, время: 18:23. |