thepassle / eslint-plugin-barrel-files

MIT License
118 stars 10 forks source link

Should allow disabling "avoid namespace import" when used for types #3

Open jasikpark opened 9 months ago

jasikpark commented 9 months ago

I want to do import type * as React from "react" and not be warned, but to be warned for actual code, is that a reasonable option to support?

How do you measure if this plugin has changes in bundle size / build time / HMR refresh time?

thepassle commented 9 months ago

Ah yes, that sounds reasonable, we should check to see if the import/export is typeonly. Should be an easy fix

can you elaborate on the 2nd point? Im not entirely sure what you mean

thepassle commented 9 months ago

I want to do import type * as React from "react" and not be warned, but to be warned for actual code, is that a reasonable option to support?

This should be fixed in 1.0.3 via https://github.com/thepassle/eslint-plugin-barrel-files/pull/4

merodiro commented 5 months ago

Is it possible to allow namespace imports for certain libraries? I want to allow namespace imports from react only. because most examples use import * as React from 'react'

thepassle commented 5 months ago

We could add a allowList configuration option, should be straightforward enough to implement, would you be willing to create a PR?

merodiro commented 5 months ago

Sure, I will try to implement it and create a PR. Thanks for your response