Skip to content

Commit

Permalink
Apply WebStorm formatting, see phetsims/phet-info#155
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 26, 2021
1 parent b4057e3 commit f526d41
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion js/common/documentationToHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@
const lines = string.split( '\n' );

let inParagraph = false;

function insideParagraph() {
if ( !inParagraph ) {
result += '<p>\n';
inParagraph = true;
}
}

function outsideParagraph() {
if ( inParagraph ) {
result += '</p>\n';
Expand Down Expand Up @@ -164,7 +166,7 @@
if ( parameter.optional ) {
name = '<span class="optional">' + name + '</span>';
}
result += '<tr class="param"><td>' + typeString( parameter.type ) + '</td><td>' + name + '</td><td> - </td><td>' + description + '</td></tr>\n';
result += '<tr class="param"><td>' + typeString( parameter.type ) + '</td><td>' + name + '</td><td> - </td><td>' + description + '</td></tr>\n';
} );
result += '</table>\n';
}
Expand Down
4 changes: 3 additions & 1 deletion js/common/extractDocumentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
typeString = typeString.slice( 1, typeString.length - 1 );

// for ( var i = 0; i < line.length; i++ ) {
// TODO: handle |, {}, etc. https://github.com/phetsims/chipper/issues/411
// TODO: handle |, {}, etc. https://github.com/phetsims/chipper/issues/411
// }

return typeString;
Expand Down Expand Up @@ -335,9 +335,11 @@
function blockCommentFilter( comment ) {
return comment.type === 'Block' && comment.value.charAt( 0 ) === '*';
}

function lineCommentFilter( comment ) {
return comment.type === 'Line' && comment.value.indexOf( '@public' ) >= 0;
}

let lineComments = [];
if ( node.leadingComments ) {
const blockComments = node.leadingComments.filter( blockCommentFilter );
Expand Down
6 changes: 3 additions & 3 deletions js/grunt/generateThumbnails.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const jimp = require( 'jimp' );
* @param {string} altSuffix - ending for the filename e.g. -alt1
* @returns {Promise} - Resolves to a {Buffer} with the image data
*/
module.exports = function ( repo, width, height, quality, mime, altSuffix ) {
module.exports = function( repo, width, height, quality, mime, altSuffix ) {
return new Promise( ( resolve, reject ) => {
const fullResImageName = `../${repo}/assets/${repo}-screenshot${altSuffix || ''}.png`;

Expand All @@ -33,11 +33,11 @@ module.exports = function ( repo, width, height, quality, mime, altSuffix ) {
return;
}

new jimp( fullResImageName, function () { //eslint-disable-line no-new
new jimp( fullResImageName, function() { //eslint-disable-line no-new
if ( mime === jimp.MIME_JPEG ) {
this.quality( quality );
}
this.resize( width, height ).getBuffer( mime, function ( error, buffer ) {
this.resize( width, height ).getBuffer( mime, function( error, buffer ) {
if ( error ) {
reject( new Error( error ) );
}
Expand Down
2 changes: 1 addition & 1 deletion js/load-unbuilt-strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
try {
json = JSON.parse( request.responseText );
}
catch ( e ) {
catch( e ) {
console.log( `Could not parse string file for ${repo} with locale ${locale}, perhaps that translation does not exist yet?` );
}
if ( json ) {
Expand Down

0 comments on commit f526d41

Please sign in to comment.