Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 11:06
    sindresorhus labeled #410
  • 11:06
    sindresorhus labeled #410
  • 11:06
    haotangio opened #410
  • Dec 03 10:39
    pedroapfilho commented #373
  • Dec 01 19:47
    fregante commented #349
  • Dec 01 19:47
    fregante commented #349
  • Nov 29 22:14
    christyh11 opened #409
  • Nov 19 05:02

    sindresorhus on master

    Fix Node.js range for `prefer-o… (compare)

  • Nov 19 05:02
    sindresorhus closed #408
  • Nov 19 05:02
    sindresorhus edited #408
  • Nov 18 04:06
    sindresorhus labeled #392
  • Nov 18 04:06
    sindresorhus labeled #392
  • Nov 16 15:24
    LinusU synchronize #408
  • Nov 16 15:17
    LinusU opened #408
  • Nov 11 11:18
    thewalla07 synchronize #407
  • Nov 10 21:06
    thewalla07 synchronize #407
  • Nov 10 19:33
    thewalla07 synchronize #407
  • Nov 10 19:31
    thewalla07 opened #407
  • Nov 06 21:31
    ulken commented #188
  • Oct 31 15:18
    rizowski commented #404
Pierre Vanduynslager
@pvdlg
Pretty nice company. It's a really amazing place.
I'm gonna do JS dev full time now :)
Sindre Sorhus
@sindresorhus
I think you mean Node.js 6 ;)
Pierre Vanduynslager
@pvdlg
Yes :)
Sindre Sorhus
@sindresorhus
Good to hear you found a nice company :)
Sindre Sorhus
@sindresorhus
👌
John Mars
@j0hnm4r5
Hey, I'm not sure if this is an issue with VSCode, the VSCode plugin, or XO itself, but adding a "globals": {} to my config seems to break everything.
When it's not there, everything works as-expected, and when it is, VSCode pops up a little error: def.split is not a function, and the linting stops.
It looks like the same error is happening in Standard: standard/standard#1047
John Mars
@j0hnm4r5
Ah hah! Globals needs to be an array, not an object like in ESLint.
That also fixed another issue I was having with "envs".
Might I suggest making it clearer in the documentation that the formatting for some of the config is the same as ESLint ("rules: {}"), and some is not ("envs": [])?
Or, even better, make all of the config match the ESLint format.
As-is, I can't define my globals to be rewriteable or not, since they can't be true/false.
Jorge Gonzalez
@jorgegonzalez
xojs/xo#326 Added TypeScript and Flow support 🙌
Sindre Sorhus
@sindresorhus
@jorgegonzalez Awesome ✨
Jorge Gonzalez
@jorgegonzalez
sindresorhus/eslint-formatter-pretty#31
Maybe there's a way to change this that I don't know about
Jorge Gonzalez
@jorgegonzalez
Would appreciate support for this issue
prettier/prettier#4845
Max
@maxfi

Hi all. In meteor it's common to do import './some-template.html'but this causes an Imported module should be assigned import/no-unassigned-import error.

I've already got a rule override for this rule to allow meteor packages (with only side-effects) to work:

  "xo": {
    "prettier": true,
    "semicolon": false,
    "space": 2,
    "settings": {
      "import/resolver": "meteor"
    },
    "rules": {
      "import/no-absolute-path": 0,
      "import/no-unassigned-import": ["error", {
        "allow": ["meteor/*:*"] // this allows: `import 'meteor/meteorhacks:unblock'`
      }]
    }
  }

I was hoping to simply add *.html to the allow section but it still throws the same error. Any ideas?

Max
@maxfi
Derp. I got the glob wrong. It should be "**/*.html". I put together a quick overview of this and some other helpful XO settings for meteor here: https://github.com/xojs/xo/issues/262#issuecomment-406865385. If you guys know of any other meteor specific settings please let me know. Cheers!
Corey Farrell
@coreyfarrell
does anyone know of a rule that I can enable to make xo warn about unused ES6 exports? my project is an application so this rule could help find dead code.
Sindre Sorhus
@sindresorhus
@coreyfarrell benmosher/eslint-plugin-import#186
Corey Farrell
@coreyfarrell
@sindresorhus thanks for the link!
Sindre Sorhus
@sindresorhus
// @pvdlg
Pierre Vanduynslager
@pvdlg
👍
Maxime HEBRARD
@mhebrard
hello here: I use XO with atom editor on js and react projects without issue :). now I try to use the linter on a typescript project (shell app created with angular CLI) but the linter seams not be triggered :-/. could I find some help over here ?
Here a part of my package.json
"devDependencies": {
    "eslint": "^5.3.0",
    "eslint-config-xo": "^0.24.1",
    "eslint-config-xo-typescript": "^0.1.0",
    "eslint-plugin-typescript": "^0.12.0",
    "tslint": "~5.9.1",
    "typescript": "^2.9.2",
    "typescript-eslint-parser": "^17.0.1",
    "xo": "^0.21.1"
  },
  "xo": {
    "extends": "xo-typescript",
    "space": 2,
    "env": [
      "browser",
      "node"
    ]
  }
Pierre Vanduynslager
@pvdlg
what do you mean the linter is not triggered?
In Atom? Or when you run xo in the root of the repo?
Maxime HEBRARD
@mhebrard
In Atom. with a react project I get nice notification of errors when I am typing my code (underline red + list and link of lint rules at the bottom)... with a typescript project, I do not have these "in editor, live, linter rules error...
Itai Steinherz
@itaisteinherz
Hi there, is there any way to define an env (e.g. mocha) in a specific file instead of in package.json? I think I've seen this done before but I'm not sure how.
Sindre Sorhus
@sindresorhus
@itaisteinherz No, XO config can only be defined in package.json. Why do you need to define it outside package.json?
Itai Steinherz
@itaisteinherz

@sindresorhus I have a Jest test file that uses it, and unless I define it at the top of the file using

/* global it */

XO throws an error.

Sindre Sorhus
@sindresorhus
Ah ok. I misunderstood your question. Yes, use you use /* eslint-env jest */ at the top of the file or use the overrides feature to only target test files: https://github.com/xojs/xo#config-overrides
Itai Steinherz
@itaisteinherz
Awesome, thanks!
kivi
@kivi
I am in trapped in some kind of configuration loop. I have people in my node.js project, that are non developers, but like to code. So I thought I give xo a try. Now How can I use a linting enabled Vscode based on let's say xo rules that can later be adjusted with .eslintrc - atm I am pretty indifferent what rules to use, Important is that my fellows use a linter and something that fixes/make the code prettier - therefore I am trying to get eslint plugin in vscode running with prettier, that handle corrections on save. But prettier or eslint wouldn't use the xo rules with zero config
Or maybe xo is not what I am looking for.
Sindre Sorhus
@sindresorhus
@kivi If you use Prettier, you need to enable the prettier XO option: https://github.com/xojs/xo#prettier
You don't adjust the rules with .eslintrc, but rather in the xo.rules config in package.json.
You can also use shareable ESLint config if you need to share the rule customizations. See the extends option in the XO docs.
Neal
@nstanard
Can't seem to get XO or SublimeLinter/XO to work in Subime - nor VSCode + linter-xo ... anybody have any suggestions?
kivi
@kivi

@sindresorhus

@itaisteinherz No, XO config can only be defined in package.json. Why do you need to define it outside package.json?

If you work in a team there might be other linters cleaning the code. Most probably all developers (and none developers) use an editor, which is able to workd with .editorconfig. So why not define the linting params in .editorconfig?

LitoMore
@LitoMore
@kivi EditorConfig only support these options. We should not add any unrelated options to the .editorconfig file.