Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #69 from jedmao/fix_tsc
Browse files Browse the repository at this point in the history
fix tsc compile error
  • Loading branch information
gucong3000 authored May 18, 2017
2 parents 18b9797 + ce471f5 commit 92db53f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
16 changes: 8 additions & 8 deletions lib/eclint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('eclint gulp plugin', () => {
it('fix block comment', (done) => {
var stream = eclint.fix();

stream.on('data', (file) => {
stream.on('data', (file: File) => {
expect(file.contents.toString()).to.be.equal([
'\t/**',
'\t * indent 1',
Expand Down Expand Up @@ -172,7 +172,7 @@ describe('eclint gulp plugin', () => {
it('check block comment', (done) => {
var stream = eclint.check();

stream.on('data', (file) => {
stream.on('data', (file: File) => {
expect(file.editorconfig.errors).to.have.lengthOf(2);
expect(file.editorconfig.errors[0].lineNumber).to.equal(1);
expect(file.editorconfig.errors[0].columnNumber).to.equal(1);
Expand Down Expand Up @@ -208,8 +208,8 @@ describe('eclint gulp plugin', () => {
describe('infer file', () => {
it('README.md', (done) => {
var stream = eclint.infer();
stream.on('data', (file) => {
var config = JSON.parse(file.contents);
stream.on('data', (file: File) => {
var config = JSON.parse(String(file.contents));
expect(config.indent_style).to.be.equal('tab');
expect(config.indent_size).to.be.equal(2);
expect(config.trim_trailing_whitespace).to.be.equal(true);
Expand All @@ -220,8 +220,8 @@ describe('eclint gulp plugin', () => {
});
it('package.json', (done) => {
var stream = eclint.infer();
stream.on('data', (file) => {
var config = JSON.parse(file.contents);
stream.on('data', (file: File) => {
var config = JSON.parse(String(file.contents));
expect(config.indent_style).to.be.equal('space');
expect(config.indent_size).to.be.equal(2);
expect(config.trim_trailing_whitespace).to.be.equal(true);
Expand Down Expand Up @@ -295,7 +295,7 @@ describe('eclint gulp plugin', () => {
it('expects final newline', (done) => {
var stream = eclint.check();

stream.on('data', (file) => {
stream.on('data', (file: eclint.EditorConfigLintFile) => {
expect(file.editorconfig.errors).to.have.lengthOf(1);
var error = file.editorconfig.errors[0];
expect(error.lineNumber).to.equal(1);
Expand All @@ -322,7 +322,7 @@ describe('eclint gulp plugin', () => {
}
});

stream.on('data', (file) => {
stream.on('data', (file: eclint.EditorConfigLintFile) => {
expect(file.editorconfig.errors).to.have.lengthOf(1);
var error = file.editorconfig.errors[0];
expect(error.lineNumber).to.equal(1);
Expand Down
7 changes: 4 additions & 3 deletions lib/eclint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as linez from 'linez';
import * as doc from './doc';
import File = require('vinyl');
import EditorConfigError = require('./editor-config-error');
import stream = require('stream');

var PluginError = gutil.PluginError;

Expand Down Expand Up @@ -167,7 +168,7 @@ module eclint {
reporter?: (file: EditorConfigLintFile, error: EditorConfigError) => void;
}

export function check(options?: CheckCommandOptions) {
export function check(options?: CheckCommandOptions): stream.Transform {

options = options || {};
var commandSettings = options.settings || {};
Expand Down Expand Up @@ -234,7 +235,7 @@ module eclint {
});
}

export function fix(options?: CommandOptions) {
export function fix(options?: CommandOptions): stream.Transform {

options = options || {};
var commandSettings = options.settings || {};
Expand Down Expand Up @@ -322,7 +323,7 @@ module eclint {
max_line_length?: number;
}

export function infer(options?: InferOptions) {
export function infer(options?: InferOptions): stream.Transform {
options = options || {};

if (options.score && options.ini) {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@
},
"devDependencies": {
"@types/chai": "^3.5.2",
"@types/lodash": "^4.14.64",
"@types/mocha": "^2.2.41",
"@types/node": "^7.0.18",
"@types/sinon": "^2.2.1",
"@types/sinon-chai": "^2.7.27",
"@types/through2": "^2.0.32",
"@types/vinyl": "^2.0.0",
"@types/vinyl-fs": "^2.4.5",
"chai": "^3.5.0",
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"target": "es5"
},
"include": [
"node_modules/@types/node/index.d.ts",
"node_modules/@types/mocha/index.d.ts",
"lib/**/*.ts"
]
}

0 comments on commit 92db53f

Please sign in to comment.