- Notifications
You must be signed in to change notification settings - Fork 233
#308 - Migration from TSLint to EsLint #314
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
Conversation
| @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)) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
Changes made -
To-Do -
I will be enabling the rules and sorting the errors reported in upcoming pull requests.