1、iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.eslintno-restricted-syntax
原因是使用了for in或for of循環,替換為forEach/map循環即可解決。
2、React Hook useEffect has a missing dependency: 'queryList'. Either include it or remove the dependency array.eslintreact-hooks/exhaustive-deps
原因是缺少依賴項,但有時我們並不需要寫依賴項,加一句:// eslint-disable-next-line react-hooks/exhaustive-deps即可解決。
3、Assignment to property of function parameter 'item'.eslintno-param-reassign
原因是循環中不允許直接修改每一項,不能直接對其做增加、刪除、修改操作。新建一個對象,在新的對象上做操作就好。如下圖: