Skip to content

Fix the scoping of our ESLint rules #13558

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

Merged
merged 8 commits into from
Aug 25, 2020

Conversation

kimadeline
Copy link

@kimadeline kimadeline commented Aug 21, 2020

For #13142

  • ignore all existing files in vscode-python/src/ and vscode-python/build except for src/client/pythonEnvironments and src/test/pythonEnvironments
  • ignore the ipywidget workspace folder (was causing issues)
  • ignore src/client/pythonEnvironments and src/test/pythonEnvironments in .prettierignore
  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • Has a news entry file (remember to thank yourself!).
  • Appropriate comments and documentation strings in the code.
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated.
  • Test plan is updated as appropriate.
  • package-lock.json has been regenerated by running npm install (if dependencies have changed).
  • The wiki is updated with any design decisions/details.

@kimadeline kimadeline added the no-changelog No news entry required label Aug 21, 2020
@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2020

Codecov Report

Merging #13558 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13558      +/-   ##
==========================================
+ Coverage   59.74%   59.77%   +0.02%     
==========================================
  Files         670      670              
  Lines       37427    37497      +70     
  Branches     5371     5385      +14     
==========================================
+ Hits        22359    22412      +53     
- Misses      13905    13916      +11     
- Partials     1163     1169       +6     
Impacted Files Coverage Δ
src/client/common/utils/platform.ts 64.70% <0.00%> (-11.77%) ⬇️
src/client/datascience/crossProcessLock.ts 79.41% <0.00%> (-11.77%) ⬇️
src/client/linters/pydocstyle.ts 86.66% <0.00%> (-2.23%) ⬇️
src/client/datascience/debugLocationTracker.ts 76.56% <0.00%> (-1.57%) ⬇️
src/client/common/process/proc.ts 14.49% <0.00%> (-0.73%) ⬇️
...atascience/notebookStorage/nativeEditorProvider.ts 17.26% <0.00%> (-0.39%) ⬇️
src/client/common/types.ts 100.00% <0.00%> (ø)
src/client/telemetry/constants.ts 100.00% <0.00%> (ø)
src/client/common/experiments/groups.ts 100.00% <0.00%> (ø)
src/client/common/experiments/service.ts 100.00% <0.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f512b1...08297bf. Read the comment docs.

Copy link

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

Why not enable for all new files.
Update this file to include all existing files, this way all new files will always have to be eslint compliant, else we'd be updating this file for each new file/folder we add.

@kimadeline
Copy link
Author

@DonJayamanne after talking with @brettcannon we don't want to enable it for the entire repo just yet as we want to prioritize the component refactoring work. We can/will spend time fixing warnings and refactoring code in the rest of the repo once we're done 🙂

@DonJayamanne
Copy link

We can/will spend time fixing warnings and refactoring code in the rest of the repo once we're done 🙂

Not sure what you mean by that.
I'm not suggesting changes to existing code.

What I'm suggesting is

  • Update the above file with a list of all existing *.ts files
  • When you edit existing files, eslint will not lint those
  • When you add/edit new files, eslint will lint those files

This way new code will be eslint compliant, which in my opinion is a much smaller work than having to do that later on again...

This is exactly what we did to ensure the code base was using strict types when we migrated (slowly) to strict checks in tsconfig (tsc).

@kimadeline
Copy link
Author

kimadeline commented Aug 21, 2020

What I'm suggesting is

Update the above file with a list of all existing *.ts files
When you edit existing files, eslint will not lint those
When you add/edit new files, eslint will lint those files

This way new code will be eslint compliant, which in my opinion is a much smaller work than having to do that later on again...

Oh I see! Yeah we could do that, although that would be a lot of files lol
@brettcannon and/or @karthiknadig what do you think?

@brettcannon
Copy link
Member

I'm fine with enumerating all the files outside of our refactoring work so that any new files automatically get caught by this.

@kimadeline
Copy link
Author

Sounds good, this PR is not ready for review then.

@karrtikr karrtikr removed their request for review August 24, 2020 15:03
Copy link

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@kimadeline
Copy link
Author

Alright, PR ready for review for real this time. @ericsnowcurrently could you take a look at it again?

What changed is that now we are listing all of our js, ts, jsx and tsx files in .eslintignore, except for src/client/pythonEnvironments and src/test/pythonEnvironments.

Copy link

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

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

LGTM

@kimadeline kimadeline merged commit c1c9ea7 into microsoft:master Aug 25, 2020
@kimadeline kimadeline deleted the eslint-scoping branch August 25, 2020 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog No news entry required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants