So I have a cra app and I have set up a .eslintrc.json config with the help of eslint --init. Here's how it looks:
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"airbnb",
"prettier"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"react/jsx-filename-extension": "off"
}
}
I also have a jsconfig.json file. From what I understood, this is derived from the tsconfig.json config. Here's how mine looks:
{
"compilerOptions": {
"baseUrl": "./<path/to/src>",
"checkJs": true,
"jsx": "react"
},
"exclude": ["node_modules", "build"]
}
From what I've read, if you set checkJs to true you get some features like auto-imports and from what I've tested, this is true and I like it. But what I don't like is having ts errors in my js files and getting recommended to add ts-ignore to the top of the file or to a certain line. What I can do is set the checkJs flag to false and those will go away, but so would some features like auto-import.
Can I keep the checkJs flag to true and still disable all ts errors in my js project? Is there a eslint rule for that? From what I saw, I would need to install a bunch of ts eslint packages and alter my eslint config, but this seems a bit off. Can this be done in a somewhat elegant way?