Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
833 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
8 | */
|
---|
9 |
|
---|
10 | Object.defineProperty(exports, '__esModule', { value: true });
|
---|
11 | const Lint = require('tslint');
|
---|
12 |
|
---|
13 | class Rule extends Lint.Rules.AbstractRule {
|
---|
14 | apply(sourceFile) {
|
---|
15 | const shouldPass = this.getOptions().ruleArguments[0];
|
---|
16 | if (!shouldPass) {
|
---|
17 | return [new Lint.RuleFailure(sourceFile, 0, 0, 'custom-rule fail', this.ruleName)];
|
---|
18 | } else {
|
---|
19 | return [];
|
---|
20 | }
|
---|
21 | }
|
---|
22 | }
|
---|
23 |
|
---|
24 | Rule.metadata = {
|
---|
25 | ruleName: 'custom-rule',
|
---|
26 | description: 'Test.',
|
---|
27 | rationale: 'Do not use this.',
|
---|
28 | options: [{ type: 'boolean' }],
|
---|
29 | optionsDescription: '.',
|
---|
30 | type: 'functionality',
|
---|
31 | typescriptOnly: false,
|
---|
32 | };
|
---|
33 |
|
---|
34 | exports.Rule = Rule;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.