3.5.4 • Published 6 years ago

tslint-loader v3.5.4

Weekly downloads
110,077
License
MIT
Repository
github
Last release
6 years ago

tslint-loader

Build Status Dependency Status devDependency Status peerDependency Status

Tslint loader for Webpack.

Installation

npm install tslint tslint-loader --save-dev

The package depends on Tslint 4.0+, no longer works with 3.* versions.

Usage

Apply the tslint loader as preLoader in your webpack configuration.

Webpack 4

module.exports = {
    module: {
        rules: [
            {
                test: /\.ts$/,
                enforce: 'pre',
                use: [
                    {
                        loader: 'tslint-loader',
                        options: { /* Loader options go here */ }
                    }
                ]
            }
        ]
    }
}

Webpack 3

module.exports = {
    module: {
        loaders: [
            {
                test: /\.ts$/,
                enforce: 'pre',
                loader: 'tslint-loader',
                options: { /* Loader options go here */ }
            }
        ]
    }
}

Webpack 2

module.exports = {
    module: {
        rules: [
            {
                test: /\.ts$/,
                enforce: 'pre',
                loader: 'tslint-loader',
                options: { /* Loader options go here */ }
            }
        ]
    }
}

Webpack 1

module.exports = {
    module: {
        preLoaders: [
            {
                test: /\.ts$/,
                loader: 'tslint-loader'
            }
        ]
    },

    tslint: { /* Loader options go here */ }
}

Loader options

{
    configuration: {
        rules: {
            quotemark: [true, 'double']
        }
    },
    
    // can specify a custom config file relative to current directory or with absolute path
    // 'tslint-custom.json'
    configFile: false,
    
    // tslint errors are displayed by default as warnings
    // set emitErrors to true to display them as errors
    emitErrors: false,
    
    // tslint does not interrupt the compilation by default
    // if you want any file with tslint errors to fail
    // set failOnHint to true
    failOnHint: true,
    
    // enables type checked rules like 'for-in-array'
    // uses tsconfig.json from current working directory
    typeCheck: false,
    
    // automatically fix linting errors
    fix: false,
    
    // can specify a custom tsconfig file relative to current directory or with absolute path
    // to be used with type checked rules
    tsConfigFile: 'tsconfig.json',
    
    // name of your formatter (optional)
    formatter: 'yourformatter',
    
    // path to directory containing formatter (optional)
    formattersDirectory: 'node_modules/tslint-loader/formatters/',
    
    // These options are useful if you want to save output to files
    // for your continuous integration server
    fileOutput: {
        // The directory where each file's report is saved
        dir: './foo/',
    
        // The extension to use for each report's filename. Defaults to 'txt'
        ext: 'xml',
    
        // If true, all files are removed from the report directory at the beginning of run
        clean: true,
    
        // A string to include at the top of every report file.
        // Useful for some report formats.
        header: '<?xml version="1.0" encoding="utf-8"?>\n<checkstyle version="5.7">',
    
        // A string to include at the bottom of every report file.
        // Useful for some report formats.
        footer: '</checkstyle>'
    }
}

License

MIT

@christensena/react-scripts@christensena/react-scripts-ts@tsukiy0/react-scriptsiscshidev@yarvis/angularchoerodon-hap-front-bootng2workspace-addon-webpack-tslintngprogressbarwebpack-toolbox@infinitebrahmanuniverse/nolb-tsltimefun@everything-registry/sub-chunk-2982wpbsaf-webpack-sudoku356-testdev1-front-bootsimple-react-createsheet-bldsfs-iview-admin-toolshared-form-appseus-scriptsshlomi-levi-testdxc-webpackee-af-webpackelmer-clielmer-common-uiera-build-utilsssrframe-tooldragon-scriptsdiabelb-react-scripts-tscy-webpack@digest/webpack-tslintsample-cli-clisanji-common-devs-uisapien-coresapientestsprout-web-uismart-cqqb-clieasy-create-reactsmart-qb-cli@average-gate/bundler@balinj/build@axelhzf/react-scripts-ts@axilis/node-scripts@axilis/react-scripts@baristalabs/react-scripts-ts@baristalabs/react-scripts-ts-cecatufol@bentley/webpack-tools@beisen/talent-ui-webpack-config@beisen/talentui-webpack-config@berun/runner-tslintcc-cli-plugin-typescript@bestminr/build@bestminr/build-library@beisen/italent-webpack-config-textcli-service@charge/sdk@codebuild-hu/cookie-jarconverteer@cqqb-team/smart@cqqb-team/smart-clichatsummary@boty-design/fe-clicks-webpack-configcharge-sdk@blorajs/af-webpackchoerodon-front-bootchoerodon-hap-test-front-bootboddco-financeboddco-montecarlo@atelieropenas/bundlerbrain-clibrain-vue-cli@devbin/react-scripts-ts-cssmodulescustom-react-scripts-ts@devex-web-frontend/react-scripts-dx@domoinc/ryuu-angular@dojo/cli-build-webpack@dojo/cli-build-widgetdalarandaz-clibgm-cliflipdish-react-scripts-ts-forksunmi-clieui-cliez-buildangular2-config-generatorantique-uiangular-cli-with-use-yarnangular-cli-kocoangular-cli-extastrazeneca-vdcaxios-ts-ainuoaxios-typescriptav-webpackfebpgallifrey-ui-bootfr-clithanos-clithe-complete-typescript-cra
3.5.4

6 years ago

3.6.0

6 years ago

3.5.3

7 years ago

3.5.2

7 years ago

3.5.1

7 years ago

3.4.3

7 years ago

3.4.2

7 years ago

3.4.1

7 years ago

3.4.0

7 years ago

3.3.0

7 years ago

3.2.1

7 years ago

3.2.0

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.1.5

8 years ago

2.1.4

8 years ago

2.1.2

8 years ago

2.1.3

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.9.1

9 years ago

0.9.0

9 years ago

0.0.1

9 years ago