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.

Known Issue with JsxText nodes and whitespace (bug in ts.findNextToken() in tsc) #70

Closed
@andersekdahl

Description

@andersekdahl

First off, thanks for creating this! I'm reeeaaally looking forward to being able to use ESLint with TypeScript!

What version of TypeScript are you using?
1.8.10

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

What code were you trying to parse?

const x = (
  <form>
    <div className={styles.separator}></div>
  </form>
);

What did you expect to happen?
It shouldn't throw an error.

What happened?

eslint --debug C:/path/to/my/file.tsx

  eslint:cli Running on files +0ms
  eslint:ignored-paths Looking for ignore file in C:\Dev+31ms
  eslint:ignored-paths Loaded ignore file C:\Dev\.eslintignore +16ms
  eslint:ignored-paths Adding C:\Dev\.eslintignore +0ms
  eslint:glob-util Creating list of files to process. +0ms
  eslint:cli-engine Processing C:/path/to/my/file.tsx +0ms
  eslint:cli-engine Linting C:/path/to/my/file.tsx +0ms
  eslint:config Constructing config for C:/path/to/my/file.tsx +0ms
  eslint:config Using .eslintrc and package.json files +0ms
  eslint:config Loading C:\Dev\.eslintrc +0ms
  eslint:config-file Loading config file: C:\Dev\.eslintrc +16ms
  eslint:config Using C:\Dev\.eslintrc +203ms
  eslint:config Merging command line environment settings +0ms
  eslint:config-ops Apply environment settings to config +0ms
  eslint:config-ops Creating config for environment browser +0ms
  eslint:config-ops Creating config for environment es6 +0ms
Cannot read property 'range' of undefined
TypeError: Cannot read property 'range' of undefined
    at lastTokenIndex (C:\Dev\node_modules\eslint\lib\token-store.js:41:25)
    at SourceCode.api.getTokenAfter (C:\Dev\node_modules\eslint\lib\token-store.js:114:23)
    at EventEmitter.api.(anonymous function) [as getTokenAfter] (C:\Dev\node_modules\eslint\lib\eslint.js:1033:48)
    at RuleContext.(anonymous function) [as getTokenAfter] (C:\Dev\node_modules\eslint\lib\rule-context.js:155:33)
    at EventEmitter.validateBraceSpacing (C:\Dev\node_modules\eslint-plugin-react\lib\rules\jsx-curly-spacing.js:194:28)
    at emitOne (events.js:82:20)
    at EventEmitter.emit (events.js:169:7)
    at NodeEventGenerator.enterNode (C:\Dev\node_modules\eslint\lib\util\node-event-generator.js:40:22)
    at CodePathAnalyzer.enterNode (C:\Dev\node_modules\eslint\lib\code-path-analysis\code-path-analyzer.js:608:23)
    at CommentEventGenerator.enterNode (C:\Dev\node_modules\eslint\lib\util\comment-event-generator.js:97:23)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions