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

Adds jslint, and linted files. #53

Merged
merged 24 commits into from Jan 21, 2014
Merged

Adds jslint, and linted files. #53

merged 24 commits into from Jan 21, 2014

Conversation

trecenti
Copy link
Contributor

This PR adds jslint using the lib grunt-jslint

here are the directives:

{
browser: true,
indent: 2,
sloppy: true,
nomen: true,
plusplus: true,
predef: [ 'ko', 'jasmine', 'expect', 'describe', 'it', 'spyOn', 'beforeEach', 'afterEach', 'jQuery', '$', 'setFixtures' ]
}

it runs as a dependency for the ci task, or it can be run standalone using grunt jslint.

closes #52

@@ -46,7 +46,7 @@ describe('ko validation integration', function () {
'integer': [ 'Must be number' ]
}),
noNumbersField: ko.observable('').extend({
'invalidChars': [ '1234567890'.split(''), 'Must not have numbers.' ]
'invalidChars': [ ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'], 'Must not have numbers.' ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waaat?

@luizfar
Copy link
Contributor

luizfar commented Jan 21, 2014

http://i.imgur.com/czWCs.gif

@@ -1,4 +1,5 @@
var ko = ko || {};
var ko;
ko = ko || {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😒

@@ -46,7 +46,7 @@ describe('ko validation integration', function () {
'integer': [ 'Must be number' ]
}),
noNumbersField: ko.observable('').extend({
'invalidChars': [ '1234567890'.split(''), 'Must not have numbers.' ]
'invalidChars': [ String.prototype.split.call(['1234567890'], ''), 'Must not have numbers.' ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tried ('1234567890').split('')?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jslint doesn't like that.

On Tue, Jan 21, 2014 at 6:14 PM, João Paulo Bochi
notifications@github.comwrote:

In spec/integration-spec.js:

@@ -46,7 +46,7 @@ describe('ko validation integration', function () {
'integer': [ 'Must be number' ]
}),
noNumbersField: ko.observable('').extend({

  •    'invalidChars': [ '1234567890'.split(''), 'Must not have numbers.' ]
    
  •    'invalidChars': [ String.prototype.split.call(['1234567890'], ''), 'Must not have numbers.' ]
    

have you tried ('1234567890').split('')?


Reply to this email directly or view it on GitHubhttps://github.com//pull/53/files#r9052419
.

Bruno Trecenti
thoughtworks.com

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jslint doesn't like that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and I don't like jshint for that 😒

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsLint.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we not using jshint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 jslint

I don't think anyone agrees with everything in it but I think once you open up the ability to pick and choose it leads to harder team conversations about what you take and what you don't

@jpbochi
Copy link
Contributor

jpbochi commented Jan 21, 2014

:shipit: then

}
}
};
self.objectForEach = ko.utils.objectForEach;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I say remove self.objectForEach and replace with ko.utils.objectForEach everywhere.

Mixing usage of self.objectForEach with ko.utils.arrayFilter, ko.utils.arrayMap and the likes makes no sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, can we do this as part of another PR, there's already a lot of changes not related to jslint here, and I would like to strict to that scope.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep.

@apretto
Copy link

apretto commented Jan 21, 2014

🚢 🇮🇹

trecenti added a commit that referenced this pull request Jan 21, 2014
Adds jslint, and linted files.
@trecenti trecenti merged commit 4dfe442 into master Jan 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add jslint
5 participants