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

Feedback: ESLint ruleset #9502

Closed
wants to merge 79 commits into from

Conversation

tylerbutler
Copy link
Member

@tylerbutler tylerbutler commented Mar 16, 2022

I'm not sure how to best review this, so this PR is an attempt. If you have other ideas, they are welcome.

I exported the complete config (using eslint --print-config) that applies to a TypeScript file in a project using our strict config. That was you can comment on specific rules. However, it's still tough to know what all the rules do. :( I don't have any good solutions, but below are links to the docs for the big rulesets/plugins we're using so rules are easier to look up.

There is also a second file, changes-from-minimal-to-strict.json, that is a diff of today's minimal config (used my 99% of packages) and the new strict config.

The following PRs contain examples of the practical effects of applying this config to some of our packages.

Comment on lines 47 to 40
"@typescript-eslint/no-parameter-properties": [
"warn",
{
"allows": [
"private",
"private readonly",
"public readonly",
"readonly"
]
}
],
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 prevents properties from being declared within the parameters of constructors unless they're private or readonly.

Copy link
Member

Choose a reason for hiding this comment

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

This will probably be super disruptive to fix up, and I personally don't mind this TS language feature. And what's the reasoning behind the specific restrictions here (only allow private/readonly)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Declaring parameters in constructors is foreign to non-TS devs, but more importantly, they make it more difficult to find where class-level properties are declared when reading code. It's a variant of the "declare as close to use as possible" rule -- "declare all class members together."

But I agree that cleanup may be ugly. And it does require more code.

Copy link
Member

Choose a reason for hiding this comment

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

And it does require more code

At least the emitted JS is the same, it appears, based on a quick check in TS Playground.

If there were a rule to require each such param on its own line in the constructor declaration I'd definitely be in favor of that, I'm strict to do that myself.

@tylerbutler tylerbutler changed the base branch from main to lint/base March 17, 2022 19:12
@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: sharedstring area: driver Driver related issues area: loader Loader related issues area: odsp-driver area: server Server related issues (routerlicious) dependencies Pull requests that update a dependency file public api change Changes to a public API labels Mar 17, 2022
@github-actions github-actions bot removed area: dds Issues related to distributed data structures dependencies Pull requests that update a dependency file area: server Server related issues (routerlicious) public api change Changes to a public API area: loader Loader related issues area: driver Driver related issues area: odsp-driver labels Mar 17, 2022
vladsud and others added 5 commits April 1, 2022 12:48
Closes microsoft#9683: Duration in "MsnStatistics" event is tracking garbage
Helps better understand microsoft#9682: MSN window is too large!

This change adds
- tracking of collab window at summarization, to better understand impact on quality of summary (search, size of catchup blobs).
- tracking of batch sizes, time to inbound and msn size at that time
   - I expect to see msn size correlating with batch sizes, as collab window grows to at least the size of batch at the moment when batch is sent
- Correct tracking of how long it takes for a sequence number to fall out of collab window.
Correctly handle the case where multiple containers upload the same blob and submit blobAttach ops with identical blob IDs due to blob de-duping. In this case, BlobManager should only resolve the deferred promise when it sees its own op.
@github-actions github-actions bot added area: build Build related issues area: dds Issues related to distributed data structures area: dds: propertydds area: dds: sharedstring area: definitions area: dev experience Improving the experience of devs building on top of fluid area: driver Driver related issues area: examples Changes that focus on our examples area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: loader Loader related issues area: odsp-driver area: runtime Runtime related issues area: server Server related issues (routerlicious) area: test area: website breaking change This PR or issue would introduce a breaking change dependencies Pull requests that update a dependency file public api change Changes to a public API labels Apr 4, 2022
@tylerbutler
Copy link
Member Author

This is now covered by #9740 and #9748, so I'm closing this.

@tylerbutler tylerbutler closed this Apr 5, 2022
@tylerbutler tylerbutler deleted the lint/config branch April 5, 2022 22:55
Josmithr added a commit that referenced this pull request Dec 5, 2022
…o require explicit modifiers (#13134)

Updates rule to match discussion outcome in [this
discussion](#9502 (comment)).

Rule documentation:
https://typescript-eslint.io/rules/explicit-member-accessibility/

Also fixes violations in packages using the `strict` config

### Breaking Change

Note that this is a breaking change with respect to the above rule. We
are changing error-level enforcement of the policy to the opposite rule,
so code changes will be required. This PR pre-fixes the violations
existing at this point in time, but any changes between now and when the
new package is published and adopted will need to be fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Build related issues area: dds: propertydds area: dds: sharedstring area: dds Issues related to distributed data structures area: definitions area: dev experience Improving the experience of devs building on top of fluid area: driver Driver related issues area: examples Changes that focus on our examples area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: loader Loader related issues area: odsp-driver area: runtime Runtime related issues area: server Server related issues (routerlicious) area: website breaking change This PR or issue would introduce a breaking change dependencies Pull requests that update a dependency file public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.