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

Already publish flat config version? #351

Open
Tracked by #18093
JiangWeixian opened this issue Oct 18, 2023 · 12 comments
Open
Tracked by #18093

Already publish flat config version? #351

JiangWeixian opened this issue Oct 18, 2023 · 12 comments

Comments

@JiangWeixian
Copy link

Here's what I did

I install 17.1.0 version, But packages not contain flat eslint config (e.g. libs/index.js)

What I expected to happen

Using a flat configuration is like what the README.md describes

@geekytime
Copy link

It looks like the flat config is available on the master branch, so it's the default in the docs, but it hasn't been published, yet. I think the @latest published version is still the old-style config.

@mightyiam
Copy link
Member

Sorry. @geekytime is correct. We (I, @rostislav-simonik and @jay-bulk) simply don't have the npm permissions necessary to do this yet.

@mightyiam
Copy link
Member

To publish this package, that is.

@jaridmargolin
Copy link

@mightyiam - Is there any interest in tagging/creating a git release so folks can still use the new config via a github URL?

@mightyiam
Copy link
Member

@mcollina we need publish permissions.

@JamiesonRoberts
Copy link

JamiesonRoberts commented Nov 26, 2023

Any update on this? Or getting in contact with a maintainer that can either grant permissions or publish to NPM?

Another thought: should probably setup automatic deployment to NPM on a release creation via GitHub, that way it avoids this issue in the future

@mightyiam
Copy link
Member

standard/standard#1948

@EliRobinson
Copy link

While we wait patiently for this to come true, has anyone figured out a workaround to bypass the parserOptions errors?

@mightyiam
Copy link
Member

Just wanted to let those following know that I no longer participate here, because I was never granted the trust of the original author.

I took my work to eslint-config-love.

@donalmurtagh
Copy link

donalmurtagh commented May 14, 2024

While we wait patiently for this to come true, has anyone figured out a workaround to bypass the parserOptions errors?

Yes!

It's possible to make the current version work in an ESLint v9 flag configuration file using @eslint/compat by following these instructions.

In my case I made these changes to eslint.config.js

import { FlatCompat } from '@eslint/eslintrc'
import { fixupConfigRules } from '@eslint/compat'

const compat = new FlatCompat()

export default [
  ...fixupConfigRules(
    compat.config({
      extends: ['standard']
    })
  ),
  // other config objects
]

@lwr
Copy link

lwr commented Oct 16, 2024

it's possible to make the current version work in an ESLint v9 flag configuration file using @eslint/compat

@donalmurtagh there is another problem that the declared peer dependency version of eslint is not compatible with eslint 9

as another choice we are using this script with no more dependencies

import standard from 'eslint-config-standard'
import stylistic from '@stylistic/eslint-plugin'

const patchedRules = ({...rules}) => {
    // remove deprecated rules
    delete rules['no-new-object'];
    rules['no-object-constructor'] = ['error'];
    // patch stylistic rules
    return Object.fromEntries(Object.entries(rules).map(([id, x]) => stylistic.rules[id] ? [`@stylistic/${id}`, x] : [id, x]));
}

export default {
    languageOptions : {
        ecmaVersion   : 'latest',
        parserOptions : {ecmaFeatures : {jsx : true}},
    },

    plugins : {
        ...Object.fromEntries(await Promise.all(standard.plugins.map(
            async key => [key, (await import(`eslint-plugin-${key}`)).default]))),
        '@stylistic' : stylistic,
    },

    rules : patchedRules(standard.rules),
}

@voxpelli
Copy link
Member

There is an up to date version over at https://github.com/neostandard/neostandard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

9 participants