Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Class constructor function with space causes exception in space-before-function-paren rule #139

Closed
@soda0289

Description

@soda0289

What version of TypeScript are you using?
2.14

What version of typescript-eslint-parser are you using?
1.0.2 (ts-2.1)

What code were you trying to parse?

class Test {
    constructor () {

    }
}

.eslintrc.js

module.exports = {
    "env": {
        "es6": true,
        "node": true,
        "mocha": true
    },
    "extends": "eslint:recommended",
    "parser": "typescript-eslint-parser",
    "parserOptions": {
        "sourceType": "module"
    },
    "plugins": [
        "typescript"
    ],
    "rules": {
        "space-before-function-paren": "error"
    }
};

What did you expect to happen?
To parse

What happened?
Uncaught Exception

TypeError: Cannot read property 'value' of undefined
    at EventEmitter.validateSpacingBeforeParentheses (/usr/lib/node_modules/eslint/lib/rules/space-before-function-paren.js:128:30)
    at emitOne (events.js:82:20)
    at EventEmitter.emit (events.js:169:7)
    at NodeEventGenerator.enterNode (/usr/lib/node_modules/eslint/lib/util/node-event-generator.js:40:22)
    at CodePathAnalyzer.enterNode (/usr/lib/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:608:23)
    at CommentEventGenerator.enterNode (/usr/lib/node_modules/eslint/lib/util/comment-event-generator.js:97:23)
    at Controller.enter (/usr/lib/node_modules/eslint/lib/eslint.js:925:36)
    at Controller.__execute (/usr/lib/node_modules/eslint/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/usr/lib/node_modules/eslint/node_modules/estraverse/estraverse.js:501:28)
    at Controller.Traverser.controller.traverse (/usr/lib/node_modules/eslint/lib/util/traverser.js:36:33)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions