Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Code generated by polymer:seed doesn't pass jshint with the supplied options. #123

Closed
pope opened this issue Jan 10, 2015 · 3 comments
Closed

Comments

@pope
Copy link

pope commented Jan 10, 2015

Here's the result from running jshint --extract auto -e .html .

x-elem.html: line 28, col 9, Missing 'new' prefix when invoking a constructor.
x-elem.html: line 61, col 9, Missing "use strict" statement.
x-elem.html: line 81, col 9, Missing "use strict" statement.

test/index.html: line 16, col NaN, 'WCT' is not defined.

test/x-elem-basic.html: line 23, col 7, Missing "use strict" statement.
test/x-elem-basic.html: line 21, col 5, 'suite' is not defined.
test/x-elem-basic.html: line 23, col 7, 'test' is not defined.
test/x-elem-basic.html: line 24, col 9, 'assert' is not defined.
test/x-elem-basic.html: line 27, col 7, 'test' is not defined.
test/x-elem-basic.html: line 28, col 9, 'assert' is not defined.
test/x-elem-basic.html: line 30, col 9, 'assert' is not defined.
test/x-elem-basic.html: line 33, col 7, 'test' is not defined.
test/x-elem-basic.html: line 35, col 11, 'assert' is not defined.

13 errors

This is easy to fix, but the question is are the jshint settings for external JS files only or should this apply to the embeded JS too.

@jmorille
Copy link

jmorille commented Feb 9, 2015

It could be nice to have a jshint configuration to exclude the error
Missing 'new' prefix when invoking a constructor.

the solution

Polymer('my-custom', { // jshint ignore:line

is not a solution .

If you are a solution to correct this one, I will be interesting to push in the .jshintrc files.

@pope
Copy link
Author

pope commented Feb 10, 2015

I believe if you set "newcap" to false then this should fix the missing 'new' prefix.

As for 'use strict', what do you think about?:

<script>
(function() {
  'use strict';

  Polymer('my-custom', {
    ...
  });
})();
</script>

@robdodson
Copy link
Contributor

Unfortunately you can't 'use strict'.
#80

I'll remove it from jshint.

On Mon, Feb 9, 2015 at 7:18 PM, K. Adam Christensen <
notifications@github.com> wrote:

I believe if you set "newcap" to false
http://jshint.com/docs/options/#newcap then this should fix the missing
'new' prefix.

As for 'use strict', what do you think about?:

<script> (function() { 'use strict'; Polymer('my-custom', { ... }); })(); </script>


Reply to this email directly or view it on GitHub
#123 (comment)
.

VandeurenGlenn added a commit to VandeurenGlenn/Employee that referenced this issue Sep 22, 2015
- Remove firebase-auth
- _user.email -> email
- _user -> user
- Add method for notifying existing emails
- Add method for disabling the fab when an email already exist in the
database.
- Add method for disabling the fab when needed values are not defined.
- Remove 'use strict' (fixes jshint)
[check](yeoman/generator-polymer#123)
- Sync the user when attached.
- Cleanup tempVal
- Fix gender & profile link for users who want to sign up using their
google business/company email.
- Remove _getRef()
VandeurenGlenn added a commit to VandeurenGlenn/Employee that referenced this issue Sep 22, 2015
- Add firebase-behaviors
- Remove 'use strict'
[check](yeoman/generator-polymer#123)
- Add _user,  creatingAccount, existingUser, provider & params.
- Add existingUserChanged(), checks if the user exists & redirects the
user to sign-up.
- Add functions: detached, _computeOpened, login, logout, _userChanged &
setUserId.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants