ts-checker-webpack-plugin can not find a custom tslint rule written in TypeScript

3

I have a TypeScript project with Webpack with the following in package.json

"ts-checker-webpack-plugin": "^0.3.0",
"tslint": "^5.9.1",
"typescript": "^2.8.3",

I also have a custom tslint rule made in TypeScript that is compiled by tsc during compilation of webpack but tslint can not find the resulting JS. It shows the following error:

Could not find implementations for the following rules specified in the configuration:
    custom-check

I already confirmed that if I manually compile customCheckRule.ts to JS, the rule is found and used by webpack and tslint.

How can I configure webpack or ts-checker-webpack-plugin to make sure that the rule is compiled and used during the compilation process?

The following is the relevant part of webpack.config.js

const HtmlWebpackPlugin = require('html-webpack-plugin');
...

module.exports = {
    ...,

    resolve: {
        extensions: [".ts", ".tsx", ".js", ".json"]
    },

    plugins: [
        ...,
        new TsCheckerWebpackPlugin({
            tsconfig: path.resolve("tsconfig.json"),
            tslint: path.resolve("tslint.json"), // optional
            memoryLimit: 512, // optional, maximum memory usage in MB
            diagnosticFormatter: "ts-loader", // optional, one of "ts-loader", "stylish", "codeframe"
        })
    ],

    module: {
        rules: [
            // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
            {
                test: /\.tsx?$/,
                use: [{
                    loader: 'babel-loader'
                }, {
                    loader: 'ts-loader',
                    options: {
                        transpileOnly: true
                    }
                }]
            },
            ...
        ]
    }
};
    
asked by Carlos Muñoz 30.04.2018 в 00:36
source

0 answers