Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:49
    mdjermanovic commented #12381
  • 01:49
    mdjermanovic labeled #12655
  • 01:49
    mdjermanovic labeled #12655
  • 01:49
    mdjermanovic labeled #12655
  • 01:49
    mdjermanovic unlabeled #12655
  • 01:48
    eslint[bot] labeled #12655
  • 01:48
    mdjermanovic opened #12655
  • 00:58

    mdjermanovic on prefernumericliterals-bigintcrash

    Fix: prefer-numeric-literals do… (compare)

  • 00:16
    mdjermanovic commented #12646
  • Dec 10 23:37
    mdjermanovic commented #12646
  • Dec 10 23:09
    ilyavolodin labeled #12381
  • Dec 10 23:09
    ilyavolodin unlabeled #12381
  • Dec 10 23:00
    mdjermanovic commented #12381
  • Dec 10 22:56
    ilyavolodin commented #12612
  • Dec 10 22:43
    eslint[bot] labeled #11504
  • Dec 10 22:43
    eslint[bot] locked #11504
  • Dec 10 22:43
    eslint[bot] labeled #11829
  • Dec 10 22:43
    eslint[bot] locked #11829
  • Dec 10 18:54
    yeonjuan synchronize #12652
  • Dec 10 18:09
    yeonjuan commented #12632
Ilya Volodin
@ilyavolodin
That would require configuration of the sublime plugin to tell it to only lint subfolder, and change pwd when it executes eslint
Sorry, don't know anything about sublime plugin, so not sure if it's possible to do
Chris Greenwood
@otang
Or, to tell it where to look for node_modules
Ilya Volodin
@ilyavolodin
You could do that, but most likely you will run into other issues, since root folder is going to be your pwd, and ESLint considers pwd as a root of the project
But again, you might run into other issues
Chris Greenwood
@otang
Thank you I will take a look
Derek Leung
@drkstersetweets_twitter
Hi guys. Is ESLint enabled the moment you add values to the extends or rules keys? I ask because I installed eslint-plugin-tslint to run an instance of tslint inside eslint, handling TSLint rules with no ESLint equivalents yet, but when I test if ESLint is on by enabling an ESLint rule that TSLint won't catch, it doesn't give me an error for violating that rule.
Jordan Harband
@ljharb
yes, nothing will warn unless a rule is enabled
installing things does nothing
(by itself)
Derek Leung
@drkstersetweets_twitter
Oops maybe I was unclear, I've definitely added keys to extends and rules, including an ESLint rule that TSLint won't catch, but ESLint isn't responding to my test. My test was adding no-debugger to the ESLint rules key, and turning off no-debugger in TSLint, and putting a debugger; statement in my code. It just tells me "Compiled successfully," neither TSLint nor ESLint catch it now. What reasons might stop ESLint from linting?
Roman
@moltar
Hi, what can go into the overrides section? I tried to find the docs for that, but cannot find anything. Can I override any value from the top level config?
E.g. can I set env for a specific pattern of files?
Can I setup a different parser for specific files? E.g. only use typescript parser for *.ts files?
Jordan Harband
@ljharb
@drkstersetweets_twitter "compiled successfully" isn't something eslint reports. are you running eslint via the command line? no other method is important until that works.
Derek Leung
@drkstersetweets_twitter
@ljharb Oh interesting, "Compiled successfully" must be a TSLint-only thing then. I'm migrating from TSLint to ESLint, and I set up my eslintrc.js file using the tslint-to-eslint-config package associated with the typescript-eslint repo, and some manual setup.
Jordan Harband
@ljharb
i'd start by disabling your eslint-plugin-tslint thing, and get all those things working
then add in the new plugino
Derek Leung
@drkstersetweets_twitter
I could have missed a step somewhere, a lot of packages are involved at the typescript-eslint monorepo and I tried to put all the instructions together
Derek Leung
@drkstersetweets_twitter
When I attempt to run ./node_modules/.bin/eslint --init at the ESLint Getting Started docs, I get -bash: ./node_modules/.bin/eslint: No such file or directory. This is after checking that my yarn.lock has the eslint package, and running yarn install to install all dependencies in case
Jordan Harband
@ljharb
are you in your repo root, where package.json is?
also are you using windows?
Derek Leung
@drkstersetweets_twitter
@ljharb My folder is where package.json is, and where there's a node_modules folder at the first level. It's not the repo root though. I'm using a Mac
Jordan Harband
@ljharb
ok, that should still be fine (altho generally you want all those things in the repo root)
i don't use yarn, but i'd expect npm install to put eslint in the .bin folder
Derek Leung
@drkstersetweets_twitter
Okay, thanks for the feedback! You did confirm some things for me
Has anyone installed ESLint with yarn, or done a TSLint to ESLint migration?
Jesse Jackson
@jsejcksn_gitlab

How to understand the source of a linting error?

I have the following code in a project bootstrapped with create-react-app, but which is extended from multiple configs:

const objectFromNestedEntries = arrayOfEntries => {
  if (!Array.isArray(arrayOfEntries)) return arrayOfEntries;
  const obj = {};
  for (const [key, value] of arrayOfEntries) {
    obj[key] = objectFromNestedEntries(value);
  }

  return obj;
};

and I am getting linting errors that key and value are defined, but never used no-unused-vars. However, that's clearly not the case, so how can I determine which line from which config is causing this?

Jordan Harband
@ljharb
there's an open bug on eslint about that one
Jesse Jackson
@jsejcksn_gitlab
@ljharb Thanks for responding. I am still wanting to understand how to determine the source of errors when multiple extends are used.
and can you link to the issue or provide the issue number?
Jordan Harband
@ljharb
the source is the code; as for which config originated it, there’s no easy way, but it doesn’t really matter - all you need to do is override the rule in your config if you want
i don’t have it off hand, sorry
Jesse Jackson
@jsejcksn_gitlab
Jordan Harband
@ljharb
yep, looks right to me too!
Ilya Volodin
@ilyavolodin
Haci Kale
@HaciKale
Does anybody have a good article about how to set up Eslint with Create React App, React and Airbnb,
I'm about to go mad with these settings
RedstoneMiner27
@RedstoneMiner27
when I go to the global eslint installation, and then in the 'conf' folder, there are two files named 'eslint-all' and 'eslint-recommend'. which one does eslint use for default? or is it on some other path?
RedstoneMiner27
@RedstoneMiner27
INACTIVEEE
Jordan Harband
@ljharb
@redstoneminer27 eslint uses no config by default. also why do you have a global installation at all
Luiz Felipe Gonçalves
@lffg
Is it possible to use the ESLint API in the front-end?
Ilya Volodin
@ilyavolodin
Yes, it is, although it's not officially supported: https://eslint.org/demo
Kyoungtaek Koo
@boxersb
@platinumazure thanks :D
Thomas Tortorini
@mr21
Hi all :)
Is there a rule or a setting to prevent turning off rules with eslint-disable-line?
EDIT: I found it, it was "noInlineConfig": true, :)
Marko Benigar
@markobenigar
hi there
Screen Shot 2019-09-16 at 4.24.40 PM.png
Can you help me fix this error, it doens't want to commit/push because of it
Kevin Partington
@platinumazure
@markobenigar That doesn't look like an ESLint issue, so I'm not sure how to help