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

Use strict eslint config in azure-service-utils #9489

Closed

Conversation

tylerbutler
Copy link
Member

No description provided.

@tylerbutler tylerbutler requested review from msfluid-bot and a team as code owners March 15, 2022 18:25
@github-actions github-actions bot added the area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct label Mar 15, 2022
@@ -36,7 +36,8 @@
},
"dependencies": {
"@fluidframework/protocol-definitions": "^0.1027.1000",
"jsrsasign": "^10.2.0"
"jsrsasign": "^10.2.0",
"uuid": "^8.3.1"
Copy link
Member Author

Choose a reason for hiding this comment

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

This dependency was completely missing. I think the only reason it has been building OK is because of lerna dependency hoisting.

Comment on lines +33 to +35
if (documentId === undefined) {
throw new Error("documentId cannot be undefined");
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't understand why this function has a nullable documentId parameter... Could I make it required? Or use a different type for the claims?

@@ -4,7 +4,7 @@
"src/test/**/*"
],
"compilerOptions": {
"strictNullChecks": false,
"strictNullChecks": true,
Copy link
Member Author

Choose a reason for hiding this comment

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

Scary that this was disabled...

@@ -5,13 +5,20 @@

module.exports = {
"extends": [
"@fluidframework/eslint-config-fluid"
"@fluidframework/eslint-config-fluid/strict"
Copy link
Contributor

Choose a reason for hiding this comment

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

I see what you're doing here, permitting piecemeal improvements to the ruleset. However I think an opt-in approach is slower than an opt-out approach and makes it easy for new packages to continue adopting bad habits (in much the same way that having our rules disabled for a period of time permitted decay of our code quality).

I'd suggest getting a single, strict ruleset established in the eslint package and turn it on for all packages at the same time. For packages that don't comply, use disables in their individual eslintrc as necessary. This gets the most rules enabled for the most packages in the shortest period of time, and ensures any new package is strictly enforced by default. Cleaning out eslintrc's across the repo is then just a burndown effort.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good advice, thanks. #9501 tracks all the relevant work I know of -- take a look and let me know if there's something missing.

ensures any new package is strictly enforced by default.

Minor quibble -- because we don't have a proper project template or scaffold in place, people copy/paste projects, which means project-level overrides tend to follow new projects around like zombies. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

That's true, but diligent reviewers should object to new packages being added with gross disables during PR (same as they should object to incorrect README text, etc.).

Copy link
Member Author

Choose a reason for hiding this comment

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

diligent reviewers

Who are these people you speak of? 😝

@tylerbutler
Copy link
Member Author

Closing without merging since this review was just to collect feedback.

@tylerbutler tylerbutler closed this May 6, 2022
@tylerbutler tylerbutler deleted the lint/azure-service-utils branch May 6, 2022 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants