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

166
Views
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
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!