Skip to content

Commit f1eb5e0

Browse files
authored
Merge pull request #1702 from kum-deepak/tslint
tslint - initial configuration
2 parents bbb002d + 4a0e3b7 commit f1eb5e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+814
-739
lines changed

Gruntfile.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = function (grunt) {
2323
// in d3v4 and d3v5 pre-built d3.js are in different sub folders
2424
const d3pkgSubDir = config.pkg.dependencies.d3.split('.')[0].replace(/[^\d]/g, '') === '4' ? 'build' : 'dist';
2525

26-
const lintableFiles = `'${config.src}' '${config.spec}' '*.js' 'grunt/*.js' '<%= conf.websrc %>/stock.js'`;
26+
const lintableFiles = `'${config.spec}/**/*.js' '*.js' 'grunt/*.js' '<%= conf.websrc %>/stock.js'`;
2727

2828
const sass = require('node-sass');
2929

@@ -102,7 +102,7 @@ module.exports = function (grunt) {
102102
options: {
103103
display: 'short',
104104
summary: true,
105-
specs: '<%= conf.spec %>/*-spec.js',
105+
specs: '<%= conf.spec %>/*-spec.js',
106106
helpers: [
107107
'<%= conf.spec %>/helpers/*.js',
108108
'<%= conf.spec %>/3rd-party/*.js'
@@ -323,7 +323,8 @@ module.exports = function (grunt) {
323323
'These pages fit the charts to the browser dynamically so it\'s easier to test. ' +
324324
'For the examples with a single chart taking up the entire window, you can add <code>?resize=viewbox</code> ' +
325325
'to the URL to test resizing the chart using the ' +
326-
'<a href="http://dc-js.github.io/dc.js/docs/html/dc.baseMixin.html#useViewBoxResizing__anchor">useViewBoxResizing</a> strategy.',
326+
'<a href="http://dc-js.github.io/dc.js/docs/html/dc.baseMixin.html#useViewBoxResizing__anchor">' +
327+
'useViewBoxResizing</a> strategy.',
327328
also: ['examples', 'transitions', 'zoom'],
328329
sourceLink: 'https://github.com/dc-js/dc.js/tree/develop/<%= conf.websrc %>/resizing'
329330
},
@@ -397,6 +398,12 @@ module.exports = function (grunt) {
397398
'eslint-fix': {
398399
command: `eslint ${lintableFiles} --fix`
399400
},
401+
tslint: {
402+
command: 'tslint src/**/*.ts'
403+
},
404+
'tslint-fix': {
405+
command: 'tslint src/**/*.ts --fix'
406+
},
400407
tsc: {
401408
command: 'tsc'
402409
}
@@ -405,7 +412,7 @@ module.exports = function (grunt) {
405412

406413
grunt.registerTask('merge', 'Merge a github pull request.', pr => {
407414
grunt.log.writeln(`Merge Github Pull Request #${pr}`);
408-
grunt.task.run([`shell:merge:${pr}`, 'test' , 'shell:amend']);
415+
grunt.task.run([`shell:merge:${pr}`, 'test', 'shell:amend']);
409416
});
410417
grunt.registerTask(
411418
'test-stock-example',
@@ -444,8 +451,8 @@ module.exports = function (grunt) {
444451
grunt.registerTask('coverage', ['build', 'copy', 'karma:coverage']);
445452
grunt.registerTask('ci', ['ci-pull', 'safe-sauce-labs']);
446453
grunt.registerTask('ci-pull', ['build', 'copy', 'karma:ci']);
447-
grunt.registerTask('lint', ['shell:eslint']);
448-
grunt.registerTask('lint-fix', ['shell:eslint-fix']);
454+
grunt.registerTask('lint', ['shell:tslint', 'shell:eslint']);
455+
grunt.registerTask('lint-fix', ['shell:tslint-fix', 'shell:eslint-fix']);
449456
grunt.registerTask('default', ['build', 'shell:hooks']);
450457
grunt.registerTask('doc-debug', ['build', 'jsdoc', 'jsdoc2md', 'watch:jsdoc2md']);
451458
};

package-lock.json

Lines changed: 60 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@types/d3": "^5.7.2",
2929
"d3": "^5.15.1",
3030
"rollup-plugin-typescript2": "^0.27.1",
31+
"tslint": "^6.1.2",
3132
"typescript": "^3.9.5"
3233
},
3334
"devDependencies": {

0 commit comments

Comments
 (0)