Skip to content

Migration to ESLint#389

Merged
nikithauc merged 19 commits into3.0.0from
JS-Migrate-To-ESLint-Part-2_#308
Feb 6, 2021
Merged

Migration to ESLint#389
nikithauc merged 19 commits into3.0.0from
JS-Migrate-To-ESLint-Part-2_#308

Conversation

@nikithauc
Copy link
Copy Markdown
Contributor

Summary of changes

  1. Added eslint rules, picking some rules from https://github.com/microsoft/TypeScript/blob/master/.eslintrc.json.
  2. Removed try catches where the catch was simply rethrowing the error.
  3. Applied no-inferrable-types. Example - const x:number = 1 will now be const x = 1. The goal of this to avoid redundancy and verbose code.
  4. Sorted imports.
  5. Replaced options.hasOwnProperty(i) with Object.prototype.hasOwnProperty.call(options, i). https://stackoverflow.com/questions/12017693/why-use-object-prototype-hasownproperty-callmyobj-prop-instead-of-myobj-hasow
  6. Additional code improvements with use of variables.

@nikithauc nikithauc changed the title Js migrate to es lint part 2 #308 Migration to ESLint Feb 2, 2021
Copy link
Copy Markdown
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Thanks for making that change. This is greatly going to reduce review workload as well as bring some extra consistency to the code.

Comment thread .eslintignore Outdated
Comment thread .eslintrc.json Outdated
Comment thread src/Client.ts
Comment thread src/GraphRequest.ts
Comment thread src/middleware/HTTPMessageHandler.ts Outdated
Comment thread src/content/BatchRequestContent.ts
Comment thread src/middleware/options/TelemetryHandlerOptions.ts Outdated
Comment thread test/common/core/Client.ts Outdated
Comment thread src/middleware/options/TelemetryHandlerOptions.ts
@nikithauc nikithauc merged commit bb319a5 into 3.0.0 Feb 6, 2021
@nikithauc nikithauc linked an issue Feb 6, 2021 that may be closed by this pull request
@nikithauc nikithauc deleted the JS-Migrate-To-ESLint-Part-2_#308 branch May 3, 2021 19:05
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.

Library should be updated to use ESLint instead of TSLint

4 participants