Score:0

How to use the packaged ESLint on Ubuntu

us flag

There's an apt package called eslint in Ubuntu 22.04, and I intend to use it presumably it's easier to setup.

But when I run eslint --init in my project directory, as well as my home directory, it throws a stack of exceptions, saying that the rejection of some Promise wasn't handled. And I'd like to know:

  1. How do I initialize a project directory for ESLint installed from apt?
  2. How do I reach the point where official docs for eslint would work for me, or alternatively
  3. After I've done 1, what doc should I consult?
DannyNiu avatar
us flag
Is it the case that the `eslint` package is outdated?
muru avatar
us flag
Well, yes, https://packages.ubuntu.com/jammy/eslint says it's at 6.4.0, but https://www.npmjs.com/package/eslint is already on 8.35.0. I wouldn't expect there to be a lot of common ground between these the online docs and the version packaged for 22.04. With ecosystems like NPM, you might be better off just using `npm` to install `eslint`.
DannyNiu avatar
us flag
@muru Am I right to believe that's a broken unmaintaned package by this point? (Debian sid still has it, also very old.)
Hi-Angel avatar
es flag
@DannyNiu well, it's not that it's "unmaintained package", rather that Ubuntu sees "old packages" as something cool to have, claiming it's "stable". Aside of a few chosen packages like Firefox and Chromium, Ubuntu never updates its software to newer major version within given distro version. `eslint` ain't special, it's also the problem with core packages like Mesa, Xorg, kernel *(although for some of them there're opt-in hwe versions)*… See e.g. [my answer here](https://askubuntu.com/a/1442896/266507). Yeah, it's very sad, but that's the policy of Ubuntu as a distribution.
waltinator avatar
it flag
`dpkg -L eslint` will list all the files in the `eslint` package. Read some of them. Also `man eslint`. Are you missing libraries that the program needs? `ldd $(type -p eslint)`.
muru avatar
us flag
@Hi-Angel that's not a *claim* - it is *stable*, just a different meaning than what you're thinking of ("stable" as in "unchanging", not "stable" as in "bug-free").
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.