Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
Is there a lint rule to enforce export star from folders only?

I have a published npm monorepo with 5 packages.

In each index file, I would like to enforce a convention where function and objects from the same folder are exported explicitly, whereas exports from any nested folder are exported with star (*). This way, I will avoid exposing things that I don't plan to the user of my package (while I still need to import them from within the same folder).

Each index.js will export everything from a nested folder, and by name from files in the same folder.

Example:

- app
  + index.js
  + foo
  | + index.js
  | + bar.js 
  | + nestedFolder
    | ...
// app/index.js

export * from './foo';
// app/foo/index.js

export { someFunction } from './bar';
export * from './nested-folder';

Is there an existing lint rule that can fit our needs?

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!