Giter VIP home page Giter VIP logo

Comments (5)

snevolin avatar snevolin commented on June 5, 2024

Just stumbled upon the problem, would really like a fix

from eslint-plugin-perfectionist.

azat-io avatar azat-io commented on June 5, 2024

This is done for security reasons.

Example:

// a.js
export function func {
  return 1
}
// b.js
export function func {
  return 2
}

Depending on the priority, we will have different function values.

We intentionally do not sort exports with an * because there may be conflicts.

from eslint-plugin-perfectionist.

snevolin avatar snevolin commented on June 5, 2024

Actually, this problem doesn’t exist in TypeScript because these conflicts are immediately visible. Maybe we could consider implementing sorting just for ts files?

from eslint-plugin-perfectionist.

azat-io avatar azat-io commented on June 5, 2024

Could you please demonstrate what the conflicts look like in the TS files?

from eslint-plugin-perfectionist.

snevolin avatar snevolin commented on June 5, 2024
// a.ts
export function func () {
  return 1
}
// b.ts
export function func () {
  return 2
}

And if you had put exports in index.ts like this

export * from './b'
export * from './a'

You'd get a TS error:

Module './b' has already exported a member named 'func'. Consider explicitly re-exporting to resolve the ambiguity.ts(2308)

from eslint-plugin-perfectionist.

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.