Lint TypeScript file using tslint and tslint-loader.
npm install --save-dev @easy-webpack/config-tslint
easy-webpack is also required.
// webpack.config.js
const generateConfig = require('@easy-webpack/core').generateConfig;
const baseConfig = { ... }; // project-specific config like the entry file
module.exports = generateConfig(
baseConfig,
require('@easy-webpack/config-tslint')
({ /* Options object */ exclude: /(node_modules|bower_components)/ })
);
// tslint.json
{
"extends": "tslint-config-standard"
}
// This config will lint TypeScript files before compiling
Remember to add a tslint.json
file on the root of your repository (where webpack.config.js
is located).
Type: (Array of) webpack exclude object
Default: node_modules
Files to be excluded from tslint linting. Check webpack documentation on how to exclude files.