tslint-loader
Advanced tools
Comparing version 3.3.0 to 3.4.0
15
index.js
@@ -6,2 +6,4 @@ /* | ||
*/ | ||
'use strict'; | ||
var Lint = require('tslint'); | ||
@@ -15,2 +17,8 @@ var loaderUtils = require('loader-utils'); | ||
function resolveFile(configPath) { | ||
return path.isAbsolute(configPath) | ||
? configPath | ||
: path.resolve(process.cwd(), configPath) | ||
} | ||
function resolveOptions(webpackInstance) { | ||
@@ -23,3 +31,3 @@ var tslintOptions = webpackInstance.options.tslint ? webpackInstance.options.tslint : {}; | ||
var configFile = options.configFile | ||
? path.resolve(process.cwd(), options.configFile) | ||
? resolveFile(options.configFile) | ||
: null; | ||
@@ -31,2 +39,3 @@ | ||
options.tsConfigFile = options.tsConfigFile || 'tsconfig.json'; | ||
options.fix = options.fix || false; | ||
@@ -38,3 +47,3 @@ return options; | ||
var lintOptions = { | ||
fix: false, | ||
fix: options.fix, | ||
formatter: options.formatter, | ||
@@ -48,3 +57,3 @@ formattersDirectory: options.formattersDirectory, | ||
if (options.typeCheck) { | ||
var tsconfigPath = path.resolve(process.cwd(), options.tsConfigFile); | ||
var tsconfigPath = resolveFile(options.tsConfigFile); | ||
program = Lint.Linter.createProgram(tsconfigPath); | ||
@@ -51,0 +60,0 @@ } |
{ | ||
"name": "tslint-loader", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "tslint loader for webpack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,3 +7,3 @@ # tslint-loader | ||
Tslint loader for Webpack | ||
Tslint loader for Webpack. | ||
@@ -18,3 +18,3 @@ ## Installation | ||
Apply the tslint loader as pre/postLoader in your webpack configuration: | ||
Apply the tslint loader as preLoader in your webpack configuration. | ||
@@ -39,3 +39,3 @@ ``` javascript | ||
// can specify a custom config file relative to current directory | ||
// can specify a custom config file relative to current directory or with absolute path | ||
// 'tslint-custom.json' | ||
@@ -56,4 +56,7 @@ configFile: false, | ||
typeCheck: false, | ||
// automatically fix linting errors | ||
fix: false, | ||
// can specify a custom tsconfig file relative to current directory | ||
// can specify a custom tsconfig file relative to current directory or with absolute path | ||
// to be used with type checked rules | ||
@@ -60,0 +63,0 @@ tsConfigFile: 'tsconfig.json', |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70731
119
96