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

191
Views
How to separate internal and external import groups in JS

I currently use tslint. But, since it's deprecated I want to start using eslint instead.

The only problem is I can't find a way to achieve the same import grouping rules as I have in tslint:

"ordered-imports": [
  true,
  {
    "module-source-path": "full",
    "grouped-imports": true,
    "groups": ["^([a-z]|@(?!app))", "^(\\.|@app)"]
  }
],

Which basically does that separation:

import { errors } from '@common/service-framework/api-utils';
import { AIPayloads } from '@models/core.common.model';
import { groupBy, isEmpty, map, sortBy, uniqBy, values } from 'lodash';
import * as hashObject from 'object-hash';

import { roundRobin } from '@app/common/utils';
import { sanitizeList } from './helpers';

What is does in other words (Rules):

  • All @something except @app are treated as external imports.
  • All @app and . are treated as internal imports.
  • External and internal imports are imported in separated groups with a space-line between them.

Now, I don't mind if a solution has no freestyle regex option. I only care about achieving the same result.

How can I achieve the same import grouping rules in eslint?

about 4 years ago · Juan Pablo Isaza
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!