build: handle prerelease versions in deletion target rule (#10101)

This commit is contained in:
Kristiyan Kostadinov
2018-05-04 19:57:03 +02:00
committed by Joey Perrott
parent c15e307405
commit 01ec602b0b
+2 -1
View File
@@ -9,7 +9,8 @@ import * as path from 'path';
*/
export class Rule extends Lint.Rules.AbstractRule {
apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
const packageVersion = require(path.join(process.cwd(), 'package.json')).version;
// Split it on the dash to ignore `-beta.x` suffixes.
const packageVersion = require(path.join(process.cwd(), 'package.json')).version.split('-')[0];
return this.applyWithFunction(sourceFile, (ctx: Lint.WalkContext<any>) => {
utils.forEachComment(ctx.sourceFile, (file, {pos, end}) => {