8000 0.47.0 `TypeError: Key "languageOptions": allowTrailingCommas option is only available in JSONC.` · Issue #798 · xojs/xo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
0.47.0 TypeError: Key "languageOptions": allowTrailingCommas option is only available in JSONC. #798
Open
@fregante

Description

@fregante

I bumped eslint-config-xo from 0.46.0 to 0.47.0 and it broke it. My config is:

import { defineConfig, globalIgnores } from "eslint/config";
import eslintPlugin from "eslint-plugin-eslint-plugin";
import prettier from "eslint-config-prettier";
import xo from "eslint-config-xo";
import unicorn from "eslint-plugin-unicorn";
import n from "eslint-plugin-n";

export default defineConfig([
  globalIgnores(["dist"]),
  ...xo,
  eslintPlugin.configs["flat/recommended"],
  unicorn.configs["flat/recommended"],
  n.configs["flat/recommended"],
  prettier,
  {
    rules: {
      // Prefer fixing issues rather than adding exceptions here
      "unicorn/prefer-module": "off",
      "n/no-unpublished-require": "off", // Buggy
      "n/no-unpublished-import": "off", // Buggy
      "unicorn/no-null": "off",
      "unicorn/prevent-abbreviations": [
        "error",
        {
          replacements: {
            args: false,
            props: false,
            i: false,
          },
        },
      ],
    },
  },
]);
ESLint: 9.26.0

TypeError: Key "languageOptions": allowTrailingCommas option is only available in JSONC.
    at new Config (~/node_modules/eslint/lib/config/config.js:207:10)
    at [finalizeConfig] (~/node_modules/eslint/lib/config/flat-config-array.js:212:10)
    at FlatConfigArray.getConfigWithStatus (~/node_modules/@eslint/config-array/dist/cjs/index.cjs:1263:55)
    at FlatConfigArray.getConfig (~/node_modules/@eslint/config-array/dist/cjs/index.cjs:1281:15)
    at entryFilter (~/node_modules/eslint/lib/eslint/eslint-helpers.js:288:27)
    at async NodeHfs.<anonymous> (file://~/node_modules/@humanfs/core/src/hfs.js:574:24)
    at async NodeHfs.walk (file://~/node_modules/@humanfs/core/src/hfs.js:614:3)
    at async globSearch (~/node_modules/eslint/lib/eslint/eslint-helpers.js:329:20)
    at async Promise.allSettled (index 0)
    at async globMultiSearch (~/node_modules/eslint/lib/eslint/eslint-helpers.js:420:18)

If I add a console.log just before the throw new TypeError I can see that indeed allowTrailingCommas is set to true on the json/json language

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0