Comments (5)
Just stumbled upon the problem, would really like a fix
from eslint-plugin-perfectionist.
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.
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.
Could you please demonstrate what the conflicts look like in the TS files?
from eslint-plugin-perfectionist.
// 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)
- Bug: (sort-object): Cannot read properties of undefined (reading 'getTokensBefore') HOT 7
- Bug: (sort-interfaces): Configuration for rule "perfectionist/sort-interfaces" is invalid when using `optionality-order` HOT 1
- Bug: (sort-objects): How to sort vue options(data, computed, watch, methods), how to ignore child sorting in methods? HOT 2
- Feature: (sort-objects) option for destructuring only HOT 5
- Feature: sort-intersection-types and anonymous types
- Bug: Allow typescript-eslint/utils@7? HOT 1
- Feature: Support computed properties for sort-objects and sort-object-keys HOT 2
- Bug: (sort-intersection-types) wrong version information in the rule documentation
- Bug: sort-imports sorts individually in custom-groups array HOT 5
- Feature: implement ignore-pattern based on word before, not object name
- Feature: `sort-imports` custom-groups Regex match
- bug(types): Typing files are missing for `tseslint.configs.strictTypeChecked` in FlatConfig HOT 1
- Feature: Providing Disabling Rules that Conflict
- Feature: sort-imports sort order by group order in line-length
- Feature: sort-intersection-types `objects-last` HOT 1
- Bug: no type definition for eslint flat config HOT 1
- Feature: (sort-classes) Add custom-groups to sorting capabilities
- Feature: `sort-object-types` add support for `newlines-between`
- Feature: Context-aware Rules
- Feature: Consider porting typescript-eslint/sort-type-constituents' groupOrder option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-perfectionist.