-
-
Notifications
You must be signed in to change notification settings - Fork 564
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
Support for Eslint v9 Flat Config format #411
Comments
I read https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config and confirmed this way can resolve this issue at present: import path from 'node:path'
import url from 'node:url'
import { FlatCompat } from '@eslint/eslintrc'
export default [
...(new FlatCompat({
baseDirectory: path.dirname(url.fileURLToPath(import.meta.url)),
}).extends('eslint-config-standard')),
// ...
] |
another solution is: import path from 'node:path'
import url from 'node:url'
import { FlatCompat } from '@eslint/eslintrc'
export default [
...(new FlatCompat({
baseDirectory: path.dirname(url.fileURLToPath(import.meta.url)),
}).config({
extends: [
'eslint-config-standard',
],
})),
// ...
] |
This also works import { FlatCompat } from '@eslint/eslintrc'
const compat = new FlatCompat()
export default [
// standard,
...compat.extends('eslint-config-standard'), |
This worked for me import { FlatCompat } from '@eslint/eslintrc'
import { fixupConfigRules } from '@eslint/compat'
const compat = new FlatCompat()
export default [
...fixupConfigRules(
compat.config({
extends: ['standard']
})
)
// other config objects
] |
Thanks for the solutions. Am I going insane or is eslint completely pointless without support for this package? |
It's weird that this is an issue since the README quite literally says that:
|
@ZelnickB The code in the current repo is not released |
@voxpelli could you please release a version with support for the flat eslint config file? It can be a pre-release too, as that also helps. |
@pjg As mentioned in standard/standard#1948 (comment) an alternative version has been released. Besides that, I do not know what state the current repository is in as it was modified without my involvement |
Now though the documentation indicates that this repo has supported ESLint flag config, but in fact, this still existed some issues |
Simply importing packages like |
@whaaaley Unless you created an issue about this in I myself use the ESLint VS Code extension all the time and with great success, and one of the primary design goals of |
@voxpelli would you mind sharing your setup? I have been watching this issue for a long time and I also still have issues getting with vscode. Thanks a lot |
@Mtillmann I don’t want to hijack this thread too much, questions regarding https://github.com/neostandard/neostandard and its setup I’ll answer there, it’s essentially |
I happened to hit upon one of the previous issues we'd come across when considering how we could get ESLint and StandardJS to work together. [Support for Eslint v9 Flat Config format](standard/eslint-config-standard#411) was one of the blockers that meant to have both ESLint and StandardJS play ball, we were stuck on ESLint v8. I spotted that there had been some [recent activity](standard/eslint-config-standard#411 (comment)), all of which referenced an alternative called 'neostandard'. And oh my! All my issues/dreams were answered - Built for ESlint to avoid the need for separate IDE tooling - Built for the latest ESLint (v9) so flat-file config is supported - Just like we did, any style rules have been updated to use @stylistic/eslint-plugin - A desire to work with current practices. So, banning or requiring ; is an option, along with disabling style rules for those opting to use prettier For context, maintenance on StandardJS and related packages like eslint-config-standard has been stalled for some time. neostandard references the issue as being a [block in governance and direction of travel](standard/standard#1948). I've not been through every message, but it appears the maintainers are split between those who remained committed to StandardJS's 'one-tool one way' approach and those looking to move to where most folks are: ESLint. Even our own @johnwatson484 [has gotten involved!](standard/standard#1948 (comment)) The thread suggests that those behind StandardJS are open to reconciling the neostandard fork with StandardJS. But that comment was made some time ago. My bet is neostandard is here to stay as the successor to StandardJS. So, this change strips out all my hand-cranked implementations of the StandardJS rules, including those it was implementing from other plugins and replaces them with neostandard. Lovely!
Here's what I did
config as follows in eslint.config.js
this will report:
What I expected to happen
should use as above without reporting error
What seems to have happened
it seems that currently eslint-config-standard does not support for flat config format, is there any plan to migrate to flat config format in the future?
The text was updated successfully, but these errors were encountered: