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

'javascript:' in string bug #97

Closed
jprichardson opened this issue Apr 1, 2015 · 5 comments

Comments

@jprichardson
Copy link
Member

commented Apr 1, 2015

Consider this simple app:

var s = 'javascript: is so cool!'
console.log(s)

Causes standard to report:

Error: Use JavaScript Standard Style (https://github.com/feross/standard)
  app.js:1:8: Script URL is a form of eval.
@Flet

This comment has been minimized.

Copy link
Member

commented Apr 1, 2015

Looks like this came up as an issue on the eslint side too:
eslint/eslint#1448

Suggested fix was:

To close the loop on this, I'd say your best bet is to disable the rule around the area in question via

/*eslint-disable no-script-url*/

@feross

This comment has been minimized.

Copy link
Member

commented Apr 1, 2015

@jprichardson Out of curiosity, what were you trying to do where this rule was an issue?

@jprichardson

This comment has been minimized.

Copy link
Member Author

commented Apr 2, 2015

@feross Sure, cleaning up this old project: https://github.com/jprichardson/node-linkscrape Specifically, this file https://github.com/jprichardson/node-linkscrape/blob/master/lib/linkscrape.js

It seems to me that this behavior is pretty odd and unexpected, specifically in the context of Node.js (albeit rare). Would it make sense for standard to disable no-script-url?

@Flet

This comment has been minimized.

Copy link
Member

commented Apr 2, 2015

Heh its the exact same use case in that eslint issue... Interrogating a string.

@feross

This comment has been minimized.

Copy link
Member

commented Apr 3, 2015

Agreed. This is a bit odd.

@feross feross closed this in 63a79d3 Apr 3, 2015

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.