Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

ESLint uses similar thing to Ranges

by Roy Revelt   ·   posted on Monday, 31 August 2020   ·   rangeslinting

Well, sort of.


If you check the ESLint API, the verify()opens in a new tab will return a range key:

{
  fatal: false,
  ruleId: "semi",
  severity: 2,
  line: 1,
  column: 23,
  message: "Expected a semicolon.",
  fix: {
    range: [1, 15], // <---- this
    text: ";"
  }
}

The string indexes are the same — they are also placed in an array — the only difference is ESLint explicitly tells what to insert using a separate key.

If ESLintopens in a new tab marked a finding like this:

{
  range: [1, 15],
  text: ";"
}

Ranges would mark it shorter:

[[1, 15, ";"]];

Very similar!

↑ back to top
older newer

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab