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

[Do not merge] Standard JS linting with automatic fixes #371

Closed
wants to merge 1 commit into from
Closed

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented May 22, 2017

A test to see what the affects of linting using Standard JS would be on this repository.

Running standard --fix

There are a number of linting issues that can't be fixed automatically:

  /app/assets/javascripts/modules/ukvi_ab_test.js:10:7: Split initialized 'var' declarations into multiple statements.
  /app/assets/javascripts/modules/ukvi_ab_test.js:15:7: Do not use 'new' for side effects.
  /app/assets/javascripts/modules/ukvi_ab_test.js:20:21: Expected consistent spacing
  /app/assets/javascripts/modules/ukvi_ab_test.js:29:9: '$' is not defined.
  /app/assets/javascripts/modules/ukvi_ab_test.js:30:9: '$' is not defined.
  /app/assets/javascripts/modules/ukvi_ab_test.js:34:9: '$' is not defined.
  /app/assets/javascripts/modules/ukvi_ab_test.js:35:9: '$' is not defined.
  /app/assets/javascripts/webchat.js:7:1: 'EGAIN_NORMALISATION' is not defined.
  /app/assets/javascripts/webchat.js:16:18: 'EGAIN_NORMALISATION' is not defined.
  /app/assets/javascripts/webchat/library.js:4:7: 'windowOpen' is assigned a value but never used.
  /app/assets/javascripts/webchat/library.js:27:41: Expected an object to be thrown.
  /app/assets/javascripts/webchat/library.js:53:60: Expected '!==' and instead saw '!='.

  /spec/javascripts/webchat.spec.js:129:7: 'returnsNumber' is not defined.
  /spec/javascripts/webchat.spec.js:130:7: 'analyticsCalled' is not defined.
  /spec/javascripts/webchat.spec.js:131:19: 'lolex' is not defined.
  /spec/javascripts/webchat.spec.js:133:33: 'returnsNumber' is not defined.
  /spec/javascripts/webchat.spec.js:134:9: 'returnsNumber' is not defined.
  /spec/javascripts/webchat.spec.js:139:9: 'analyticsCalled' is not defined.
  /spec/javascripts/webchat.spec.js:155:14: 'analyticsCalled' is not defined.
  /spec/javascripts/webchat.spec.js:158:14: 'analyticsCalled' is not defined.
  /spec/javascripts/webchat.spec.js:255:14: 'webChatNormalise' is not defined.
  /spec/javascripts/webchat.spec.js:256:14: 'webChatNormalise' is not defined.
  /spec/javascripts/webchat.spec.js:257:14: 'webChatNormalise' is not defined.
  /spec/javascripts/webchat.spec.js:258:14: 'webChatNormalise' is not defined.

I'm not sure how we would fix this:
/app/assets/javascripts/modules/ukvi_ab_test.js:15:7: Do not use 'new' for side effects.

cc @nickcolley @mcgoooo

@boffbowsh boffbowsh temporarily deployed to government-frontend-pr-371 May 22, 2017 Inactive
@theleebriggs
Copy link
Contributor

@theleebriggs theleebriggs commented May 22, 2017

I guess returning the new component would get rid of that UKVI error - not that it gets away from the point of showing that as an error.

@nickcolley
Copy link
Contributor

@nickcolley nickcolley commented May 24, 2017

Highlights the abuse of a class pattern when a function would do? For now we could put a comment on it like we've done elsewhere.

@fofr fofr closed this Jun 7, 2017
@barrucadu barrucadu deleted the standard-js branch Apr 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.