Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chipper/grunt/*.js fails lint #97

Closed
pixelzoom opened this issue Feb 11, 2015 · 2 comments
Closed

chipper/grunt/*.js fails lint #97

pixelzoom opened this issue Feb 11, 2015 · 2 comments
Assignees
Labels

Comments

@pixelzoom
Copy link
Contributor

Tested by changing line 147 of chipper/grunt/Gruntfile.js to:

repoFiles: [ 'js//*.js', 'grunt//*.js' ],

then running grunt lint.

Linting grunt/Gruntfile.js ...ERROR
[L18:C5] W079: Redefinition of '_'.
var _ = require( '../../sherpa/lodash-2.4.1.min' );
Linting grunt/Gruntfile.js ...ERROR
[L30:C3] E007: Missing "use strict" statement.
  function trimWhitespace( str ) {
Linting grunt/Gruntfile.js ...ERROR
[L57:C46] W064: Missing 'new' prefix when invoking a constructor.
    return 'data:' + mimeType + ';base64,' + Buffer( fs.readFileSync( filename ) ).toString( 'base64' );
Linting grunt/Gruntfile.js ...ERROR
[L193:C33] W069: ['en'] is better written in dot notation.
        var fallback = stringMap[ 'en' ];
Linting grunt/Gruntfile.js ...ERROR
[L278:C46] W069: ['en'] is better written in dot notation.
    var fallbackStrings = global_phet_strings[ 'en' ];
Linting grunt/Gruntfile.js ...ERROR
[L371:C65] W065: Missing radix parameter.
    var number = parseInt( pkg.version.substring( lastDot + 1 ) );
Linting grunt/Gruntfile.js ...ERROR
[L443:C24] W069: ['en'] is better written in dot notation.
    global.phet.strings[ 'en' ] = {};//may overwrite above
Linting grunt/Gruntfile.js ...ERROR
[L614:C70] W038: 'strings' used out of scope.
        iframeTestHtml = stringReplace( iframeTestHtml, 'SIM_TITLE', strings[ titleKey ] + ' ' + pkg.version + ' iframe test' );
Linting grunt/Gruntfile.js ...ERROR
[L614:C79] W038: 'titleKey' used out of scope.
        iframeTestHtml = stringReplace( iframeTestHtml, 'SIM_TITLE', strings[ titleKey ] + ' ' + pkg.version + ' iframe test' );
Linting grunt/Gruntfile.js ...ERROR
[L623:C23] W003: 'stringMap' was used before it was defined.
        var stringMap = 'build/' + pkg.name + '_string-map.json';
Linting grunt/Gruntfile.js ...ERROR
[L57:C46] W117: 'Buffer' is not defined.
    return 'data:' + mimeType + ';base64,' + Buffer( fs.readFileSync( filename ) ).toString( 'base64' );
Linting grunt/Gruntfile.js ...ERROR
[L79:C16] W098: 'requirejs' is defined but never used.
  var requirejs = require( '../../' + pkg.name + '/node_modules/requirejs' ); // TODO: not currently used, figure out how to include almond correctly?
Linting grunt/createSim.js ...ERROR
[L109:C15] W117: 'fs' is not defined.
        if ( !fs.existsSync( destPath ) || overwrite ) {
Linting grunt/createSim.js ...ERROR
[L2:C11] W098: 'assert' is defined but never used.
var assert = require( 'assert' );
Linting grunt/pullAll.js ...ERROR
[L3:C11] W098: 'assert' is defined but never used.
var assert = require( 'assert' );
@pixelzoom
Copy link
Contributor Author

Down to 2 lint errors. Some questions about these...

Where is '_' being defined before this?

Linting grunt/Gruntfile.js ...ERROR
[L18:C5] W079: Redefinition of '_'.
var _ = require( '../../sherpa/lodash-2.4.1.min' );

requirejs is defined but not used anywhere in Gruntfile.js. This is also the subject of #100. Is this vestigial? Or is it actually doing something? If it's doing something, does it need to be assigned to requirejs, or is the call to require sufficient?

Linting grunt/Gruntfile.js ...ERROR
[L84:C16] W098: 'requirejs' is defined but never used.
  var requirejs = require( '../../' + pkg.name + '/node_modules/requirejs' );
Linting requirejs-plugins/string.js ...ERROR

@pixelzoom
Copy link
Contributor Author

All lint errors fixed. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant