Skip to content

Commit

Permalink
[feat] updated TypeScript dependency to v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
buzinas committed Oct 1, 2016
1 parent a4cbb6f commit a8f558f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ language: node_js

node_js:
- '6'
- '4'
12 changes: 7 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const mocha = require('gulp-spawn-mocha');
const SRC_FOLDER = argv.single ? singleRule(argv.single) : 'src/**/*.ts';
const TEST_FOLDER = argv.single ? singleTest(argv.single) : 'dist/test/**/*.js';
const DEF_FOLDER = 'typings/**/*.ts'
const TS_CONFIG = ts.createProject('tsconfig.json');
const tsProject = ts.createProject('tsconfig.json');

gulp.task('readme', ['build'], () => {
const readme = require('./dist/readme');
Expand All @@ -37,10 +37,12 @@ gulp.task('lint', function lint() {
});

gulp.task('build', argv.lint === false ? [] : ['lint'], function build() {
return gulp
.src([SRC_FOLDER, DEF_FOLDER, 'node_modules/typescript/lib/lib.es6.d.ts'])
const tsResult = tsProject
.src([SRC_FOLDER, DEF_FOLDER, 'node_modules/typescript/lib/lib.es2015.core.d.ts'])
.pipe(sourcemaps.init())
.pipe(ts(TS_CONFIG))
.pipe(tsProject());

return tsResult.js
.pipe(sourcemaps.write({
includeContent: false,
sourceRoot: path.join(__dirname, '/src')
Expand All @@ -63,7 +65,7 @@ gulp.task('default', ['watch']);
gulp.task('publish', function build() {
return gulp
.src([SRC_FOLDER, DEF_FOLDER, 'node_modules/typescript/lib/lib.es6.d.ts'])
.pipe(ts(TS_CONFIG))
.pipe(ts(tsProject))
.pipe(gulp.dest('dist'));
});

Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tslint-eslint-rules",
"version": "1.6.1",
"version": "2.0.0",
"description": "Improve your TSLint with the missing ESLint Rules",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -29,9 +29,8 @@
"gulp-sourcemaps": "^1.6.0",
"gulp-spawn-mocha": "^2.2.2",
"gulp-tslint": "^3.6.0",
"gulp-typescript": "^2.13.6",
"mocha": "^2.5.3",
"typescript": "^1.8.10",
"gulp-typescript": "^3.0.1",
"typescript": "^2.0.3",
"yargs": "^5.0.0"
},
"dependencies": {
Expand Down
3 changes: 1 addition & 2 deletions src/test/rules/arrayBracketSpacingRuleTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ const scripts = {
];`,
`var [ x, y ] = z;`,
`var [ x,y ] = z;`,
`var [ x, ...y ] = z;`,
`var [ ,,x, ] = z;`
`var [ x, ...y ] = z;`
],
invalid: [
`var arr = ['foo', 'bar'];`,
Expand Down
10 changes: 5 additions & 5 deletions src/test/rules/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function runScript(rule: string, scriptText: string, config: Object, erro
-------
${scriptText}
-------
Found ${failures.length} errors(s):
${errorMsgs}
Expand All @@ -77,11 +77,11 @@ export function runScript(rule: string, scriptText: string, config: Object, erro
-------
${scriptText}
-------
Expected:
${expectedErrorMsgs}
Found:
${actualErrorMsgs}
Expand All @@ -93,7 +93,7 @@ export function runScript(rule: string, scriptText: string, config: Object, erro
export function runTest(rule: string, scripts: IScripts) {
scripts.forEach(item => {
const code: string = typeof item === 'string' ? item : item.code;
const config = { rules: { [rule]: true } };
const config: any = { rules: { [rule]: true } };
const errors = [];
if (typeof item === 'object') {
if (item.options) {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",
"removeComments": true
}
Expand Down

0 comments on commit a8f558f

Please sign in to comment.