【发布时间】:2017-01-16 09:01:03
【问题描述】:
我正在尝试在我的项目上运行 TSLint,但在尝试使用 webpack 构建时它当前失败。我创建了一个具有以下结构的项目的简单复制:
\tslint-issue
|-\src
| |-Base.ts
| |-Derived.ts
| |-index.tsx
|-babel.rc
|-index.html
|-package.json
|-tsconfig.json
|-webpack.config.json
Base 和 Derived 是非常简单的类定义。但是当我运行时
webpack
我收到以下消息:
ERROR in ./src/Derived.ts
Module build failed: TypeError: this.computeFullOptions is not a function
at Object.Linter (c:\Code\tslint-issue\node_modules\tslint\lib\tslint.js:15:29)
@ ./src/index.tsx 2:16-36
当我从 webpack.config.json
中删除以下部分时 {
test: /\.ts$/,
loader: 'tslint'
},
它工作正常。如果需要更多信息,我可以提供任何必要的项目。 index.tsx 导入Derived.ts 文件中的Derived 类,内容如下:
import { Derived } from "./Derived";
var d = new Derived(25);
console.log(d.AbsMethod());
提前致谢!
【问题讨论】: