Skip to content

Commit 01ec602

Browse files
crisbetojosephperrott
authored andcommitted
build: handle prerelease versions in deletion target rule (#10101)
1 parent c15e307 commit 01ec602

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/tslint-rules/deletionTargetRule.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import * as path from 'path';
99
*/
1010
export class Rule extends Lint.Rules.AbstractRule {
1111
apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
12-
const packageVersion = require(path.join(process.cwd(), 'package.json')).version;
12+
// Split it on the dash to ignore `-beta.x` suffixes.
13+
const packageVersion = require(path.join(process.cwd(), 'package.json')).version.split('-')[0];
1314

1415
return this.applyWithFunction(sourceFile, (ctx: Lint.WalkContext<any>) => {
1516
utils.forEachComment(ctx.sourceFile, (file, {pos, end}) => {

0 commit comments

Comments
 (0)