uhyo / eslint-plugin-import-access

https://www.npmjs.com/package/eslint-plugin-import-access
MIT License
361 stars 9 forks source link

Import from export * cause error #32

Open quangnmwork opened 5 months ago

quangnmwork commented 5 months ago

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 commented 5 months ago

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.

uhyo commented 5 months ago

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.