Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:26
    bodograumann commented #3458
  • 07:50
    bendtherules commented #13705
  • 03:31
    123aswin123 labeled #13784
  • 03:31
    123aswin123 labeled #13784
  • 03:31
    123aswin123 opened #13784
  • 02:38
    yeonjuan synchronize #13775
  • 02:38

    yeonjuan on temp-literal-no-script-url

    check only string literal (compare)

  • 00:52

    nzakas on simple-config-step-3

    Update tests/lib/eslint/eslint.… (compare)

  • 00:52
    nzakas synchronize #13762
  • 00:18
    masparasol commented #13739
  • Oct 22 22:11

    eslintbot on master

    Sponsors: Sync README with webs… (compare)

  • Oct 22 20:15
    mdjermanovic commented #13781
  • Oct 22 20:00
    mdjermanovic labeled #13781
  • Oct 22 20:00
    mdjermanovic unlabeled #13781
  • Oct 22 20:00
    mdjermanovic labeled #13781
  • Oct 22 20:00
    mdjermanovic unlabeled #13781
  • Oct 22 18:34
    ljharb commented #13781
  • Oct 22 17:29
    mdjermanovic reopened #13593
  • Oct 22 17:29
    mdjermanovic unlabeled #13593
  • Oct 22 17:28
    eslint[bot] labeled #12883
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?
Tanya Marych
@TMarych_twitter
I just feel like there are many devs who trying to use both great tools for making code better
And none of devs would like to choose between them
Nikolay Babanov
@nbabanov
Hello guys!
eyelidlessness
@eyelidlessness
for sure, i wouldn't encourage you to choose between them. it seems that if eslint needs additional plugins to support arbitrary babel plugins, that's a design limitation that unfortunately would cause this. presumably there will be such a plugin soon, as optional chaining is such a desirable feature
Nikolay Babanov
@nbabanov
I have a problem with ESLint 6.7, which I did not have with 5.7: ESLint can no longer detect eslint-plugin-prettier. My setup is a monorepo with lerna. Can someone point the issue? How did ESLint changed the plugin resolve strategy?
Jakob Guddas
@jguddas

i'm looking for a rule that converts

if () {
  ...
} if () {
  ...
}

to

if () {
  ...
}
if () {
  ...
}
Jakob Guddas
@jguddas
is there something like padding-line-between-statements but for line breaks?
or like keyword-spacing but for line breaks instead of spaces?
Trevor Radcliffe
@t-rad679
It does not seem possible to configure the indent level for ConditionalExpression, other than to ignore it entirely. Is this true? If so, why?