eslint-plugin-import-access icon indicating copy to clipboard operation
eslint-plugin-import-access copied to clipboard

Import from export * cause error

Open quangnmwork opened this issue 1 year ago • 2 comments

When I try export from like this :

/app/bff/client.ts

export const function1 = () => {}
export const function2 = () => {}
...
export const function_n = () => {}

And in app folder I have exported will package jsdoc like this.

/*
@public
*/
export * from './client'

From the same level folder with bff. Let's say component folder . I try to to import like this.

import {function1} from './bff

It's will throw Cannot import a package-private export 'function1'.

Is that a bug of plugin. Or can you show me how to solve this problem.

quangnmwork avatar Apr 25 '24 13:04 quangnmwork

I found a way that on top on every function that you want import . You must put /**@public**/ jsdoc . But in my situation the client.ts is generated file , so I can't do that.

quangnmwork avatar Apr 25 '24 14:04 quangnmwork

Thank you for the bug report! I think I want to fix the behavior, but I need to look into it to know whether it is fixable.

uhyo avatar Apr 25 '24 15:04 uhyo