Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:29
    kaicataldo commented #12307
  • 02:25
    kaicataldo commented #12822
  • 02:23
    kaicataldo labeled #12822
  • 02:23
    kaicataldo unlabeled #12822
  • 02:22
    kaicataldo commented #12816
  • 02:18
    kaicataldo commented #12819
  • 02:13
    kaicataldo unlabeled #12819
  • 02:13
    kaicataldo labeled #12819
  • 02:07
    kaicataldo labeled #12820
  • 02:07
    kaicataldo labeled #12820
  • 02:07
    kaicataldo unlabeled #12820
  • 02:07
    kaicataldo commented #12820
  • 01:58
    mdjermanovic commented #12824
  • 01:05
    mdjermanovic labeled #12824
  • 01:05
    mdjermanovic labeled #12824
  • 01:05
    mdjermanovic labeled #12824
  • 01:04
    mdjermanovic opened #12824
  • 00:52

    mdjermanovic on radix-globaloff

    Fix: radix rule crash on disabl… (compare)

  • Jan 22 23:41
    mdjermanovic commented #12816
  • Jan 22 23:00
    mdjermanovic commented #12816
Kai Cataldo
@kaicataldo
Documentation can be found here: https://eslint.org/docs/developer-guide/nodejs-api
Marco Gutierrez
@marcosguti
error.png hi guys can help me with this error? eslint-plugin-prettier not working correctly i cant see any warning and fix eslint problems
Roy Sutton
@webOS101
Does it work if you run eslint from the terminal?
Marco Gutierrez
@marcosguti
example: eslint --fix actionReducer/index.js works but file view in vs-code dont show any warnings and fix suggestion when have errors
Roy Sutton
@webOS101
I think vscode is not setting the correct working directory for linting.
Marco Gutierrez
@marcosguti
not sure i think its really weird
maybe i should remove vs-code and install again?
Roy Sutton
@webOS101
Is the root of your workspace the same as the root directory you’re linting?
Marco Gutierrez
@marcosguti
how i can check that?
BrianD91
@BrianD91

how can I do conditionals in eslint?

Like if I use a certain import statement in my code, then I need to be sure that at the top of the file there's a /** @jsx jsx */ pragma

Marco Gutierrez
@marcosguti
@webOS101 ?
Roy Sutton
@webOS101
When you go to the file list in VS Code, is api the root?
Marco Gutierrez
@marcosguti
yes
Roy Sutton
@webOS101
Then I don’t know. I don’t have VS Code set up the same way so I can’t help debug that.
Jef Braem
@braemJef
Hello, is there anyone online here?
raghukiranp
@raghukiranp

Thanks @ilyavolodin this was what I was looking for... overlooked in the documentation...

Another query as followup to above response, is there a way I can configure eslint lint to warn for one configuration and error for another configuration...

I am looking for something like max-lines should warn if between 250 - 500 lines and error is file has more than 500 lines.

I can write a custom rule for max line ranges, however, does eslint have an option to switch between warn and error based on config? should this be requested as a feature or does not make sense at all.

Lakshay-Sood
@Lakshay-Sood
how can i stop eslint from generating errors on the Current Line?
Haisum
@Haisum92
i think, it was something //eslint-disable-next-line no-console
Lakshay-Sood
@Lakshay-Sood
its not working
Ilya Volodin
@ilyavolodin
@raghukiranp No, this doesn't exist. And it would not be possible with the current setup. Rules don't know anything about reporting levels. They just report an error, it's up to the engine to figure out if that error should be reported as a warning or error based on the config.
m3dve
@m3dve
Thank you @marcosguti , am going to check it.
Kevin Partington
@platinumazure
@Lakshay-Sood Try this: // eslint-disable-line rule-name (eslint-disable-line does the same line, whereas eslint-disable-next-line does the line below)
Ryan Hirsch
@RyanHirsch
I have a rule that I'm attempting to disable. When I run eslint over the file it still is being flagged as an error. When I run eslint with debug, I see 3 values set in the ConfigArray, error from a plugin, off from my rules, error from the same plugin
The names from the ConfigArray for theses settings are
.eslintrc.js#overrides[2] » plugin:@typescript-eslint/recommended
.eslintrc.js#overrides[2]
.eslintrc.js#overrides[3] » plugin:@typescript-eslint/recommended
if it helps
Ryan Hirsch
@RyanHirsch
Figured it out, the 4th override was pulling in some conf from the third, but no the rule overrides. Our config is way too complicated
Tompouce
@Tompouce-onGit

Hello!
So I'm using ESlint in VScode, and I have the 'quotes' rule set up as such:

"quotes": ["warn", { "allowTemplateLiterals":  true }]

But I get a notification from the ESlint extension telling me that it is invalid:
eslint-error
Has anybody else had this issue and knows a fix?

Jordan Harband
@ljharb
what version of eslint?
Tompouce
@Tompouce-onGit
running eslint --version gives v6.7.2
Jordan Harband
@ljharb
https://eslint.org/docs/rules/quotes the object option is the second one
you need to pass one before it, double, single, or backtick
Tompouce
@Tompouce-onGit
Ooh, okay that makes sense, my bad
Thanks
czaylove
@czaylove
image.png
please help me
I have difficulty fixing errors
Kevin Partington
@platinumazure
@czaylove As the error message says, it couldn't find a configuration file. Do you have an ESLint configuration file in your project somewhere?
Tanya Marych
@TMarych_twitter

Hi
I still can not see answer for problem with eslint and "@babel/plugin-proposal-optional-chaining"

"Hi, I installed "@babel/plugin-proposal-optional-chaining": "^7.6.0", and added to .eslintrc.json"

with this error: ESLint couldn't find the plugin "@babel/eslint-plugin-plugin-proposal-optional-chaining".

Can someone help with that, please?
eyelidlessness
@eyelidlessness
i don't know anything beyond just looking at the names, but those appear to be different package names. did you try also installing @babel/eslint-plugin-plugin-proposal-optional-chaining?
or does @babel/plugin-proposal-optional-chaining install that too?
Tanya Marych
@TMarych_twitter
yes, I installed this one and now eslint is broken
eyelidlessness
@eyelidlessness
you mean you installed both packages?
Tanya Marych
@TMarych_twitter
image.png
I installed @babel/plugin-proposal-optional-chaining
eyelidlessness
@eyelidlessness
it appears to be looking for the plugin named eslint-plugin-optional-chaining
Tanya Marych
@TMarych_twitter
Okay
lets start from beginning
I want to use @babel/plugin-proposal-optional-chaining in my project
But with it I can not use eslint anymore because of this error
So how can I add this plugin to eslint config to make it work?
eyelidlessness
@eyelidlessness
did you add eslint-plugin-optional-chaining to the plugin section of your config? or did eslint just infer that it should be there when you installed the babel plugin? (i don't use babel so just feeling around in the dark here to try to understand why it's looking for the plugin)
Tanya Marych
@TMarych_twitter
eslint-plugin-optional-chaining this one does not exist.
the second suggestion is correct
It looks for eslint-plugin-optional-chaining when have to @babel/plugin-proposal-optional-chaining
I know that it works by the rule that every plugin should have eslint-plugin-[name of plugin], but @babel/plugin-proposal-optional-chaining does not
So is it any way to use babel and eslint together?
eyelidlessness
@eyelidlessness
it sounds like that plugin may need to exist to use eslint with that babel plugin?
rhpijnacker
@rhpijnacker
I'd like to do some code refactoring and am considering to create some fixable custom eslint rules for this. However, I have the feeling I'm fixing too much.
Are there alternative solutions for something like this I could explore?