Skip to content

Linter rule crashes: function-paren-newline, arrow-spacing, keyword-spacing, space-infix-ops #109

Open

Description

@jguddas

i came across some error causing rules while trying around with the airbnb eslint preset


will throw error if not disabled

console.log! 'hello world'
"function-paren-newline": "off",
indent: "off",

will throw error if not disabled

if true or false: console.log('hello')
"space-infix-ops": "off",

will throw error if not disabled

(() -> console.log())()
"arrow-spacing": "off",

will stop working without throwing any errors if not disabled

if a:
  console.log('a')
elif b:
  console.log('b')
"keyword-spacing": "off",

rules that will not crash eslint but are unnecessary

semi: "off",
"comma-dangle": "off",
"brace-style": "off",
"space-before-blocks": "off",

https://github.com/jguddas/lsc-eslint-error-example

Activity

  1. wcjohnson commented on Oct 17, 2018

    @wcjohnson
    Owner

    I couldn't reproduce the crash with space-infix-ops using the given example.

    4.0.0-alpha.24 should fix the crashes in the other rules.

    I plan to improve the arrow-spacing rule so it detects arrow spacing problems in other LightScript syntaxes (like named arrow declarations) but that is not done yet.

    I didn't take any action on the rules that don't crash eslint, as they may be useful to people porting from JS or using optional brace syntax.

    I will leave this open for awhile in the event that there are still any unfixed crashes in these rules.

  2. changed the title [-]linter: error causing rules[/-] [+]Linter rule crashes: `function-paren-newline`, `arrow-spacing`, `keyword-spacing`, `space-infix-ops`[/+] on Oct 17, 2018
  3. jguddas commented on Oct 17, 2018

    @jguddas
    Author

    weird, space-infix-ops definitely crashes on me.

    https://github.com/jguddas/lsc-eslint-error-example/tree/space-infix-ops

  4. wcjohnson commented on Nov 5, 2018

    @wcjohnson
    Owner

    I did some more experimenting with this. Your example does reproduce the crash, but the crash doesn't reproduce using the same code with just the space-infix-ops enabled. So it must be some interaction betwee the rest of the rules in the AirBNB package with the space-infix-ops rule, but I still haven't found the exact cause yet. Will continue digging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions