Skip to content

Conversation

@nikithauc
Copy link
Contributor

Changes made -

  1. Uninstalled tslint and removed related files. Installed eslint and added related configuration and ignore files.
  2. Ran a eslint -fix command to auto fix some errors.
  3. Temporarily disabled some rules which reported errors while running the lint command.

To-Do -
I will be enabling the rules and sorting the errors reported in upcoming pull requests.

@jobala
Copy link

jobala commented Aug 17, 2020

@nikithauc this Graph Explorer PR #627 introduces a similar change. I think we should use a simalr eslint configuration file across our Typescript/Javascript projects. Interested to know what you and @ddyett think.

@ddyett
Copy link
Contributor

ddyett commented Aug 17, 2020

@nikithauc this Graph Explorer PR #627 introduces a similar change. I think we should use a simalr eslint configuration file across our Typescript/Javascript projects. Interested to know what you and @ddyett think.

yes they should be as close as possible with reason for variation. i wouldn't block this PR for that or anything but it should be a goal to work towards that.

describe("parsePath", () => {
for (const path in testCases) {
if (testCases.hasOwnProperty(path)) {
if (Object.prototype.hasOwnProperty.call(testCases, path)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks javascript like. which rule required this?

Copy link
Contributor Author

@nikithauc nikithauc Aug 25, 2020

Choose a reason for hiding this comment

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

The rule that requires this - no-prototype-builtins
Reference 1
Reference 2

describe("MiddlewareUtil.ts", async () => {
describe("getRequestHeader", () => {
const key: string = "Content-Type";
const value: string = "application/json";
Copy link
Contributor

@ddyett ddyett Aug 17, 2020

Choose a reason for hiding this comment

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

which rule does this one violate. I have mixed feelings as I somewhat like being explicit. though these ones are obvious so this specific case doesn't bug me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@typescript-eslint/no-inferrable-types.

return Promise.resolve();
}
let responseValue: any;
const contentType = rawResponse.headers.get("Content-type");
Copy link
Member

Choose a reason for hiding this comment

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

I've seen a few headers at a couple of places, constants?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you please elaborate the question?

Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/microsoftgraph/msgraph-sdk-javascript/search?l=TypeScript&q=%22Content-type%22
This constant (more generally all the headers keys) is defined multiple times instead of once as a constant. Would it be worth refactoring 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.

I will have to look into this and check if that is possible. Will scope this outside the linting task.

Copy link
Member

Choose a reason for hiding this comment

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

out of curiosity, how do we capture the things we say we'll do later today? issue in github? somewhere else?

@ddyett ddyett linked an issue Sep 14, 2020 that may be closed by this pull request
@nikithauc nikithauc marked this pull request as draft November 19, 2020 19:08
@nikithauc nikithauc closed this Nov 25, 2020
@nikithauc nikithauc deleted the JS-Migrate-To-ESLint-Part-1_#308 branch April 26, 2021 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants