Giter Site home page Giter Site logo

Comments (8)

chrisvltn avatar chrisvltn commented on June 7, 2024 1

Sure 👍 thanks for the quick discussion. I'll find some time soon to open a PR

from eslint.

Tanujkanti4441 avatar Tanujkanti4441 commented on June 7, 2024

Hi @chrisvltn, thanks for the issue.

I think this is a good idea to add regex for no-restricted-exports rule but according to your specification we can also think about an option that would contain only those export names that are allowed and other will be restricted.

@eslint/eslint-team, should we consider this?

from eslint.

chrisvltn avatar chrisvltn commented on June 7, 2024

@Tanujkanti4441 great idea. A rule to allow only certain named exports would also fit well to solve the problem :)

from eslint.

nzakas avatar nzakas commented on June 7, 2024

I don't feel strongly either way, but if we do make this change, I think we should match how regexes are defined in no-restricted-imports.

from eslint.

JoshuaKGoldberg avatar JoshuaKGoldberg commented on June 7, 2024

+1 in general to this request and keeping consistent with equivalent rules. Especially when there's already mirroring in the rule name: e.g. no-restricted-(exports|imports).

For specifically mirroring no-restricted-imports, is there a need to mirror paths? I'd think everything would be doable with patterns that use ^ and/or $ to delineate full matchers.

from eslint.

mdjermanovic avatar mdjermanovic commented on June 7, 2024

I don't see much similarity between these two rules, despite the similar names.

no-restricted-imports is about disallowing the use of existing modules by specifying string paths or .gitignore-style patterns that match the import source (e.g., "mod" in import { foo } from "mod"). Optionally, only certain names (foo) can be disallowed by additionally specifying importNames or importNamePattern.

no-restricted-exports is about naming new exports. There's no import source to which paths/patterns would correspond.

We could add an option restrictedNamedExportsPattern (a string that will be used as a regex pattern)?

from eslint.

nzakas avatar nzakas commented on June 7, 2024

We could add an option restrictedNamedExportsPattern (a string that will be used as a regex pattern)?

I suppose that does go along with the existing restrictedNamedExports option. 👍

Marking as accepted.

@chrisvltn would you like to submit a pull request?

from eslint.

fasttime avatar fasttime commented on June 7, 2024

Closed by #18431

from eslint.

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.