Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 00a7cc3

Browse filesBrowse files
committed
chore: leverage es6 in gruntfile
- Add some ES6 usage in gruntfile Closes #5076
1 parent 5ad08ff commit 00a7cc3
Copy full SHA for 00a7cc3

2 files changed

+19-15Lines changed: 19 additions & 15 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.eslintrc‎

Copy file name to clipboardExpand all lines: .eslintrc
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"env": {
3+
"browser": true,
4+
"es6": true
5+
},
26
"rules": {
37
"comma-dangle": 2,
48
"no-cond-assign": 2,
Collapse file

‎Gruntfile.js‎

Copy file name to clipboardExpand all lines: Gruntfile.js
+15-15Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ module.exports = function(grunt) {
103103
module: null, // no bundle module for all the html2js templates
104104
base: '.',
105105
rename: function(moduleName) {
106-
return 'uib/' + moduleName;
106+
return `uib/${moduleName}`;
107107
}
108108
},
109109
files: [{
@@ -194,7 +194,7 @@ module.exports = function(grunt) {
194194
// Default task.
195195
grunt.registerTask('default', ['before-test', 'test', 'after-test']);
196196

197-
grunt.registerTask('enforce', 'Install commit message enforce script if it doesn\'t exist', function() {
197+
grunt.registerTask('enforce', `Install commit message enforce script if it doesn't exist`, function() {
198198
if (!grunt.file.exists('.git/hooks/commit-msg')) {
199199
grunt.file.copy('misc/validate-commit-msg.js', '.git/hooks/commit-msg');
200200
require('fs').chmodSync('.git/hooks/commit-msg', '0755');
@@ -227,22 +227,22 @@ module.exports = function(grunt) {
227227

228228
var module = {
229229
name: name,
230-
moduleName: enquote('ui.bootstrap.' + name),
230+
moduleName: enquote(`ui.bootstrap.${name}`),
231231
displayName: ucwords(breakup(name, ' ')),
232-
srcFiles: grunt.file.expand('src/'+name+'/*.js'),
233-
cssFiles: grunt.file.expand('src/'+name+'/*.css'),
234-
tplFiles: grunt.file.expand('template/'+name+'/*.html'),
235-
tpljsFiles: grunt.file.expand('template/'+name+'/*.html.js'),
236-
tplModules: grunt.file.expand('template/'+name+'/*.html').map(enquoteUibDir),
232+
srcFiles: grunt.file.expand(`src/${name}/*.js`),
233+
cssFiles: grunt.file.expand(`src/${name}/*.css`),
234+
tplFiles: grunt.file.expand(`template/${name}/*.html`),
235+
tpljsFiles: grunt.file.expand(`template/${name}/*.html.js`),
236+
tplModules: grunt.file.expand(`template/${name}/*.html`).map(enquoteUibDir),
237237
dependencies: dependenciesForModule(name),
238238
docs: {
239-
md: grunt.file.expand('src/'+name+'/docs/*.md')
239+
md: grunt.file.expand(`src/${name}/docs/*.md`)
240240
.map(grunt.file.read).map(function(str) {
241241
return marked(str);
242242
}).join('\n'),
243-
js: grunt.file.expand('src/'+name+'/docs/*.js')
243+
js: grunt.file.expand(`src/${name}/docs/*.js`)
244244
.map(grunt.file.read).join('\n'),
245-
html: grunt.file.expand('src/'+name+'/docs/*.html')
245+
html: grunt.file.expand(`src/${name}/docs/*.html`)
246246
.map(grunt.file.read).join('\n')
247247
}
248248
};
@@ -399,15 +399,15 @@ module.exports = function(grunt) {
399399
var jsContent = versions.map(function(version) {
400400
return {
401401
version: version,
402-
url: '/bootstrap/versioned-docs/' + version
402+
url: `/bootstrap/versioned-docs/${version}`
403403
};
404404
});
405405
jsContent.unshift({
406406
version: 'Current',
407407
url: '/bootstrap'
408408
});
409409
grunt.file.write(versionsMappingFile, JSON.stringify(jsContent));
410-
grunt.log.writeln('File ' + versionsMappingFile.cyan + ' created.');
410+
grunt.log.writeln(`File ${versionsMappingFile.cyan} created.`);
411411
done();
412412
});
413413

@@ -422,7 +422,7 @@ module.exports = function(grunt) {
422422
js;
423423
state.css.push(css);
424424

425-
if(minify){
425+
if (minify) {
426426
css = css
427427
.replace(/\r?\n/g, '')
428428
.replace(/\/\*.*?\*\//g, '')
@@ -437,7 +437,7 @@ module.exports = function(grunt) {
437437
.replace(/\\/g, '\\\\')
438438
.replace(/'/g, "\\'")
439439
.replace(/\r?\n/g, '\\n');
440-
js = "angular.module('ui.bootstrap.carousel').run(function() {!angular.$$csp() && angular.element(document).find('head').prepend('<style type=\"text/css\">" + css + "</style>'); })";
440+
js = `angular.module('ui.bootstrap.carousel').run(function() {!angular.$$csp() && angular.element(document).find('head').prepend('<style type="text/css">${css}</style>'); })`;
441441
state.js.push(js);
442442

443443
return state;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.