Skip to content

Commit

Permalink
Merge pull request #10 from dzearing/ianc/fixing-lint
Browse files Browse the repository at this point in the history
Including tslint:disable around the style mapping in the produced scss.ts files.
  • Loading branch information
iclanton committed May 4, 2016
2 parents 1b25cbb + fc6f2dd commit 5ca5b7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-core-build-sass",
"version": "0.3.1",
"version": "0.3.2",
"description": "",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
18 changes: 10 additions & 8 deletions src/SassTask.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
GulpTask
} from 'gulp-core-build';
import { GulpTask } from 'gulp-core-build';
import gulp = require('gulp');
import { EOL } from 'os';

const scssTsExtName = '.scss.ts';

Expand Down Expand Up @@ -106,6 +105,7 @@ export class SassTask extends GulpTask<ISassTaskConfig> {

if (classNames) {
const classNamesLines = [
'/* tslint:disable */',
'const styles = {'
];

Expand All @@ -127,11 +127,13 @@ export class SassTask extends GulpTask<ISassTaskConfig> {
classNamesLines.push(line);
});

classNamesLines.push('};');
classNamesLines.push('');
classNamesLines.push('export default styles;');
classNamesLines.push(
'};',
'',
'export default styles;',
'/* tslint:enable */');

exportClassNames = classNamesLines.join('\n');
exportClassNames = classNamesLines.join(EOL);
}

let lines = [];
Expand All @@ -153,7 +155,7 @@ export class SassTask extends GulpTask<ISassTaskConfig> {
];
}

return lines.join('\n').replace(/\n\n+/, '\n\n');
return lines.join(EOL).replace(new RegExp(`${EOL}${EOL}+`), `${EOL}${EOL}`);
}
}))
.pipe(gulp.dest('src')));
Expand Down

0 comments on commit 5ca5b7d

Please sign in to comment.