Razzle: 使用 Typescript 插件禁用 tslint?

创建于 2019-02-24  ·  4评论  ·  资料来源: jaredpalmer/razzle

我想禁用 tslint(支持使用 eslint)。 但是,在razzle.config.js禁用它时,出现以下错误:

Cannot find "${PATH}/tslint.json" file. Please check webpack and ForkTsCheckerWebpackPlugin configuration.

我的razzle.config.js如下:

module.exports = {
  plugins: [
    {
      name: "typescript",
      useBabel: true,
      useEslint: true,
      forkTsChecker: {
        tsconfig: "./tsconfig.json",
        tslint: false,
        watch: "./src",
        typeCheck: true,
      },
    },
  ],
};

最有用的评论

@adaam2这是我的配置的相关部分:

module.exports = {
  plugins: [
    {
      name: "typescript",
      options: {
        useBabel: true,
        useEslint: true,
        forkTsChecker: {
          tsconfig: "./tsconfig.json",
          tslint: undefined,
          watch: "./src",
          typeCheck: true,
        },
      },
    },
  ]
};

请注意,我最初缺少options键。

所有4条评论

我的错——我的配置格式不正确。

@Jayphen您能否在此处详细说明最终的工作配置以使其不再需要 tslint 作为 dep?

@adaam2这是我的配置的相关部分:

module.exports = {
  plugins: [
    {
      name: "typescript",
      options: {
        useBabel: true,
        useEslint: true,
        forkTsChecker: {
          tsconfig: "./tsconfig.json",
          tslint: undefined,
          watch: "./src",
          typeCheck: true,
        },
      },
    },
  ]
};

请注意,我最初缺少options键。

@Jayphen谢谢!

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

GouthamKD picture GouthamKD  ·  3评论

corydeppen picture corydeppen  ·  3评论

krazyjakee picture krazyjakee  ·  3评论

piersolenski picture piersolenski  ·  4评论

mhuggins picture mhuggins  ·  3评论