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

Fix part of #10474: Cover more files with strict checks #11100

Merged
merged 5 commits into from Nov 9, 2020

Conversation

krishita30j
Copy link
Contributor

@krishita30j krishita30j commented Oct 31, 2020

…e.spec.ts, id-generation.service.spec.ts and tsconfig-strict.json

Overview

  1. This PR fixes or fixes part of Make typescript checks strict #10474.
  2. This PR does the following: Cover more files with strict checks

Essential Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The linter/Karma presubmit checks have passed locally on your machine.
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)
    • This lets reviewers restart your CircleCI tests for you.
  • The PR is made from a branch that's not called "develop".

PR Pointers

  • Make sure to follow the instructions for making a code change.
  • Oppiabot will notify you when you don't add a PR_CHANGELOG label. If you are unable to do so, please @-mention a code owner (who will be in the Reviewers list), or ask on Gitter.
  • For what code owners will expect, see the Code Owner's wiki page.
  • Make sure your PR follows conventions in the style guide, otherwise this will lead to review delays.
  • Never force push. If you do, your PR will be closed.

…e.spec.ts, id-generation.service.spec.ts and tsconfig-strict.json
Copy link
Member

@vojtechjelinek vojtechjelinek left a comment

Choose a reason for hiding this comment

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

Thanks! Just a few comments.

Comment on lines 98 to 99
// eslint-disable-next-line max-len
existingNumSpaces = Object.keys(numSpacesToDesiredIndentLevel).map(Number);
Copy link
Member

Choose a reason for hiding this comment

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

We prefer to limit the usage of eslint-disable exceptions. You can do something like this:

Suggested change
// eslint-disable-next-line max-len
existingNumSpaces = Object.keys(numSpacesToDesiredIndentLevel).map(Number);
existingNumSpaces = Object.keys(
numSpacesToDesiredIndentLevel
).map(Number);

Comment on lines 72 to 73
// eslint-disable-next-line max-len
var existingNumSpaces = Object.keys(numSpacesToDesiredIndentLevel).map(Number);
Copy link
Member

Choose a reason for hiding this comment

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

We prefer to limit the usage of eslint-disable exceptions. You can do something like this:

Suggested change
// eslint-disable-next-line max-len
var existingNumSpaces = Object.keys(numSpacesToDesiredIndentLevel).map(Number);
var existingNumSpaces = Object.keys(
numSpacesToDesiredIndentLevel
).map(Number);

@@ -52,12 +52,12 @@ export class CodeNormalizerService {
var FOUR_SPACES = ' ';
// Maps the number of spaces at the beginning of a line to an int
// specifying the desired indentation level.
var numSpacesToDesiredIndentLevel = {
var numSpacesToDesiredIndentLevel: { [key: number]: number; } = {
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure about the ; inside the type definition?

Suggested change
var numSpacesToDesiredIndentLevel: { [key: number]: number; } = {
var numSpacesToDesiredIndentLevel: { [key: number]: number } = {

@oppiabot
Copy link

oppiabot bot commented Oct 31, 2020

Hi @krishita30j, it looks like some changes were requested on this pull request by @vojtechjelinek. PTAL. Thanks!

@krishita30j
Copy link
Contributor Author

@vojtechjelinek, I have made the changes.

@vojtechjelinek
Copy link
Member

@krishita30j Please respond to all reviewer's comments with: "Done" when you fix them (next time).

Copy link
Member

@vojtechjelinek vojtechjelinek left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@nishantwrp nishantwrp left a comment

Choose a reason for hiding this comment

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

Lgtm

@oppiabot
Copy link

oppiabot bot commented Oct 31, 2020

Unassigning @nishantwrp since they have already approved the PR.

Copy link
Member

@aks681 aks681 left a comment

Choose a reason for hiding this comment

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

Lgtm as codeowner.

@oppiabot
Copy link

oppiabot bot commented Nov 2, 2020

Hi @krishita30j. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@oppiabot
Copy link

oppiabot bot commented Nov 2, 2020

Hi @krishita30j. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@srijanreddy98 srijanreddy98 requested review from nithusha21 and removed request for srijanreddy98 November 4, 2020 12:12
@oppiabot
Copy link

oppiabot bot commented Nov 5, 2020

Unassigning @nithusha21 since they have already approved the PR.

@oppiabot
Copy link

oppiabot bot commented Nov 9, 2020

Hi @krishita30j. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@kevintab95 kevintab95 merged commit 8d49eb4 into oppia:develop Nov 9, 2020
@krishita30j krishita30j deleted the typescriptCheck branch November 10, 2020 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants