Comments (6)
Hi @mbfakourii 👋🏼! Thanks for opening an issue. I have stopped using Dart and I'm no longer familiarised with the linter. However, from what I understand about this rule, would consist on adding package:{packageName}
as a prefix of the import, right?
Should this only work for the root barrel file? I mean, should this package:{packageName}
prefix be added for a barrel file that is, for example, 3 folders deep? Or it should only be added to the top of the folder? Also, I would have to somehow get the packageName
from the pubspec.yaml
file, somehow, and I'm not really sure if that would be possible.
Nonetheless, I see that the linter has a quick fix for this issue, so if it is a bit of a mess to develop, I would suggest running the linter (maybe I can run it using VSCode's API) in order to fix it.
from dartbarrelfilegenerator.
This is solved with the v6.2.0
. You simply have to enable the option: dartBarrelFileGenerator.prependPackageToLibExport
.
from dartbarrelfilegenerator.
Quick fix does not work for this rule
An example of the code I mean is as follows
export 'package:myapp/core/bloc/checkout/checkout_bloc.dart';
export 'package:myapp/core/bloc/transaction/transaction_bloc.dart';
export 'package:myapp/core/config/config.dart';
export 'package:myapp/core/config/constants.dart';
export 'package:myapp/core/intl/generated/l10n.dart';
export 'package:myapp/core/model/enums/legal_status.dart';
This structure replaces the structure like below
export '../core/bloc/checkout/checkout_bloc.dart';
export '../core/bloc/transaction/transaction_bloc.dart';
export '../core/config/config.dart';
export '../core/config/constants.dart';
export '../core/intl/generated/l10n.dart';
export '../core/model/enums/legal_status.dart';
from dartbarrelfilegenerator.
So I understand this would ONLY happen for the barrel file that is at the root of the project, this being ./lib/<filename>.dart
, right?
from dartbarrelfilegenerator.
So I understand this would ONLY happen for the barrel file that is at the root of the project, this being
./lib/<filename>.dart
, right?
yes
from dartbarrelfilegenerator.
Sorry for the delay. Currently I'm a bit tight on time and can barely work on the weekends. I'm working on it.
from dartbarrelfilegenerator.
Related Issues (20)
- Can't use extension when using multiple folder inside workspace HOT 1
- using excludeFileList to exclude main.dart HOT 3
- Windows 10 Command 'Export Dart files in current directory to dir_name.dart' resulted in an error HOT 9
- Dependency Dashboard
- Action Required: Fix Renovate Configuration
- Option for default name of barrel files HOT 7
- works incorrectly if filename and directory name are the same HOT 3
- Generate single file without generating in its sub folders HOT 5
- Combined option for default file names HOT 3
- Cannot export a nested file with same name as outer folder HOT 8
- Use generator option on multiple diectories HOT 1
- Option for putting generated file at the same level as target folder HOT 11
- Readme documentation is not up-to-date
- Exporting empty files HOT 3
- Don't export files with `part of` declarations HOT 3
- Add shortcuts HOT 5
- glob patterns not matching as expected HOT 5
- Update command names HOT 2
- how to have a shortcut to barreling command for a hard-coded folder? HOT 8
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 dartbarrelfilegenerator.