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

Add additional lint rules from typescript-eslint and eslint-plugin-unicorn #3557

Merged
merged 8 commits into from
Mar 4, 2023

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Mar 3, 2023

This PR enables @typescript-eslint recommend-types-required rules and eslint-plugin-unicorn recommended rules https://github.com/sindresorhus/eslint-plugin-unicorn

It uses recommended lists, and then turns off a good amount of them. This way, if recommended gets upgraded in the future, we can get these updates, and we can re-enable some of our disabled over time if we see fit to.

The unicorn rules are a little eccentric but actually have some good fixes (avoids accidentally quadratic usages of includes instead of has on a Set for example). other interesting rules in unicorn include forbidding Array reduce, as it generally produces more confusing code. I'd have to say, this is probably true, so I converted some usages of array reduce

Similarly, the recommended-types-required has many rules that are good in nature, but need disabling for practical purposes for now (we have lots of type any, and can't avoid it in some cases)

Also changes most of our ts-ignore to ts-expect-error, so that if they get fixed somehow, they are no longer ignored

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Mar 3, 2023
@cmdcolin cmdcolin added internal and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Mar 3, 2023
@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Merging #3557 (1412783) into main (7328c19) will increase coverage by 0.15%.
The diff coverage is 57.97%.

❗ Current head 1412783 differs from pull request most recent head 948f766. Consider uploading reports for the commit 948f766 to get more accurate results

@@            Coverage Diff             @@
##             main    #3557      +/-   ##
==========================================
+ Coverage   62.55%   62.70%   +0.15%     
==========================================
  Files         866      864       -2     
  Lines       30324    30224     -100     
  Branches     7280     7266      -14     
==========================================
- Hits        18969    18952      -17     
+ Misses      11165    11081      -84     
- Partials      190      191       +1     
Impacted Files Coverage Δ
packages/core/PluginManager.ts 89.73% <ø> (ø)
...kages/core/assemblyManager/assemblyConfigSchema.ts 90.00% <ø> (ø)
packages/core/configuration/configurationSchema.ts 79.64% <ø> (-0.18%) ⬇️
packages/core/configuration/util.ts 88.04% <ø> (ø)
packages/core/data_adapters/BaseAdapter.ts 74.69% <0.00%> (ø)
...e/data_adapters/CytobandAdapter/CytobandAdapter.ts 31.25% <0.00%> (ø)
...ckages/core/pluggableElementTypes/RpcMethodType.ts 85.00% <ø> (ø)
...eElementTypes/renderers/ServerSideRendererType.tsx 38.09% <ø> (ø)
...entTypes/renderers/util/serializableFilterChain.ts 80.00% <ø> (ø)
packages/core/rpc/WebWorkerRpcDriver.ts 0.00% <0.00%> (ø)
... and 253 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin cmdcolin force-pushed the lint_unicorn2 branch 2 times, most recently from 9f06dfa to 3a8b4a0 Compare March 3, 2023 17:59
@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Mar 3, 2023

should be ready to go. has actually low amount of conflicts with e.g. #3503

@cmdcolin cmdcolin merged commit c60a972 into main Mar 4, 2023
@cmdcolin cmdcolin deleted the lint_unicorn2 branch March 4, 2023 20:24
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

1 participant