Skip to content

Commit

Permalink
add more lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Mar 12, 2018
1 parent 91008dc commit a8f9153
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/services/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Rules, LintConfigurationSettings, Rule } from './lintRules';
import * as nodes from '../parser/cssNodes';

import * as nls from 'vscode-nls';
import { ITextProvider } from '../parser/cssNodes';
import { TextDocument } from 'vscode-languageserver-types';
const localize = nls.loadMessageBundle();

Expand Down
6 changes: 3 additions & 3 deletions src/test/css/lint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
'use strict';

import * as assert from 'assert';
import * as nodes from '../../parser/cssNodes';
import { Node, IRule, Level } from '../../parser/cssNodes';
import { Parser } from '../../parser/cssParser';
import { LintVisitor } from '../../services/lint';
import { Rule, Rules, LintConfigurationSettings } from '../../services/lintRules';
import { TextDocument } from 'vscode-languageserver-types';
import { SCSSParser } from '../../parser/scssParser';
import { LESSParser } from '../../parser/lessParser';

export function assertEntries(node: nodes.Node, document: TextDocument, rules: nodes.IRule[]): void {
export function assertEntries(node: Node, document: TextDocument, rules: IRule[]): void {

let entries = LintVisitor.entries(node, document, new LintConfigurationSettings(), nodes.Level.Error | nodes.Level.Warning | nodes.Level.Ignore);
let entries = LintVisitor.entries(node, document, new LintConfigurationSettings(), Level.Error | Level.Warning | Level.Ignore);
assert.equal(entries.length, rules.length, entries.map(e => e.getRule().id).join(', '));

for (let entry of entries) {
Expand Down
5 changes: 5 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
"no-unused-expression": true,
"no-string-throw": true,
"no-duplicate-variable": true,
"no-duplicate-imports": true,
"no-require-imports": true,
"new-parens": true,
"no-invalid-this": true,
"curly": true,
"class-name": true,
"indent": [true, "tabs", 2],
"semicolon": [
true,
"always"
Expand Down

0 comments on commit a8f9153

Please sign in to comment.