Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:11

    mysticatea on class-fields

    update no-invalid-this update no-multi-assign update no-proto (test-only) and 14 more (compare)

  • 09:08

    mdjermanovic on master

    Chore: add more test cases for … (compare)

  • 09:08
    mdjermanovic closed #14579
  • 03:12
    bmish edited #14573
  • 00:38
    eslint-github-bot[bot] labeled #13750
  • 00:38
    eslint-github-bot[bot] locked #13750
  • May 12 20:37
    bmish edited #14586
  • May 12 20:37
    bmish edited #14586
  • May 12 20:36
    bmish edited #14586
  • May 12 19:42
    bmish opened #14586
  • May 12 19:42
    bmish labeled #14586
  • May 12 19:42
    bmish labeled #14586
  • May 12 19:42
    bmish labeled #14586
  • May 12 14:15
    walkerburgin commented #13654
  • May 12 07:52

    mysticatea on class-fields

    update keyword-spacing update lines-between-class-memb… update no-dupe-class-members and 1 more (compare)

  • May 12 05:03
    aladdin-add labeled #14579
  • May 12 05:03
    aladdin-add unlabeled #14579
  • May 12 05:03
    aladdin-add labeled #14579
  • May 12 05:03
    aladdin-add labeled #14579
  • May 12 05:02
    aladdin-add labeled #14578
薛定谔的猫
@aladdin-add
$ ./node_modules/.bin/eslint bad-code.js
if still not working, you can use --debug to see what happened.
Julián Herrera
@vidjuheffex

Hey, I'm looking for some config help. The project im working on has an eslint config, and a package-local installed eslint.
On my desktop all works fine, on my laptop... very different story.

Going into a dir with a file and typing _pathtoEslint.cmd_ --print-config . prints the same thing for both

It is a react project with decorators, and such. Each import that gets used by a decorator counts as not being used. propTypes says its never defined, stuff like that. I have removed the eslint config in my home dir, and my globally installed eslint just in case

note my editor covering the laptop in eslint errors, yet both are pointing to the same config and executable
also, same result on these files from the CLI, eslint spits out all sorts of errors, and on desktop its fine
Julián Herrera
@vidjuheffex
I've even diff the output from --print-config with no differences between them, anyone have any suggestions.
Is there an easier to configure linter I should be using/suggesting to the team? Identical configs yielding different results makes me nervous about the tool
lordkyzr
@lordkyzr
Anyone around to answer a quick question about brace-style?
lordkyzr
@lordkyzr

I got this odd scenario where someone on my team writes code that isnt the 1tbs style and is more akin to allman syntax.

if( foo ){
    let bar = 1;
}
else {
    let bar = 2;
}

and fix does a great job changing it to the 1tbs style.

When the code is indented however it is a completely different story. Here is the before:

    if( foo ){
        let bar = 1;
    }
    else {
        let bar = 2;
    }

it ends up keeping the full indentation when it fixes it which renders it like below

    if( foo ){
        let bar = 1;
    }    else {
        let bar = 2;
    }

I have been searching for the past hour or so and found in a previous version keyword-spacing let you specify the amount of spaces and the current rule no longer has that and it is 1 or more spaces but it doesnt check for consistency which rendered a bunch of my code in this ugly format.

Julián Herrera
@vidjuheffex
If anyone can solve my issue please PM PayPal detials
Teddy Katz
@not-an-aardvark
@lordkyzr You might be looking for no-multi-spaces
lordkyzr
@lordkyzr
@not-an-aardvark reading the docs real quick it does appear to be what I am looking for. I will test tomorrow when I get in. Thanks for the hint.
Epaminaidos
@Epaminaidos
@platinumazure I found a solution: The block-scoped-var rule included in this plugin: https://github.com/mysticatea/eslint-plugin#eslint-plugin-mysticatea
It does exactly, what I expect from a "block-scoped-var"-rule :)
Victor Hom
@VictorHom
is there a rule that can enforce a space before a ternary "?" and a space before and after the ":" ?
martskins
@martskins
space-infix-ops ?
Clément Pit-Claudel
@cpitclaudel
Hi eslint folks. Quick question about eslint --format=checkstyle: is this option expected to produce pure XML in all cases? Or is it by design that some messages are still printed as plaintext to stderr? We've been bitten by this multiple times in Flycheck, and we're not sure whether it's an eslint bug to be reported, or a design choice that we need to work around on our side (see flycheck/flycheck#1350 for a concrete example)
Victor Hom
@VictorHom
sweet @martskins thanks I knew it had to be a thing :tada:
Sam Ferrell
@samcf
Hello. New here. Wondering if it's feasible to write an ESLint plugin to detect "bad" imports, such as foo.js importing from bar.js where bar.js is not some place you would sensibly import from foo.js. It's technically a correct and working import, but considered bad design in our project. Does that make sense?
Teddy Katz
@not-an-aardvark
It seems like that would be possible as long as you can tell whether it's a "bad" import from the filename
Sam Ferrell
@samcf
@not-an-aardvark Sort of ... using a more specific use case, the "Users Page" should never import from the "Statistics Page" and vice versa, where the file org is like src/pages/users and src/pages/statistics
However files within the users page should obviously be allowed to import from its own page
Just trying to get a feel for whether thats feasible or not before I dive into it.. never written an ESLint plugin before
Teddy Katz
@not-an-aardvark
Yes, that seems like it should be feasible
Sam Ferrell
@samcf
Neat, thanks!
Kevin Partington
@platinumazure
@cpitclaudel I would expect stdout to be valid XML (though do please report an issue if you see otherwise), while stderr would not conform to any formatter. On a console, stdout and stderr are interleaved, but in a program that spawns a subprocess, it should track stdout and stderr separately. (I believe our lint formatter output should be to stdout.) So at first glance, it seems like a design issue on your end... But please let me know if I'm missing something.
Benjamin R Gibson
@brgibson
Hi all, I wanted to make sure I have gotten the process right for re-submitting after my first review eslint/eslint#9506. I realized a little late not to amend my commit. After the next round of feedback, I will leave it as a second commit.
Ilya Volodin
@ilyavolodin
@brgibson amending is fine, it's not necessary anymore, since we always squash commits before merging, but it doesn't hurt.
Btw, just so you'd be aware, we require 3 +1s from the core team, as well as one champion, so it might take a little while for this proposal to be accepted
Benjamin R Gibson
@brgibson
Thanks @ilyavolodin. Will those discussions happen in the pull request?
Ilya Volodin
@ilyavolodin
Yes, they usually happen either in PR directly, or if PR is fixing an existing issue, they will happen in the issue
Benjamin R Gibson
@brgibson
Sounds good. Thanks again.
Clément Pit-Claudel
@cpitclaudel
@platinumazure We currently handle stderr and stdout together, simply because we've not needed to separate them for any other linter. Some send error lists to stderr, and some to stdout, and others mix depending on the type of error. The real question is: what do you intend tools to do with eslint's stderr output? Ignore it, or somehow print it, or something else?
@platinumazure What other checkers tend to do is report issues that are not directly connected to the current file as happening on line 1, column 1 (of the current file). It ties in nicely with the existing interface between linters and UIs (the linter produces a list of issues, the UI displays them). The problem with eslint's stderr output at the moment is that we don't have any metadata associated with it: when we see a message, we don't know whether it's a bug to be reported (we had two such cases), or an informational message to report to the user (we had one such case), or something else (in fact, we don't even know how to separate consecutive messages on stderr)
yuta0801
@yuta0801
I can't use standard
ESLint couldn't find the plugin "eslint-plugin-standard".
Kevin Partington
@platinumazure
@cpitclaudel We'll report on line 1 column 1 for files that fail to parse and other file-level issues, but any issues with configuration tend to go to stderr. I would honestly say your tool should probably be able to distinguish which tools tend to write to stdout, which to stderr, and which a mix, and handle them accordingly without having everything be interleaved. That seems like a design flaw. As for the fact that stderr messages are not obviously meant to be user errors vs bugs, I can see how that can happen, but I'm also not really sure what we can do about them without concrete suggestions for improvement.
Doyle Timberlake
@Timbercakes
Hello, I am receiving the error "unexpected black statement surrounding arrow body with the following snippet .map((school) => { return $filter('machine')(school.district); })
Not quite sure how to refactor this to get past the linter
Kevin Partington
@platinumazure
@Timbercakes You can use the concise arrow body syntax: .map((school) => $filter('machine')(school.district))
Doyle Timberlake
@Timbercakes
@platinumazure I thank you kindly sir.
Kevin Partington
@platinumazure
:+1:
Ilya Volodin
@ilyavolodin
Jed Fox
@j-f1
Hi! I’ve opened a PR (github/explore#77) adding information to the page at https://github.com/topics/eslint. How does the information I’ve provided look?
Teddy Katz
@not-an-aardvark
:+1:
Jonathan Pool
@jrpool
I am puzzled by an error message resulting from npm test. I can’t find a copy of that message anywhere in the project. I could use a hint about how to diagnose such a message. Here it is:
Error: rule-tester:
Configuration for rule "object-property-newline" is invalid:
Value "[object Object]" should NOT have additional properties.
Jonathan Pool
@jrpool
@jrpool I have diagnosed the above error message. It means that an options object specified in a test may not contain an option that the rule’s options object is not defined as having. But it is still a puzzle to me that the text of this message is not findable anywhere in the project code.
Jordan Harband
@ljharb
@jrpool it wouldn't be in project code; the english in the message says the configuration of a rule is invalid; if you grep for the rule name alone, you'd fine it in your eslint config.
there is a bug tho; "[object Object]" appearing somewhere means something is stringifying an object for no good reason
Sahil Prajapati
@sahil290791

Hello for weird reason eslint has stopped running from command line. These are the versions:

"devDependencies": {
    "babel-eslint": "7.2.2",
    "eslint": "3.19.0",
    "eslint-plugin-babel": "^4.1.2",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-react": "^7.0.0"}

I keep getting this error if I run eslint src/js/**/*.js:

Oops! Something went wrong! :(

ESLint couldn't find the plugin "eslint-plugin-babel". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-babel is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm i eslint-plugin-babel@latest --save-dev

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

What can be the issue?