Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

192
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda