Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:42
    orzhtml closed #14732
  • 06:42
    orzhtml commented #14732
  • 06:39
    aladdin-add commented #14732
  • 06:16
    orzhtml commented #14732
  • 06:11
    orzhtml commented #14732
  • 05:14
    aladdin-add commented #14731
  • 05:14
    aladdin-add commented #14731
  • 05:09
    aladdin-add commented #14732
  • 04:42
    JoshuaKGoldberg synchronize #14617
  • 04:42
    JoshuaKGoldberg commented #14617
  • 04:42
    JoshuaKGoldberg commented #14617
  • 04:41
    JoshuaKGoldberg commented #14617
  • 04:37
    JoshuaKGoldberg synchronize #14617
  • 03:40
    orzhtml commented #14732
  • 03:13
    orzhtml labeled #14732
  • 03:13
    orzhtml labeled #14732
  • 03:13
    orzhtml opened #14732
  • 02:04
    JoshuaKGoldberg synchronize #14617
  • Jun 21 22:40
    RainNapper edited #14731
  • Jun 21 22:40
    RainNapper edited #14731
Matt Matheson
@mmatheson
Are fix ranges specific to rule implementations?
Jordan Harband
@ljharb
@mmatheson a hex editor is irrelevant; this is javascript and uses javascript rules
the range is specified, like all JS strings, in "code units"
and that checkmark is 1 code unit
(JS strings are UTF-16/UCS-2)
if you're applying the fix in "not javascript" then you're almost certainly going to mess something up
Matt Matheson
@mmatheson

the range is specified, like all JS strings, in "code units"

Right, I'm just asking if there's a way to specify that in bytes - I take it the answer is no

Couldn't find this in docs anywhere, can you point me in the right direction?
Jordan Harband
@ljharb
no, because that wouldn't be useful, because all fixes are applied in JS which doesn't have bytes as a concept
which part?
tbh i'm very baffled that anyone would ever think that any string info in the JS ecosystem would be in bytes unless explicitly called out as such
the fix should be applied using javascript string mechanisms. how are you applying the fix such that it cares about bytes?
Matt Matheson
@mmatheson
In c, open a file, seek to the beginning of a range and insert the replacement
re: asking for docs, i was wondering about docs around the range spec
Jordan Harband
@ljharb
why on earth would you be using C with eslint, a node program
Matt Matheson
@mmatheson
It's pretty common to have multiple languages in one repo, nice to have a unified way of linting/formatting everything at the same time
Jordan Harband
@ljharb
it is VERY uncommon, and often a very bad idea, to use "not node" for javascript tooling
even with multiple languages in one repo
C is only going to be wise to use with C, JS with JS, etc
Matt Matheson
@mmatheson
tbh I'm surprised that the spec of a machine-readable output would make the assumption about the consumer being a node program
Jordan Harband
@ljharb
how is it machine-readable?
the range is returned by a JS api
which says it's like ".slice", which is JS semantics
Matt Matheson
@mmatheson
Ok cool thank you
Jordan Harband
@ljharb
a rule's fixer is a javascript function. it simply isn't possible to apply it without a JS runtime
the "range" on a warning output tells you where the warning is, and where the fix might be applied - it does not tell you how to apply the fix. only invoking the function can apply the fix.
Matt Matheson
@mmatheson
I assume the range is also used by various ide plugins to do syntax highlighting, not all of which will be javascript programs?
Jordan Harband
@ljharb
oh sure. but that's not applying any fixes, that's just to annotate where the error lies
(altho the most common IDEs used in JS are indeed authored in javascript, using node)
Matt Matheson
@mmatheson
Ok, so it's not totally unreasonable to try to make sense of the json output outside of javascript (and is likely being done in many places)
Jordan Harband
@ljharb
it is if you're trying to apply the fix
it is reasonable if you're just trying to annotate the warned-upon region.
often, most of that region won't be fixable
(or rather, won't be altered when a fix is applied)
Matt Matheson
@mmatheson
Ok, thanks for the clarification.
philz
@philz

Hi! I'm fighting with performance for https://github.com/typescript-eslint/typescript-eslint. We have a large, multi project (in the tsconfig.json sense) repo. We run our typescript compiles (to find compilation errors) by using tsc -b one_subproject/tsconfig.json, running parallel tsc's per the topological sort of the dependency graph. This gives us enough parallelism that our overall tsc build is slow but not devastatingly so. (We also bump up the default heapsizes for tsc.) I'm trying to apply this same pattern for eslint (run it on one tsconfig.json at a time), and, for our bigger ones, eslint is seemingly spinning forever. Whenever I interrupt it with llnode to see where it's at, it's usually compiling typescript. For some projects it finishes, and for others it runs out of memory.

I'm looking for any context on how typescript-eslint interacts with typescript, and whether there are any caches that I can manipulate directly. i.e., I'd be perfectly happy to do a full typescript build first, if then eslint could use declarations/, perhaps? I'm slogging through it, but I'd appreciate any suggestions. (I've read https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/MONOREPO.md and definitely typescript-eslint/typescript-eslint#1192 seems related, and I'm trying to work around it by doing one project at a time.)

Roy Sutton
@webOS101
Was nibble the tool that was recommended for people adopting eslint into a code base?
Liveloper
@liveloper
hello all, there is a rule to disallow only the use of console.log
i want to disable console.log but allow console.warm and console.error
Jordan Harband
@ljharb
@liveloper why? the reason to disable console.log is because console doesn't exist in every browser
Dominic Watson
@intellix
Screenshot 2021-06-05 at 12.42.17.png
what rule is causing that? ^
binary64
@binary64
Hi I like the idea of eslint-nibble but does anyone know if I can automatically insert eslint-disable directives into my code?
Philippe Muller
@pmuller

Hi! I am looking for a rule that would enforce declaring destructured variables with a default value last.

Bad:

const { foo = 42, bar } = something;

Good:

const { bar, foo = 42 } = something;

Does such a rule exist?

Matt
@mattfysh
Does import/no-unresolved support export subpaths, i.e. the exports field in a package?
Jordan Harband
@ljharb
no, not yet - not until the resolve package does.
but for back compat any package using exports should have the same paths available via standard CJS resolution.
so in practice it shouldn’t come up except on a broken or hostile package
mikegreat
@bgreatfit
image.png