🌐 AI搜索 & 代理 主页
Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Commit 3941e35

Browse files
upgrade, move to eslint, and remove dead dependencies
for a clean audit. note: doc build chain is partly missing but so are docs
1 parent 9aaa614 commit 3941e35

File tree

3 files changed

+2389
-2114
lines changed

3 files changed

+2389
-2114
lines changed

Gruntfile.js

Lines changed: 13 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,18 @@ module.exports = function (grunt) {
4141
dest: '<%= conf.pkg.name %>.min.js'
4242
}
4343
},
44-
jscs: {
45-
old: {
46-
src: ['<%= conf.spec %>/**/*.js'],
47-
options: {
48-
validateIndentation: 4
49-
}
50-
},
51-
source: {
52-
src: ['<%= conf.src %>/**/*.js', '!<%= conf.src %>/{banner,footer}.js', 'Gruntfile.js',
53-
'grunt/*.js', '<%= conf.web %>/stock.js'],
54-
options: {
55-
config: '.jscsrc'
56-
}
57-
}
58-
},
59-
jshint: {
44+
eslint: {
6045
source: {
61-
src: ['<%= conf.src %>/**/*.js', 'Gruntfile.js', 'grunt/*.js', '<%= conf.web %>/stock.js'],
62-
options: {
63-
jshintrc: '.jshintrc',
64-
ignores: ['<%= conf.src %>/banner.js', '<%= conf.src %>/footer.js']
65-
}
46+
src: [
47+
'<%= conf.src %>/**/*.js',
48+
'!<%= conf.src %>/{banner,footer,d3v3-compat}.js',
49+
'<%= conf.spec %>/**/*.js',
50+
'Gruntfile.js',
51+
'grunt/*.js'
52+
]
53+
},
54+
options: {
55+
configFile: '.eslintrc'
6656
}
6757
},
6858
watch: {
@@ -105,13 +95,6 @@ module.exports = function (grunt) {
10595
dest: '<%= emu.api.dest %>'
10696
}
10797
},
108-
markdown: {
109-
html: {
110-
src: '<%= emu.api.dest %>',
111-
dest: '<%= conf.web %>/docs/index.html'
112-
},
113-
options: {markdownOptions: {highlight: 'manual'}}
114-
},
11598
copy: {
11699
'dc-to-gh': {
117100
files: [
@@ -215,22 +198,6 @@ module.exports = function (grunt) {
215198
grunt.log.writeln('Merge Github Pull Request #' + pr);
216199
grunt.task.run(['shell:merge:' + pr, 'test' , 'shell:amend']);
217200
});
218-
grunt.registerMultiTask('toc', 'Generate a markdown table of contents.', function () {
219-
var marked = require('marked'),
220-
slugify = function (s) { return s.trim().replace(/[-_\s]+/g, '-').toLowerCase(); },
221-
srcFile = this.files[0].src[0],
222-
destFile = this.files[0].dest,
223-
source = grunt.file.read(srcFile),
224-
tokens = marked.lexer(source),
225-
toc = tokens.filter(function (item) {
226-
return item.type === 'heading' && item.depth === 2;
227-
}).reduce(function (toc, item) {
228-
return toc + ' * [' + item.text + '](#' + slugify(item.text) + ')\n';
229-
}, '');
230-
231-
grunt.file.write(destFile, '# dc.datatables.js API\n' + toc + '\n' + source);
232-
grunt.log.writeln('Added TOC to \'' + destFile + '\'.');
233-
});
234201
grunt.registerTask('test-stock-example', 'Test a new rendering of the stock example web page against a ' +
235202
'baseline rendering', function (option) {
236203
require('./regression/stock-regression-test.js').testStockExample(this.async(), option === 'diff');
@@ -241,15 +208,15 @@ module.exports = function (grunt) {
241208

242209
// task aliases
243210
grunt.registerTask('build', ['concat', 'uglify']);
244-
grunt.registerTask('docs', ['build', 'copy', 'emu', 'toc', 'markdown']);
211+
grunt.registerTask('docs', ['build', 'copy', 'emu']);
245212
grunt.registerTask('web', ['docs', 'gh-pages']);
246213
grunt.registerTask('server', ['docs', 'connect:server', 'watch:scripts']);
247214
grunt.registerTask('test', ['build', 'jasmine:specs', 'shell:hooks']);
248215
grunt.registerTask('test-browserify', ['build', 'browserify', 'jasmine:browserify']);
249216
grunt.registerTask('coverage', ['build', 'jasmine:coverage']);
250217
grunt.registerTask('ci', ['test', 'jasmine:specs:build', 'connect:server', 'saucelabs-jasmine']);
251218
grunt.registerTask('ci-pull', ['test', 'jasmine:specs:build', 'connect:server']);
252-
grunt.registerTask('lint', ['build', 'jshint', 'jscs']);
219+
grunt.registerTask('lint', ['build', 'eslint']);
253220
grunt.registerTask('default', ['build']);
254221
};
255222

0 commit comments

Comments
 (0)