'Webpack showing warnings that are no longer relevant - Create-react-app
I recently updated to Material UI5 and had to make a whole bunch of changes in the codebase. I did a lot of this using the VSCode search and replace function.
Now, whenever I build my app, I get a whole string of warnings saying that there is an unused import, even though all of these lines have been removed. (Note: This is all on the dev build)
If I go into the file that is generating the warning and save it (even though there are no changes to be saved) then it seems that webpack recognizes the change and stops issuing the warning.
Is there any way to somehow clear the cache or get webpack to recognize that these warnings aren't current?
edit: .eslintrc.js
module.exports = {
parser: '@typescript-eslint/parser',
root: true,
env: {
es6: true,
node: true,
browser: true,
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
tsconfigRootDir: __dirname,
project: './tsconfig.eslint.json',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['react', 'react-hooks', '@typescript-eslint', 'cypress'],
rules: {
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-namespace': ['off'],
'@typescript-eslint/no-explicit-any': ['off'], // Maybe a good rule, but it's a pain in the ass
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
// 'plugin:prettier/recommended',
],
overrides: [
{
files: ['**/*.js', '**/*.jsx'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/eslint-recommended': 'off',
'@typescript-eslint/recommended': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
{
files: ['**/styles.ts'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


