gulp-tslint
Advanced tools
Comparing version 4.3.5 to 5.0.0
@@ -0,1 +1,8 @@ | ||
<a name="5.0.0"></a> | ||
# 5.0.0 (2016-04-24) | ||
## Changes | ||
- support for extends property | ||
<a name="4.3.0"></a> | ||
@@ -2,0 +9,0 @@ # 4.3.0 (2016-01-11) |
@@ -0,0 +0,0 @@ export interface PluginOptions { |
54
index.js
@@ -11,8 +11,6 @@ /*jshint node:true */ | ||
var map = require("map-stream"); | ||
// Load rc configs | ||
var Rcloader = require("rcloader"); | ||
/** | ||
* Helper function to check if a value is a function | ||
* @param {any} value to check whether or not it is a function. | ||
* @returns {boolean} Returns true if the value is a function. | ||
* @param {any} value to check whether or not it is a function | ||
* @returns {boolean} Returns true if the value is a function | ||
*/ | ||
@@ -23,2 +21,10 @@ function isFunction(value) { | ||
/** | ||
* Helper function to check if a value is a string | ||
* @param {any} value to check whether or not it is a string | ||
* @returns {boolean} Returns true if the value is a string | ||
*/ | ||
function isString(value) { | ||
return Object.prototype.toString.call(value) === "[object String]"; | ||
} | ||
/** | ||
* Returns the TSLint from the options, or if not set, the default TSLint. | ||
@@ -72,4 +78,2 @@ * @param {PluginOptions} options | ||
} | ||
// Create rcloader to load tslint.json | ||
loader = new Rcloader("tslint.json", pluginOptions.configuration); | ||
return map(function (file, cb) { | ||
@@ -84,21 +88,21 @@ // Skip | ||
} | ||
// Finds the config file closest to the linted file | ||
loader.for(file.path, function (error, fileOptions) { | ||
// TSLint default options | ||
var options = { | ||
configuration: fileOptions, | ||
formatter: "json", | ||
// not used, use reporters instead | ||
formattersDirectory: null, | ||
rulesDirectory: pluginOptions.rulesDirectory || null | ||
}; | ||
if (error) { | ||
return cb(error, undefined); | ||
} | ||
var linter = getTslint(pluginOptions); | ||
tslint = new linter(file.relative, file.contents.toString("utf8"), options); | ||
file.tslint = tslint.lint(); | ||
// Pass file | ||
cb(null, file); | ||
}); | ||
// TSLint default options | ||
var options = { | ||
configuration: pluginOptions.configuration, | ||
formatter: "json", | ||
// not used, use reporters instead | ||
formattersDirectory: null, | ||
rulesDirectory: pluginOptions.rulesDirectory || null | ||
}; | ||
var linter = getTslint(pluginOptions); | ||
if (pluginOptions.configuration === null || | ||
pluginOptions.configuration === undefined | ||
|| isString(pluginOptions.configuration)) { | ||
// configuration can be a file path or null, if it's unknown | ||
options.configuration = linter.findConfiguration(pluginOptions.configuration || null, file.path); | ||
} | ||
tslint = new linter(file.relative, file.contents.toString("utf8"), options); | ||
file.tslint = tslint.lint(); | ||
// Pass file | ||
cb(null, file); | ||
}); | ||
@@ -105,0 +109,0 @@ }; |
{ | ||
"name": "gulp-tslint", | ||
"preferGlobal": false, | ||
"version": "4.3.5", | ||
"version": "5.0.0", | ||
"author": "Panu Horsmalahti <panu.horsmalahti@iki.fi>", | ||
@@ -32,3 +32,2 @@ "description": "TypeScript linter Gulp plugin", | ||
"map-stream": "~0.1.0", | ||
"rcloader": "~0.2.0", | ||
"through": "~2.3.8" | ||
@@ -40,3 +39,3 @@ }, | ||
"gulp-concat": "^2.6.0", | ||
"gulp-typescript": "^2.11.0", | ||
"gulp-typescript": "^2.13.0", | ||
"tslint": "^3", | ||
@@ -46,3 +45,3 @@ "typescript": "latest" | ||
"peerDependencies": { | ||
"tslint": "^3 || >=3.1.0-dev || >=3.2.0-dev || >=3.2.1-dev || >= 3.2.2-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.7.0-dev" | ||
"tslint": "^3.7.3 || 3.7.0-dev.5 || >=3.8.0-dev || >=3.9.0-dev || >=3.10.0-dev || >=3.11.0-dev" | ||
}, | ||
@@ -49,0 +48,0 @@ "license": "MIT", |
@@ -121,2 +121,12 @@ gulp-tslint | ||
You can also supply a file path to the configuration option, and the file name | ||
doesn't need to be tslint.json. | ||
```javascript | ||
.pipe(tslint({ | ||
// contains rules in the tslint.json format | ||
configuration: "source/settings.json" | ||
})) | ||
``` | ||
Report limits | ||
@@ -123,0 +133,0 @@ ------------- |
@@ -10,2 +10,3 @@ { | ||
"noImplicitAny": true, | ||
"removeComments": false, | ||
"outDir": ".", | ||
@@ -12,0 +13,0 @@ "rootDir": ".", |
20470
4
348
187
- Removedrcloader@~0.2.0
- Removed@babel/code-frame@7.24.6(transitive)
- Removed@babel/helper-validator-identifier@7.24.6(transitive)
- Removed@babel/highlight@7.24.6(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedargparse@1.0.10(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbuiltin-modules@1.1.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcommander@2.20.3(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddiff@4.0.2(transitive)
- Removedesprima@4.0.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedglob@7.2.3(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinflight@1.0.6(transitive)
- Removedis-core-module@2.13.1(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedlodash.assign@4.2.0(transitive)
- Removedlodash.clonedeep@4.5.0(transitive)
- Removedlodash.isobject@3.0.2(transitive)
- Removedlodash.merge@4.6.2(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpicocolors@1.0.1(transitive)
- Removedrcfinder@0.1.9(transitive)
- Removedrcloader@0.2.2(transitive)
- Removedresolve@1.22.8(transitive)
- Removedsemver@5.7.2(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedtslib@1.14.1(transitive)
- Removedtslint@6.1.3(transitive)
- Removedtsutils@2.29.0(transitive)
- Removedtypescript@5.4.5(transitive)
- Removedwrappy@1.0.2(transitive)