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

loadFileAsDataURI.js fails lint #96

Closed
pixelzoom opened this issue Feb 11, 2015 · 1 comment
Closed

loadFileAsDataURI.js fails lint #96

pixelzoom opened this issue Feb 11, 2015 · 1 comment
Assignees
Labels

Comments

@pixelzoom
Copy link
Contributor

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

repoFiles: [ 'js//*.js', 'requirejs-plugins//*.js' ],

then running grunt lint.

Linting requirejs-plugins/loadFileAsDataURI.js ...ERROR
[L27:C52] W064: Missing 'new' prefix when invoking a constructor.
    var base64 = 'data:' + mimeType + ';base64,' + Buffer( fs.readFileSync( filename ) ).toString( 'base64' );
Linting requirejs-plugins/loadFileAsDataURI.js ...ERROR
[L27:C52] W117: 'Buffer' is not defined.
    var base64 = 'data:' + mimeType + ';base64,' + Buffer( fs.readFileSync( filename ) ).toString( 'base64' );
Linting requirejs-plugins/loadFileAsDataURI.js ...ERROR
[L27:C60] W117: 'fs' is not defined.
    var base64 = 'data:' + mimeType + ';base64,' + Buffer( fs.readFileSync( filename ) ).toString( 'base64' );
@pixelzoom
Copy link
Contributor Author

Fixed and tested various lint issues. And according to https://docs.nodejitsu.com/articles/advanced/buffers/how-to-use-buffers, it should be "new Buffer".

Closing, feel free to review if anyone is inclined.

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