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

Converting from old eslint config to flat config gives error #298

Closed
ChurroC opened this issue May 11, 2024 · 1 comment
Closed

Converting from old eslint config to flat config gives error #298

ChurroC opened this issue May 11, 2024 · 1 comment

Comments

@ChurroC
Copy link
Contributor

ChurroC commented May 11, 2024

I was using https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config to try to convert from the old config to flat config.

import { defineFlatConfig } from "eslint-define-config";

import { FlatCompat } from "@eslint/eslintrc";
const compat = new FlatCompat({
  baseDirectory: __dirname
});

// js.configs.recommended is basically "eslint:recommended"
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";

export default defineFlatConfig([
  js.configs.recommended,
  eslintConfigPrettier,
  ...compat.extends("eslint-config-turbo"),
  {
    plugins: {
      // plugins...
    },
    rules: {
      // rules...
    }
  }
]);

But ...compat.extends("eslint-config-turbo") error out even though it should work
If I use jsdoc with the types from "eslint"

// js.configs.recommended is basically "eslint:recommended"
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";

import { FlatCompat } from "@eslint/eslintrc";
const compat = new FlatCompat({
  baseDirectory: __dirname
});

/**
 * @type {import("eslint").Linter.FlatConfig[]}
 */
export default [
  js.configs.recommended,
  eslintConfigPrettier,
  ...compat.extends("eslint-config-my-config"),
  {
    plugins: {
      // plugins...
    },
    rules: {
      // rules...
    }
  }
];

It starts to work but it would be great if this plugin worked with the convertion.

@Shinigami92
Copy link
Collaborator

Please give tseslint.config (https://typescript-eslint.io/getting-started/#step-2-configuration) a try

@ChurroC ChurroC closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants