Fix jshint warnings.
Review Request #4302 — Created July 6, 2013 and submitted
Fix jshint warnings. This fixes a bunch of warnings in our JavaScript that JSHint reported. A .jshintrc has been created which will suppress warnings about __proto__ being used (needed in _.super), and operators like "&&", "?" and ":" being at the beginning of lines. This also turns on a bunch of jshint options for things we want to enforce, like one var statement at the top of a function, unused variable checks, trailing comma detection, and more. One thing to note is that we use some reserved keywords as keys, which causes warnings in JSHint unless they're always quoted. This so far only came up with the new RepositoryBranch. I've quoted them, but we may want to consider coming up with new standardized names, such as "isDefault".
Didn't see any issues using the site. Unit tests passed. JSHint was happy, except for diffviewer.js, which is gone with my other changes.
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: Ignored Files: reviewboard/static/rb/js/views/tests/reviewBoxListViewTests.js reviewboard/static/rb/js/views/draftReviewBannerView.js reviewboard/static/rb/js/views/issueSummaryTableView.js reviewboard/static/rb/js/models/tests/draftReviewModelTests.js reviewboard/static/rb/js/views/abstractCommentBlockView.js reviewboard/static/rb/js/collections/resourceCollection.js reviewboard/static/rb/js/resources/models/tests/repositoryBranchModelTests.js reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js reviewboard/static/rb/js/views/reviewRequestEditorView.js reviewboard/static/rb/js/models/tests/reviewModelTests.js reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/static/rb/js/utils/compatUtils.js reviewboard/static/rb/js/models/diffCommentModel.js reviewboard/static/rb/js/views/commentIssueBarView.js reviewboard/static/rb/js/utils/tests/keyBindingUtilsTests.js reviewboard/static/rb/js/views/collectionView.js reviewboard/static/rb/js/utils/propertyUtils.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/models/userSessionModel.js reviewboard/static/rb/js/resources/collections/tests/repositoryBranchesCollectionTests.js reviewboard/static/rb/js/views/fileAttachmentThumbnailView.js reviewboard/static/rb/js/resources/collections/tests/repositoryCommitsCollectionTests.js reviewboard/static/rb/js/resources/collections/repositoryCommitsCollection.js reviewboard/static/rb/js/views/commentDialogView.js reviewboard/static/rb/js/resources/models/repositoryBranchModel.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/baseResourceModel.js reviewboard/static/rb/js/models/diffModel.js reviewboard/static/rb/js/models/draftResourceModelMixin.js reviewboard/static/rb/js/utils/linkifyUtils.js reviewboard/static/rb/js/views/reviewDialogView.js reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js reviewboard/static/rb/js/views/tests/reviewReplyEditorViewTests.js reviewboard/static/rb/js/models/baseCommentReplyModel.js reviewboard/static/rb/js/views/reviewBoxView.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js reviewboard/static/rb/js/models/baseCommentModel.js reviewboard/static/rb/js/models/screenshotCommentModel.js reviewboard/static/rb/js/utils/tests/linkifyUtilsTests.js reviewboard/static/rb/js/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/diffviewer/views/tests/diffReviewableViewTests.js reviewboard/static/rb/js/views/tests/draftReviewBannerViewTests.js reviewboard/static/rb/js/views/tests/fileAttachmentThumbnailViewTests.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/utils/consoleUtils.js reviewboard/static/rb/js/models/commentEditorModel.js reviewboard/static/rb/js/views/tests/reviewReplyDraftBannerViewTests.js reviewboard/static/rb/js/repositoryform.js reviewboard/static/rb/js/views/tests/commentDialogViewTests.js reviewboard/static/rb/js/models/tests/reviewReplyModelTests.js reviewboard/static/rb/js/models/tests/draftReviewRequestModelTests.js reviewboard/static/rb/js/models/abstractCommentBlockModel.js reviewboard/static/rb/js/models/tests/baseResourceModelTests.js reviewboard/static/rb/js/utils/keyBindingUtils.js reviewboard/static/rb/js/.jshintrc reviewboard/static/rb/js/models/reviewReplyEditorModel.js reviewboard/static/rb/js/admin.js reviewboard/static/rb/js/common.js reviewboard/static/rb/js/models/abstractReviewableModel.js reviewboard/static/rb/js/models/tests/commentEditorModelTests.js reviewboard/static/rb/js/views/diffFragmentQueueView.js
- Change Summary:
-
* Rewrapped some lines. * Added a missing /* rsp */
- Diff:
-
Revision 2 (+354 -350)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: Ignored Files: reviewboard/static/rb/js/views/tests/reviewBoxListViewTests.js reviewboard/static/rb/js/views/draftReviewBannerView.js reviewboard/static/rb/js/views/issueSummaryTableView.js reviewboard/static/rb/js/models/tests/draftReviewModelTests.js reviewboard/static/rb/js/views/abstractCommentBlockView.js reviewboard/static/rb/js/collections/resourceCollection.js reviewboard/static/rb/js/resources/models/tests/repositoryBranchModelTests.js reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js reviewboard/static/rb/js/views/reviewRequestEditorView.js reviewboard/static/rb/js/models/tests/reviewModelTests.js reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/static/rb/js/utils/compatUtils.js reviewboard/static/rb/js/models/diffCommentModel.js reviewboard/static/rb/js/views/commentIssueBarView.js reviewboard/static/rb/js/utils/tests/keyBindingUtilsTests.js reviewboard/static/rb/js/views/collectionView.js reviewboard/static/rb/js/utils/propertyUtils.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/models/userSessionModel.js reviewboard/static/rb/js/resources/collections/tests/repositoryBranchesCollectionTests.js reviewboard/static/rb/js/views/fileAttachmentThumbnailView.js reviewboard/static/rb/js/resources/collections/tests/repositoryCommitsCollectionTests.js reviewboard/static/rb/js/resources/collections/repositoryCommitsCollection.js reviewboard/static/rb/js/views/commentDialogView.js reviewboard/static/rb/js/resources/models/repositoryBranchModel.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/baseResourceModel.js reviewboard/static/rb/js/models/diffModel.js reviewboard/static/rb/js/models/draftResourceModelMixin.js reviewboard/static/rb/js/utils/linkifyUtils.js reviewboard/static/rb/js/views/reviewDialogView.js reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js reviewboard/static/rb/js/views/tests/reviewReplyEditorViewTests.js reviewboard/static/rb/js/models/baseCommentReplyModel.js reviewboard/static/rb/js/views/reviewBoxView.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js reviewboard/static/rb/js/models/baseCommentModel.js reviewboard/static/rb/js/models/screenshotCommentModel.js reviewboard/static/rb/js/utils/tests/linkifyUtilsTests.js reviewboard/static/rb/js/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/diffviewer/views/tests/diffReviewableViewTests.js reviewboard/static/rb/js/views/tests/draftReviewBannerViewTests.js reviewboard/static/rb/js/views/tests/fileAttachmentThumbnailViewTests.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/utils/consoleUtils.js reviewboard/static/rb/js/models/commentEditorModel.js reviewboard/static/rb/js/views/tests/reviewReplyDraftBannerViewTests.js reviewboard/static/rb/js/repositoryform.js reviewboard/static/rb/js/views/tests/commentDialogViewTests.js reviewboard/static/rb/js/models/tests/reviewReplyModelTests.js reviewboard/static/rb/js/models/tests/draftReviewRequestModelTests.js reviewboard/static/rb/js/models/abstractCommentBlockModel.js reviewboard/static/rb/js/models/tests/baseResourceModelTests.js reviewboard/static/rb/js/utils/keyBindingUtils.js reviewboard/static/rb/js/.jshintrc reviewboard/static/rb/js/models/reviewReplyEditorModel.js reviewboard/static/rb/js/admin.js reviewboard/static/rb/js/common.js reviewboard/static/rb/js/models/abstractReviewableModel.js reviewboard/static/rb/js/models/tests/commentEditorModelTests.js reviewboard/static/rb/js/views/diffFragmentQueueView.js
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: Ignored Files: reviewboard/static/rb/js/views/tests/reviewBoxListViewTests.js reviewboard/static/rb/js/views/draftReviewBannerView.js reviewboard/static/rb/js/views/issueSummaryTableView.js reviewboard/static/rb/js/models/tests/draftReviewModelTests.js reviewboard/static/rb/js/views/abstractCommentBlockView.js reviewboard/static/rb/js/collections/resourceCollection.js reviewboard/static/rb/js/resources/models/tests/repositoryBranchModelTests.js reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js reviewboard/static/rb/js/views/reviewRequestEditorView.js reviewboard/static/rb/js/models/tests/reviewModelTests.js reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/static/rb/js/utils/compatUtils.js reviewboard/static/rb/js/models/diffCommentModel.js reviewboard/static/rb/js/views/commentIssueBarView.js reviewboard/static/rb/js/utils/tests/keyBindingUtilsTests.js reviewboard/static/rb/js/views/collectionView.js reviewboard/static/rb/js/utils/propertyUtils.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/models/userSessionModel.js reviewboard/static/rb/js/resources/collections/tests/repositoryBranchesCollectionTests.js reviewboard/static/rb/js/views/fileAttachmentThumbnailView.js reviewboard/static/rb/js/resources/collections/tests/repositoryCommitsCollectionTests.js reviewboard/static/rb/js/resources/collections/repositoryCommitsCollection.js reviewboard/static/rb/js/views/commentDialogView.js reviewboard/static/rb/js/resources/models/repositoryBranchModel.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/baseResourceModel.js reviewboard/static/rb/js/models/diffModel.js reviewboard/static/rb/js/models/draftResourceModelMixin.js reviewboard/static/rb/js/utils/linkifyUtils.js reviewboard/static/rb/js/views/reviewDialogView.js reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js reviewboard/static/rb/js/views/tests/reviewReplyEditorViewTests.js reviewboard/static/rb/js/models/baseCommentReplyModel.js reviewboard/static/rb/js/views/reviewBoxView.js reviewboard/static/rb/js/pages/views/diffViewerPageView.js reviewboard/static/rb/js/models/baseCommentModel.js reviewboard/static/rb/js/models/screenshotCommentModel.js reviewboard/static/rb/js/utils/tests/linkifyUtilsTests.js reviewboard/static/rb/js/models/fileAttachmentCommentModel.js reviewboard/static/rb/js/diffviewer/views/tests/diffReviewableViewTests.js reviewboard/static/rb/js/views/tests/draftReviewBannerViewTests.js reviewboard/static/rb/js/views/tests/fileAttachmentThumbnailViewTests.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/utils/consoleUtils.js reviewboard/static/rb/js/models/commentEditorModel.js reviewboard/static/rb/js/views/tests/reviewReplyDraftBannerViewTests.js reviewboard/static/rb/js/repositoryform.js reviewboard/static/rb/js/views/tests/commentDialogViewTests.js reviewboard/static/rb/js/models/tests/reviewReplyModelTests.js reviewboard/static/rb/js/models/tests/draftReviewRequestModelTests.js reviewboard/static/rb/js/models/abstractCommentBlockModel.js reviewboard/static/rb/js/models/tests/baseResourceModelTests.js reviewboard/static/rb/js/utils/keyBindingUtils.js reviewboard/static/rb/js/.jshintrc reviewboard/static/rb/js/models/reviewReplyEditorModel.js reviewboard/static/rb/js/admin.js reviewboard/static/rb/js/common.js reviewboard/static/rb/js/models/abstractReviewableModel.js reviewboard/static/rb/js/models/tests/commentEditorModelTests.js reviewboard/static/rb/js/views/diffFragmentQueueView.js