Giter Site home page Giter Site logo

Comments (6)

bradzacher avatar bradzacher commented on June 7, 2024 1

Note: @typescript-eslint is using a new package because we have both the plugin and the parser. It does also help us out as we don't even need to think about the problem cos it comes for free heh.

The advice from upstream is the breaking change approach - though I don't like it, personally as it's making second class citizens of users not on flat configs.

There's no specific reason that you need to make it available on the .config export of your package. You could also do it as a different exported name, or a separate path (eslint-plugin-regexp/config).

from eslint-plugin-regexp.

fisker avatar fisker commented on June 7, 2024 1

Unicorn didn't use /config because this requires exports to be added in package.json, since it should support both import and require.

from eslint-plugin-regexp.

ota-meshi avatar ota-meshi commented on June 7, 2024

I'm still wondering how best practice is to export a new shareable configuration 🤔
I would like to export using the same method as the popular eslint-plugin, but I don't know what it is yet.

Otherwise, I can think of the following method:

  • Use configs.recommended namespace.
    plugin.configs.recommended is reserved for legacy configurations.
    I don't want to change it for backwards compatibility.
  • Use a new namespace.
    I don't want to use names like plugin.flatConfigs.recommended, and plugin.configs.flatRecommended. "Flat" quickly becomes meaningless.
    Also, I think it is difficult to understand the difference between config and configs.
    I'm not sure what namespace to use instead that would be easier for people to use.
  • Use new *.js file.
    e.g. import { recommended } from 'eslint-plugin-regexp/configs'.
  • Make plugin.configs an object-like function with properties.
    e.g. plugin.configs('recommended').

from eslint-plugin-regexp.

fisker avatar fisker commented on June 7, 2024

eslint-plugin-unicorn decide to use plugin.configs['flat/recommended'], its used in ESLint blog post, see also discussion.

from eslint-plugin-regexp.

ota-meshi avatar ota-meshi commented on June 7, 2024

Thank you for sharing the discussion! I will check it.

from eslint-plugin-regexp.

ota-meshi avatar ota-meshi commented on June 7, 2024

This is just a note of my research.
I looked into how each plugin supported flat configurations. By the way, none of the plugins I maintain support flat configurations yet.

plugin.configs['flat/recommended']

import recommended from 'eslint-plugin-x/configs/recommended'

Renamed legacy configurations (Breaking change)

Not supported yet (PR is open)

Not supported yet


Unorganized notes

It looks like eslint-config-standard has dropped support for legacy configurations.
https://github.com/standard/eslint-config-standard

from eslint-plugin-regexp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.