Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 20:31
    jsf-clabot commented #12484
  • 20:29
    dmitryrn edited #12484
  • 20:27
    eslint[bot] labeled #12484
  • 20:27
    jsf-clabot commented #12484
  • 20:27
    dmitryrn opened #12484
  • 19:39
    platinumazure unlabeled #12461
  • 19:39
    platinumazure labeled #12461
  • 19:33
    dmitryrn commented #12459
  • 19:11
    aladdin-add closed #11413
  • 19:11

    aladdin-add on master

    Docs: Add note about Node.js re… (compare)

  • 19:11

    aladdin-add on issue11413

    (compare)

  • 19:11
    aladdin-add closed #12475
  • 18:55
    OlegBrony commented #12415
  • 18:26

    aladdin-add on issue11413

    Chore: rm trailing space (compare)

  • 18:26
    aladdin-add synchronize #12475
  • 18:11
    nzakas commented #12475
  • 18:10
    nzakas review_requested #12475
  • 18:10
    nzakas synchronize #12475
  • 18:10

    nzakas on issue11413

    Docs: Update getting started gu… (compare)

  • 18:02
    platinumazure commented #12468
Jordan Harband
@ljharb
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
Jesse Jackson
@jsejcksn_gitlab

Has anyone ever wanted a smarter version of max-len?

For example, if I enable the option ignoreStrings, and I have a 200-character line with a single string consisting of a single character, the whole line gets ignored. But that seems unreasonable. There has to be a better way to do it.

Jordan Harband
@ljharb
i used to want that. but then i realized that max-len is a terrible rule, and rules should target patterns instead of spray-and-pray with a line length limit.
Jesse Jackson
@jsejcksn_gitlab
@ljharb Is there a better solution than prettier? When dealing with opinions, I prefer my own. prettier-eslint used to be supported, but is sadly not any more.
Jordan Harband
@ljharb
if you want to use prettier, only use it via eslint-plugin-prettier; iow, if you disagree with something prettier has nonconfigurable, you're SOL.
Jesse Jackson
@jsejcksn_gitlab
:confounded:
Jordan Harband
@ljharb
prettier is fast, and has better autoformatting than a small number of eslint rules, but otherwise i'm not a fan - eslint can do 99% of what prettier does, and imo theoretically better because of prettier's line-length-based algorithm
so what i'd prefer to do is pursue better autofixes in eslint rules so that prettier can become 100% unnecessary ¯\_(ツ)_/¯
prettier-eslint is a good hack, but as you said, it's not supported anymore anyways
Jesse Jackson
@jsejcksn_gitlab

I agree with all of this. Is there a project which exists to aid with formatting based on eslint rules? Like a shared config that duplicates the prettier functionality with as much coverage as possible?

There are just certain ESLint rules that can definitely auto-fix my code given some criteria, but I don't really know where to begin to write a plugin in order to make that happen. I'm happy with the way prettier-eslint did it.

Without the input preferences, ESLint can't auto-fix and I'm left with manually having to format my code.
Jordan Harband
@ljharb
@jsejcksn_gitlab i mean, https://npmjs.com/eslint-config-airbnb is the most used one by any metric
both are based off the same style guide, which reflects the most common conventions in the overall ecosystem.
or at least, almost entirely reflects :-)
Jesse Jackson
@jsejcksn_gitlab
@ljharb Thanks. Peripherally-related: Is there a "serial auto-fix" feature for ESLint? In VS Code, I often have to hit cmd-S multiple times to get to the end of the auto-fixes.
Jordan Harband
@ljharb
not that i know of. it just takes multiple passes sometimes.
Ilya Volodin
@ilyavolodin
@jsejcksn_gitlab I think that's vscode implementation issue. ESLint does multipass autofix (i.e. it will keep fixing issues until either none are left, or the number of errors doesn't decrease).
Jordan Harband
@ljharb
ah, gtk. best to file a vscode issue on that one (i've run into it too)
Ilya Volodin
@ilyavolodin
But that's done through CLI. And I think vscode plugin uses API, which doesn't do multipass by default
And in terms of prettier capabilities, ESLint doesn't accept autofixes that have potential of breaking user's code (or even potentially breaking code), but those are guidelines only for core rules, plugins can do whatever they want. So it would be entirely possible to create a plugin that will contain a set of rules that can be autofix to provide parity with prettier
The only one that might cause major trouble is line-wrapping
Jordan Harband
@ljharb
afaik prettier doesn't have that potential in any of its formatters
since the AST remains the same
Ilya Volodin
@ilyavolodin
Yeah, sorry, I don't know much about prettier, I find idea of somebody rewriting my code constantly unappealing
Jordan Harband
@ljharb
lol i mean, that's autofixing too
they're the same feature, it's just that eslint's autofixing is much slower since it's token-based, and prettier lacks a bunch of configurability
Ilya Volodin
@ilyavolodin
Yes, to a degree.
I mean I'm of the opinion that developers read code about 10x the amount of time they write it. So I never want to end up in a situation where I look at the code after I checked it in, and do not recognize it as mine at all. If I need to confirm to a specific style - that's fine, I'd rather learn how to write code in that style
I use autofix in ESLint when I'm migrating code. It's a one-time action that I'm expecting. I would never enable autofixing on save for any ESLint rule
Jordan Harband
@ljharb
yeah true, i'm similar
Jesse Jackson
@jsejcksn_gitlab

Here's an example of where I'd want an auto-fix for combinations of rules:

eslintrc

{
  "max-len": "warn",
  "object-curly-newline": ["error", {"multiline": true}],
  "object-property-newline": ["error", {"allowAllPropertiesOnSameLine": true}]
}
// 77 < 80: ok - no fix needed
const obj = {prop1: 'value', prop2: 'value', prop3: 'value', prop4: 'value'};

// 93 > 80: not ok - fix needed
const obj = {prop1: 'value', prop2: 'value', prop3: 'value', prop4: 'value', prop5: 'value'};

// auto-fixed
const obj = {
  prop1: 'value',
  prop2: 'value',
  prop3: 'value',
  prop4: 'value',
  prop5: 'value'
};
Perhaps in the future, there will be a way for rules to be aware of each other so that they can provide useful auto-fixes like this.
KathiresanRamkumar95
@KathiresanRamkumar95

Hi

anyone available ?

Wigga
@mshafex_twitter
Hi
need some help with airbnb/base config !