Open dtwardy opened 3 years ago
See if uninstalling @typescript-eslint/parser
helps. This config installs that for you, there's no need to install it yourself. I'm not sure if it's the problem, but worth a try, perhaps the versions are out of sync with @typescript-eslint/eslint-plugin
I am facing the same issue but with different rules.
"devDependencies": {
"@typescript-eslint/eslint-plugin": "4.4.1",
"eslint": "^7.25.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jsx-a11y": "6.3.1",
"eslint-plugin-react": "7.20.3",
"eslint-plugin-react-hooks": "4.0.8"
}
.eslintrc.js
module.exports = {
extends: [
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
parserOptions: {
project: './tsconfig.eslint.json',
sourceType: 'module',
createDefaultProgram: true,
},
};
tsconfig.eslint.json
{
"extends": "./tsconfig.json",
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx",]
}
So i tried with new project again and its working fine
.eslintrc.js
module.exports = {
extends: ['airbnb-typescript'],
overrides: [
{
files: ['*.ts', '*.tsx'],
parserOptions: {
project: ['./tsconfig.json'],
},
}
],
parser: '@typescript-eslint/parser',
};
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.22.0",
"eslint": "^7.25.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0"
}
So I recently encountered some issue with a boilerplate repo of mine when I moved to higher versions of several tools. It is probably my mistake but since I could not for the love of the code gods find the issue.
ESLint is complaining about 4 missing rules:
The following dependencies are in my package.json:
And my .eslintrc.js file looks as follows: