Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

170
Vistas
Is it possible to create plugin without selector in eslint?

I want to create eslint plugin.

export const rule = ESLintUtils.RuleCreator(() => __filename)({
  name: RULE_NAME,
  meta: {
    type: 'problem',
    docs: {
      description: ``,
      recommended: 'error',
    },
    schema: [],
    messages: {},
  },
  defaultOptions: [],
  create(context) {
    return {};
  },
});

I'm not so familiar with eslint plugin.

From what I read in the eslint docs I need to return an object with a selector of what I looking for in the code (for example VariableDeclaration) and then I'll get the ts node in the callback function.

But is it possible to not return the selector, instead just to return callback and in this callback I'll get the root ts node and I'll do my own logic there with ts-morph?

I mean something like this possible to do with eslint?

import { ts } from 'ts-morph';
...

  create(context) {
    const rootNode = context.getRootNode() as ts.Node;
    const nodes = rootNode.getChildren().map(n => ....)

    nodes.forEach(node => {
      context.report({
        node,
        messageId: 'some'
      })
    })

  },
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda