microsoft / vscode-eslint

VSCode extension to integrate eslint into VSCode
MIT License
1.7k stars 331 forks source link

Add support for ESLint feature flags #1895

Closed nzakas closed 2 days ago

nzakas commented 3 days ago

In ESLint v9.6.0, we added the ability to specify feature flags in ESLint. While there aren't any currently active feature flags, there will be in the coming months. Feature flags only work when using flat config files, and can be specified by passing flags into the ESLint constructor like this:

const eslint = new ESLint({
     flags: ["some_flag"]
});

It would be great to have an option in vscode-eslint that would allow users to specify which flags they'd like to enable.

dbaeumer commented 3 days ago

Makes sense. Just to be sure the type of the flags property is string[].

nzakas commented 3 days ago

That's correct.

dbaeumer commented 2 days ago

Actually. It is already supported. There is a eslint.options settings that is already passed into the ESLint class. You can simply add a flags property to it and it should work.

@nzakas let me know if this works for you.

nzakas commented 2 days ago

Ah nice! Yup, that should work. Thanks.