Coder Social home page Coder Social logo

Comments (6)

mikededo avatar mikededo commented on August 11, 2024 1

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.

mikededo avatar mikededo commented on August 11, 2024 1

This is solved with the v6.2.0. You simply have to enable the option: dartBarrelFileGenerator.prependPackageToLibExport.

from dartbarrelfilegenerator.

mbfakourii avatar mbfakourii commented on August 11, 2024

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.

mikededo avatar mikededo commented on August 11, 2024

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.

mbfakourii avatar mbfakourii commented on August 11, 2024

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.

mikededo avatar mikededo commented on August 11, 2024

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)

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.