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

[bug] Invalid rules for disable-debug, disable-dom, and disable-web-apis configs #923

Closed
achou11 opened this issue Jan 21, 2025 · 0 comments · Fixed by #924
Closed

[bug] Invalid rules for disable-debug, disable-dom, and disable-web-apis configs #923

achou11 opened this issue Jan 21, 2025 · 0 comments · Fixed by #924
Labels
Status: Released The issue has been released Type: Bug Something isn't working

Comments

@achou11
Copy link

achou11 commented Jan 21, 2025

Describe the bug

Attempting to use disable-debug, disable-dom, or disable-web-apis causes an ESLint error:

Oops! Something went wrong! :(

ESLint: 9.18.0

Configuration for rule "0,off" is invalid. Each rule must have a severity ("off", 0, "warn", 1, "error", or 2) and may be followed by additional options for the rule.

You passed 'undefined', which doesn't contain a valid severity.

If you're attempting to configure rule options, perhaps you meant:

    "0,off": ["error", undefined]

See https://eslint.org/docs/latest/use/configure/rules#using-configuration-files for configuring rules.

Reproduction

  1. Follow installation instructions provided by https://eslint-react.xyz/docs/getting-started/typescript
  2. Have an ESLint config that is similar to the following:
// @ts-check
import eslintJs from "@eslint/js";
import eslintReact from "@eslint-react/eslint-plugin";
import tseslint from "typescript-eslint";
 
export default tseslint.config({
  files: ["**/*.ts", "**/*.tsx"],
  extends: [
    eslintJs.configs.recommended,
    tseslint.configs.recommended,
    eslintReact.configs.recommended,
    eslintReact.configs['disable-debug'], // Add this line!
  ],
  languageOptions: {
    parser: tseslint.parser,
    parserOptions: {
      projectService: true,
    },
  },
});
  1. Run ESLint e.g. npx eslint --cache .

Expected behavior

Applying the config(s) should work and not cause ESLint to fail.

Platform and versions

Node@20.18.0
@eslint-react/eslint-plugin@1.24.0

Stack trace


Additional context

When logging something like eslintReact.configs['disable-debug'], I get { '0,off': undefined }

@Rel1cx Rel1cx added the Type: Bug Something isn't working label Jan 21, 2025
Rel1cx added a commit that referenced this issue Jan 21, 2025
Rel1cx added a commit that referenced this issue Jan 21, 2025
@Rel1cx Rel1cx added the Status: Released The issue has been released label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Released The issue has been released Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants