Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

no-useless-constructor: class declaration with constructor throws exception #15

Closed
Assignees
armano2
Labels
bugSomething isn't workingenhancement: new plugin ruleNew rule request for eslint-pluginlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@JamesHenry

Description

@JamesHenry

This issue was initially reported here:eslint/typescript-eslint-parser#485


What version of TypeScript are you using?
2.9.1

What version oftypescript-eslint-parser are you using?
16.0.0

What code were you trying to parse?

// foo.tsdeclareclassFoo{constructor();}

or

// foo.d.tsclassFoo{constructor();}

What did you expect to happen?
No exception.

What happened?

TypeError: Cannot read property 'body' of null    at checkForConstructor (/Users/OliverJAsh/Development/unsplash-web/node_modules/eslint/lib/rules/no-useless-constructor.js:167:41)    at listeners.(anonymous function).forEach.listener (/Users/OliverJAsh/Development/unsplash-web/node_modules/eslint/lib/util/safe-emitter.js:47:58)    at Array.forEach (native)    at Object.emit (/Users/OliverJAsh/Development/unsplash-web/node_modules/eslint/lib/util/safe-emitter.js:47:38)    at NodeEventGenerator.applySelector (/Users/OliverJAsh/Development/unsplash-web/node_modules/eslint/lib/util/node-event-generator.js:251:26)    at NodeEventGenerator.applySelectors (/Users/OliverJAsh/Development/unsplash-web/node_modules/eslint/lib/util/node-event-generator.js:280:22)    at NodeEventGenerator.enterNode (/Users/OliverJAsh/Development/unsplash-web/node_modules/eslint/lib/util/node-event-generator.js:294:14)    at CodePathAnalyzer.enterNode (/Users/OliverJAsh/Development/unsplash-web/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:608:23)    at Traverser.enter [as _enter] (/Users/OliverJAsh/Development/unsplash-web/node_modules/eslint/lib/linter.js:865:28)    at Traverser._traverse (/Users/OliverJAsh/Development/unsplash-web/node_modules/eslint/lib/util/traverser.js:132:14)

Possibly related toeslint/typescript-eslint-parser#384?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancement: new plugin ruleNew rule request for eslint-pluginlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp