Skip to content

linter: oxlint --rules --format=json broken on main #15688

@connorshea

Description

@connorshea

What version of Oxlint are you using?

dev

What command did you run?

oxlint --rules --format=json

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

config
{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": [
    "import",
    "jsdoc",
    "promise",
    "react",
    "jsx-a11y"
  ],
  "categories": {
    "correctness": "off"
  },
  "env": {
    "builtin": true,
    "es2021": true,
    "browser": true,
    "shared-node-browser": true
  },
  "rules": {
    "for-direction": "error",
    "no-async-promise-executor": "error",
    "no-case-declarations": "error",
    "no-class-assign": "error",
    "no-compare-neg-zero": "error",
    "no-cond-assign": "error",
    "no-const-assign": "error",
    "no-constant-binary-expression": "error",
    "no-constant-condition": "error",
    "no-control-regex": "error",
    "no-debugger": "error",
    "no-delete-var": "error",
    "no-dupe-class-members": "error",
    "no-dupe-else-if": "error",
    "no-dupe-keys": "error",
    "no-duplicate-case": "error",
    "no-empty": [
      "error",
      {
        "allowEmptyCatch": true
      }
    ],
    "no-empty-character-class": "error",
    "no-empty-pattern": "error",
    "no-empty-static-block": "error",
    "no-ex-assign": "error",
    "no-extra-boolean-cast": "error",
    "no-fallthrough": "error",
    "no-func-assign": "error",
    "no-global-assign": "error",
    "no-import-assign": "error",
    "no-invalid-regexp": "error",
    "no-irregular-whitespace": "error",
    "no-loss-of-precision": "error",
    "no-new-native-nonconstructor": "error",
    "no-nonoctal-decimal-escape": "error",
    "no-obj-calls": "error",
    "no-prototype-builtins": "error",
    "no-redeclare": "error",
    "no-regex-spaces": "error",
    "no-self-assign": "error",
    "no-setter-return": "error",
    "no-shadow-restricted-names": "error",
    "no-sparse-arrays": "error",
    "no-this-before-super": "error",
    "no-unexpected-multiline": "error",
    "no-unsafe-finally": "error",
    "no-unsafe-negation": "error",
    "no-unsafe-optional-chaining": "error",
    "no-unused-labels": "error",
    "no-unused-private-class-members": "error",
    "no-useless-backreference": "error",
    "no-useless-catch": "error",
    "no-useless-escape": "error",
    "no-with": "error",
    "require-yield": "error",
    "use-isnan": "error",
    "valid-typeof": "error",
    "import/namespace": "error",
    "import/default": "error",
    "import/no-named-as-default": "warn",
    "import/no-named-as-default-member": "warn",
    "import/no-duplicates": "warn",
    "jsdoc/check-access": "warn",
    "jsdoc/check-property-names": "warn",
    "jsdoc/check-tag-names": "warn",
    "jsdoc/empty-tags": "warn",
    "jsdoc/implements-on-classes": "warn",
    "jsdoc/no-defaults": "warn",
    "jsdoc/require-param": "warn",
    "jsdoc/require-param-name": "warn",
    "jsdoc/require-param-type": "warn",
    "jsdoc/require-property": "warn",
    "jsdoc/require-property-name": "warn",
    "jsdoc/require-property-type": "warn",
    "jsdoc/require-returns-type": "warn",
    "jsdoc/require-yields": "warn",
    "promise/no-return-wrap": "error",
    "promise/param-names": "error",
    "promise/catch-or-return": [
      "error",
      {
        "allowFinally": true
      }
    ],
    "promise/no-new-statics": "error",
    "promise/valid-params": "warn",
    "eqeqeq": [
      "error",
      "always",
      {
        "null": "ignore"
      }
    ],
    "no-console": [
      "warn",
      {
        "allow": [
          "error",
          "warn"
        ]
      }
    ],
    "no-unused-expressions": "error",
    "import/extensions": [
      "off",
      "always",
      {
        "js": "never",
        "jsx": "never",
        "mjs": "never",
        "ts": "never",
        "mts": "never",
        "tsx": "never"
      }
    ],
    "import/first": "error",
    "import/no-anonymous-default-export": "error",
    "import/no-amd": "error",
    "import/no-commonjs": "error",
    "import/no-self-import": "error",
    "react/jsx-key": "warn",
    "react/jsx-no-comment-textnodes": "warn",
    "react/jsx-no-duplicate-props": "warn",
    "react/jsx-no-target-blank": [
      "error",
      {
        "allowReferrer": true
      }
    ],
    "react/jsx-no-undef": "warn",
    "react/no-children-prop": "warn",
    "react/no-danger-with-children": "warn",
    "react/no-direct-mutation-state": "warn",
    "react/no-find-dom-node": "warn",
    "react/no-is-mounted": "warn",
    "react/no-render-return-value": "warn",
    "react/no-string-refs": "warn",
    "react/no-unescaped-entities": "warn",
    "react/no-unknown-property": "warn",
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn",
    "jsx-a11y/alt-text": "error",
    "jsx-a11y/anchor-has-content": "error",
    "jsx-a11y/anchor-is-valid": "error",
    "jsx-a11y/aria-activedescendant-has-tabindex": "error",
    "jsx-a11y/aria-props": "error",
    "jsx-a11y/aria-role": "error",
    "jsx-a11y/aria-unsupported-elements": "error",
    "jsx-a11y/autocomplete-valid": "error",
    "jsx-a11y/heading-has-content": "error",
    "jsx-a11y/html-has-lang": "error",
    "jsx-a11y/iframe-has-title": "error",
    "jsx-a11y/img-redundant-alt": "error",
    "jsx-a11y/mouse-events-have-key-events": "error",
    "jsx-a11y/no-access-key": "error",
    "jsx-a11y/no-distracting-elements": "error",
    "jsx-a11y/no-redundant-roles": "error",
    "jsx-a11y/role-has-required-aria-props": "error",
    "jsx-a11y/role-supports-aria-props": "error",
    "jsx-a11y/scope": "error",
    "jsx-a11y/tabindex-no-positive": "error",
    "react/jsx-filename-extension": [
      "error",
      {
        "extensions": [
          ".jsx",
          "tsx"
        ]
      }
    ],
    "react/jsx-boolean-value": "error",
    "react/jsx-fragments": [
      "error",
      "syntax"
    ],
    "react/jsx-no-useless-fragment": "error",
    "react/self-closing-comp": "error",
    "react/button-has-type": "error"
  },
  "ignorePatterns": [
    "build/**/*",
    "coverage/**/*",
    "db/**/*",
    "lib/**/*",
    "log/**/*",
    "node_modules/**/*",
    "public/**/*",
    "!public/embed.js",
    "spec/**/*",
    "tmp/**/*",
    "vendor/**/*",
    "streaming/**/*",
    ".bundle/**/*",
    "storybook-static/**/*"
  ],
  "overrides": [
    {
      "files": [
        "**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)",
        "**/*.story.@(ts|tsx|js|jsx|mjs|cjs)"
      ],
      "rules": {
        "react-hooks/rules-of-hooks": "off",
        "import/no-anonymous-default-export": "off"
      }
    },
    {
      "files": [
        "app/javascript/mastodon/common.js",
        "app/javascript/mastodon/features/emoji/unicode_to_unified_name.js",
        "app/javascript/mastodon/features/emoji/emoji_compressed.js",
        "app/javascript/mastodon/features/emoji/unicode_to_filename.js",
        "app/javascript/mastodon/service_worker/web_push_locales.js",
        "**/*.config.js",
        "**/.*rc.js",
        "**/ide-helper.js",
        "config/formatjs-formatter.js"
      ],
      "rules": {
        "import/no-commonjs": "off"
      },
      "env": {
        "commonjs": true,
        "node": true
      }
    },
    {
      "files": [
        "**/*.ts",
        "**/*.tsx"
      ],
      "rules": {
        "no-class-assign": "off",
        "no-const-assign": "off",
        "no-dupe-class-members": "off",
        "no-dupe-keys": "off",
        "no-func-assign": "off",
        "no-import-assign": "off",
        "no-new-native-nonconstructor": "off",
        "no-obj-calls": "off",
        "no-redeclare": "off",
        "no-setter-return": "off",
        "no-this-before-super": "off",
        "no-unsafe-negation": "off",
        "no-var": "error",
        "no-with": "off",
        "prefer-rest-params": "error",
        "prefer-spread": "error"
      }
    },
    {
      "files": [
        "**/*.ts",
        "**/*.tsx"
      ],
      "rules": {
        "@typescript-eslint/ban-ts-comment": [
          "error",
          {
            "minimumDescriptionLength": 10
          }
        ],
        "no-array-constructor": "error",
        "@typescript-eslint/no-duplicate-enum-values": "error",
        "@typescript-eslint/no-dynamic-delete": "error",
        "@typescript-eslint/no-empty-object-type": "error",
        "@typescript-eslint/no-explicit-any": "error",
        "@typescript-eslint/no-extra-non-null-assertion": "error",
        "@typescript-eslint/no-extraneous-class": "error",
        "@typescript-eslint/no-misused-new": "error",
        "@typescript-eslint/no-namespace": "error",
        "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
        "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
        "@typescript-eslint/no-non-null-assertion": "error",
        "@typescript-eslint/no-require-imports": "error",
        "@typescript-eslint/no-this-alias": "error",
        "@typescript-eslint/no-unnecessary-type-constraint": "error",
        "@typescript-eslint/no-unsafe-declaration-merging": "error",
        "@typescript-eslint/no-unsafe-function-type": "error",
        "no-unused-vars": "error",
        "no-useless-constructor": "error",
        "@typescript-eslint/no-wrapper-object-types": "error",
        "no-throw-literal": "off",
        "@typescript-eslint/prefer-as-const": "error",
        "@typescript-eslint/prefer-literal-enum-member": "error",
        "@typescript-eslint/prefer-namespace-keyword": "error",
        "prefer-promise-reject-errors": "off",
        "require-await": "off",
        "@typescript-eslint/triple-slash-reference": "error"
      },
      "plugins": [
        "typescript"
      ]
    },
    {
      "files": [
        "**/*.ts",
        "**/*.tsx"
      ],
      "rules": {
        "no-class-assign": "off",
        "no-const-assign": "off",
        "no-dupe-class-members": "off",
        "no-dupe-keys": "off",
        "no-func-assign": "off",
        "no-import-assign": "off",
        "no-new-native-nonconstructor": "off",
        "no-obj-calls": "off",
        "no-redeclare": "off",
        "no-setter-return": "off",
        "no-this-before-super": "off",
        "no-unsafe-negation": "off",
        "no-var": "error",
        "no-with": "off",
        "prefer-rest-params": "error",
        "prefer-spread": "error"
      }
    },
    {
      "files": [
        "**/*.ts",
        "**/*.tsx"
      ],
      "rules": {
        "@typescript-eslint/adjacent-overload-signatures": "error",
        "@typescript-eslint/array-type": "error",
        "@typescript-eslint/ban-tslint-comment": "error",
        "@typescript-eslint/consistent-generic-constructors": "error",
        "@typescript-eslint/consistent-indexed-object-style": "error",
        "@typescript-eslint/consistent-type-definitions": "error",
        "@typescript-eslint/no-confusing-non-null-assertion": "error",
        "no-empty-function": "error",
        "@typescript-eslint/no-inferrable-types": "error",
        "@typescript-eslint/prefer-for-of": "error",
        "@typescript-eslint/prefer-function-type": "error"
      },
      "plugins": [
        "typescript"
      ]
    },
    {
      "files": [
        "**/*.ts",
        "**/*.tsx"
      ],
      "rules": {
        "react/jsx-no-target-blank": "off",
        "react/react-in-jsx-scope": "off"
      }
    },
    {
      "files": [
        "**/*.ts",
        "**/*.tsx"
      ],
      "rules": {
        "jsx-a11y/click-events-have-key-events": "error",
        "jsx-a11y/label-has-associated-control": "error",
        "jsx-a11y/media-has-caption": "error",
        "jsx-a11y/no-autofocus": "error",
        "jsx-a11y/no-noninteractive-tabindex": [
          "error",
          {
            "tags": [],
            "roles": [
              "tabpanel"
            ],
            "allowExpressionValues": true
          }
        ]
      }
    },
    {
      "files": [
        "**/*.ts",
        "**/*.tsx"
      ],
      "rules": {
        "jsdoc/check-tag-names": [
          "warn",
          {
            "typed": true
          }
        ],
        "jsdoc/require-param-description": "warn",
        "jsdoc/require-param-type": "off",
        "jsdoc/require-property-description": "warn",
        "jsdoc/require-property-type": "off",
        "jsdoc/require-returns": "warn",
        "jsdoc/require-returns-description": "warn",
        "jsdoc/require-returns-type": "off"
      }
    },
    {
      "files": [
        "**/*.ts",
        "**/*.tsx"
      ],
      "rules": {
        "import/consistent-type-specifier-style": [
          "error",
          "prefer-top-level"
        ],
        "import/no-default-export": "warn",
        "jsdoc/require-param": "off",
        "@typescript-eslint/consistent-type-definitions": [
          "warn",
          "interface"
        ],
        "@typescript-eslint/consistent-type-imports": "error",
        "no-restricted-imports": [
          "warn",
          {
            "name": "react-redux",
            "importNames": [
              "useSelector",
              "useDispatch"
            ],
            "message": "Use typed hooks `useAppDispatch` and `useAppSelector` instead."
          }
        ],
        "no-unused-vars": [
          "error",
          {
            "vars": "all",
            "args": "after-used",
            "destructuredArrayIgnorePattern": "^_",
            "ignoreRestSiblings": true
          }
        ]
      },
      "plugins": [
        "typescript"
      ]
    },
    {
      "files": [
        "**/__tests__/*.js",
        "**/__tests__/*.jsx"
      ],
      "env": {
        "vitest": true
      }
    },
    {
      "files": [
        "**/*.test.*"
      ],
      "rules": {
        "no-global-assign": "off"
      }
    },
    {
      "files": [
        "**/*.stories.ts",
        "**/*.stories.tsx",
        ".storybook/*"
      ],
      "rules": {
        "import/no-default-export": "off"
      }
    }
  ]
}

What happened?

JSON is no longer printed due to the changes in #15213.

Previously, in 1.28.0, you'd get an output like this:

  {
    "scope": "vue",
    "value": "require-default-export",
    "category": "suspicious"
  },
  {
    "scope": "vue",
    "value": "require-typed-ref",
    "category": "style"
  },
  {
    "scope": "vue",
    "value": "valid-define-emits",
    "category": "correctness"
  },
  {
    "scope": "vue",
    "value": "valid-define-props",
    "category": "correctness"
  }

Apparently the tests don't test this CLI behavior directly and so didn't catch this regression. I only noticed it while messing with the CLI for unrelated things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions