Turn off typescript eslint warnings in terminal for .js and .jsx files in create-react-app in VS Code

Viewed 364

I'm trying to migrate from javascript to typescript using my create-react-app and want to prevent my new eslint typescript warnings flagging for my old .js and .jsx files.

Currently in my terminal I get things like this:

screenshot of terminal

But @typescript-eslint/explicit-module-boundary-types is a typescript specific problem and I don't want these errors flags on a .js file right now.

I've tried the following, based on other StackOverflow solutions:

package.json

{...
  "eslintIgnore": ["**/*.js", "**/*.jsx"],
...}

.eslintrc.json

{...
"overrides": [
        {
            "files": ["**/*.ts", "**/*.tsx"],
            "env": { "browser": true, "es2021": true, "node": true },
            "extends": [
                "eslint:recommended",
                "plugin:@typescript-eslint/eslint-recommended",
                "plugin:@typescript-eslint/recommended"
            ],
            "globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" },
            "parser": "@typescript-eslint/parser",
            "parserOptions": {
                "ecmaFeatures": { "jsx": true },
                "ecmaVersion": 11,
                "sourceType": "module",
                "project": "./tsconfig.json"
            },
            "plugins": ["@typescript-eslint"],
            "rules": {
                "indent": ["error", 2, { "SwitchCase": 1 }],
                "linebreak-style": ["error", "unix"],
                "quotes": ["error", "single"],
                "comma-dangle": ["error", "always-multiline"],
                "@typescript-eslint/no-explicit-any": 0
            }
        },
        {
            "files": ["src/**/*.js", "src/**/*.jsx"],
            "rules": {
                "@typescript-eslint/explicit-module-boundary-types": 0
            }
        }
    ],
...}

.eslintignore

**/*.js
*.js

These seem to affect the linting in my VS Code files when I have them open. It doesn't have any effect on my VS Code terminal, which still shows the above screenshot. I'm all out of ideas if anyone can help?

0 Answers
Related