Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linter: Using no-unused-vars and @typescript-eslint/no-unused-vars together will result in errors not being reported #8009

Open
melxy1997 opened this issue Dec 19, 2024 · 1 comment
Labels
A-linter Area - Linter C-bug Category - Bug

Comments

@melxy1997
Copy link

What version of Oxlint are you using?

0.15.3

What command did you run?

yarn oxlint --quiet

What does your .oxlint.json config file look like?

    "rules": {
        "no-unused-vars": [
            "error",
            {
                "args": "none",
                "caughtErrors": "none"
            }
        ],
        "@typescript-eslint/no-unused-vars": [
            "error",
            {
                "args": "none"
            }
        ]

    },
    "env": {
        "browser": true,
        "amd": true,
        "es6": true
    },
    "overrides": [
        {
            "files": [
                "**/*.ts",
                "**/*.tsx"
            ],
            "parser": "@typescript-eslint/parser",
            "rules": {
                "no-extra-semi": 2,
                "import/order": [
                    "error",
                    {
                        "groups": [
                            [
                                "builtin",
                                "external"
                            ],
                            [
                                "internal"
                            ],
                            [
                                "parent",
                                "sibling",
                                "index"
                            ]
                        ],
                        "pathGroups": [
                            {
                                "pattern": "^react",
                                "group": "external",
                                "position": "before"
                            }
                        ],
                        "pathGroupsExcludedImportTypes": [
                            "react"
                        ],
                        "alphabetize": {
                            "order": "ignore",
                            "caseInsensitive": true
                        }
                    }
                ],
                "import/no-self-import": 0,
                "import/no-cycle": 0,
                "import/no-duplicates": 0,
                "import/no-useless-path-segments": 0,
                "import/named": 0,
                "import/no-named-as-default": 0,
                "import/export": 0,
                "no-duplicate-imports": 1,
                "@typescript-eslint/naming-convention": [
                    "warn",
                    {
                        "selector": "enumMember",
                        "format": [
                            "camelCase",
                            "PascalCase",
                            "UPPER_CASE"
                        ],
                        "leadingUnderscore": "allow",
                        "filter": {
                            "regex": "^[A-Za-z]+_[A-Za-z]+$",
                            "match": false
                        }
                    }
                ],
                "comma-spacing": "error"
            },
            "parserOptions": {
                "project": true
            }
        },
        {
            "files": [
                "webpack/**/*",
                "tests/**/*",
                "**/scripts/**/*.js"
            ],
            "rules": {
                "@typescript-eslint/no-var-requires": "off",
                "global-require": "off",
                "import/no-dynamic-require": "off",
                "max-classes-per-file": "off",
                "import/order": 0,
                "import/no-self-import": 0,
                "import/no-duplicates": 0,
                "import/no-useless-path-segments": 0,
                "import/named": 0,
                "import/no-named-as-default": 0,
                "import/export": 0,
                "@typescript-eslint/naming-convention": [
                    "warn",
                    {
                        "selector": "enumMember",
                        "format": [
                            "camelCase",
                            "PascalCase",
                            "UPPER_CASE"
                        ],
                        "leadingUnderscore": "allow",
                        "filter": {
                            "regex": "^[A-Za-z]+_[A-Za-z]+$",
                            "match": false
                        }
                    }
                ]
            }
        }
    ],
        "react": {
            "version": "detect"
        },
        "propWrapperFunctions": [
            "forbidExtraProps",
            {
                "property": "freeze",
                "object": "Object"
            },
            {
                "property": "myFavoriteWrapper"
            }
        ],
        "linkComponents": [
            "Hyperlink",
            {
                "name": "Link",
                "linkAttribute": "to"
            }
        ]
    },
    "root": true,
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "project": "./tsconfig.json",
        "ecmaVersion": 2018,
        "sourceType": "module",
        "ecmaFeatures": {
            "jsx": true
        }
    }
}

What happened?

Removing either rule allows the error to be reported,
but when both are present, the error is not reported.

Is it because I used the --quiet param?
But does it affect whether my errors are intercepted?

@melxy1997 melxy1997 added A-linter Area - Linter C-bug Category - Bug labels Dec 19, 2024
@Dunqing
Copy link
Member

Dunqing commented Dec 23, 2024

I am not sure what the problem is here, oxlint only supports no-unused-vars rule and it also covers what @typescript-eslint/no-unused-vars does, so you can turn off @typescript-eslint/no-unused-vars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-bug Category - Bug
Projects
None yet
Development

No branches or pull requests

2 participants