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.

Cannot read property 'range' of undefined #156

Closed
@mattdell

Description

@mattdell

What version of TypeScript are you using?
2.1.5

What version of typescript-eslint-parser are you using?
1.0.2

What code were you trying to parse?
All of my code. I've switched from babel-parser to typescript-eslint-parser. The most useful thing I can provide might be my .eslintrc file.

parser: typescript-eslint-parser

extends: airbnb

plugins: [react, jsx-a11y, import, extra-rules]

parserOptions:
  sourceType: module

ecmaFeatures:
  jsx: true

env:
  es6: true
  browser: true
  node: true
  mocha: true

globals:
  __DEV__: false
  __TEST__: false
  __PROD__: false
  __COVERAGE__: false
  sinon: false
  expect: false

settings:
  import/parsers:
    typescript-eslint-parser: [ .ts, .tsx ]

rules:
  # Disabled rules we should enable
  react/no-find-dom-node: 0
  react/no-string-refs: 0

  #Disabled
  react/jsx-no-bind: 0
  react/jsx-filename-extension: 0
  react/forbid-prop-types: 0
  react/prefer-stateless-function: 0
  max-len: 0
  no-underscore-dangle: 0
  class-methods-use-this: 0
  global-require: 0
  import/no-named-as-default: 0
  jsx-a11y/no-static-element-interactions: 0
  no-param-reassign: 0
  import/no-extraneous-dependencies: ["error", {"devDependencies": ["**/*.spec.js", "server/**/*.*"]}]

  # Errors
  object-shorthand: [2, properties]
  extra-rules/no-commented-out-code: 2
  jsx-quotes: ["error", "prefer-double"]
  space-before-function-paren: ["error", "never"]
  comma-dangle: ["error", "always-multiline"]

What did you expect to happen?
Lint my project!

What happened?
A horrible error.

Cannot read property 'range' of undefined
TypeError: Cannot read property 'range' of undefined
    at SourceCode.isSpaceBetweenTokens (/Users/mdell/Work/Repos/double-helix-web/node_modules/eslint/lib/util/source-code.js:296:43)
    at validateAfterOpening (/Users/mdell/Work/Repos/double-helix-web/node_modules/eslint-plugin-react/lib/rules/jsx-tag-spacing.js:139:30)
    at EventEmitter.JSXClosingElement (/Users/mdell/Work/Repos/double-helix-web/node_modules/eslint-plugin-react/lib/rules/jsx-tag-spacing.js:229:11)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
    at NodeEventGenerator.enterNode (/Users/mdell/Work/Repos/double-helix-web/node_modules/eslint/lib/util/node-event-generator.js:39:22)
    at CodePathAnalyzer.enterNode (/Users/mdell/Work/Repos/double-helix-web/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:607:23)
    at CommentEventGenerator.enterNode (/Users/mdell/Work/Repos/double-helix-web/node_modules/eslint/lib/util/comment-event-generator.js:98:23)
    at Controller.enter (/Users/mdell/Work/Repos/double-helix-web/node_modules/eslint/lib/eslint.js:928:36)
    at Controller.__execute (/Users/mdell/Work/Repos/double-helix-web/node_modules/estraverse/estraverse.js:397:31)

I'm not really sure where to even start with this one.

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