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

Bump eslint-config-pixiebrix from 0.19.1 to 0.20.0 #4721

Merged
merged 9 commits into from Nov 27, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 27, 2022

Bumps eslint-config-pixiebrix from 0.19.1 to 0.20.0.

Release notes

Sourced from eslint-config-pixiebrix's releases.

v0.20.0

  • 5443d981 Cleanup
  • 1a9439a8 Enable dependabot

v0.19.1..v0.20.0

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [eslint-config-pixiebrix](https://github.com/pixiebrix/eslint-config-pixiebrix) from 0.19.1 to 0.20.0.
- [Release notes](https://github.com/pixiebrix/eslint-config-pixiebrix/releases)
- [Commits](pixiebrix/eslint-config-pixiebrix@v0.19.1...v0.20.0)

---
updated-dependencies:
- dependency-name: eslint-config-pixiebrix
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Nov 27, 2022
@dependabot dependabot bot requested a review from fregante November 27, 2022 06:27
@codecov
Copy link

codecov bot commented Nov 27, 2022

Codecov Report

Merging #4721 (6bedac1) into main (472df64) will decrease coverage by 0.02%.
The diff coverage is 75.00%.

❗ Current head 6bedac1 differs from pull request most recent head c52afdf. Consider uploading reports for the commit c52afdf to get more accurate results

@@            Coverage Diff             @@
##             main    #4721      +/-   ##
==========================================
- Coverage   53.00%   52.97%   -0.03%     
==========================================
  Files         922      922              
  Lines       27306    27288      -18     
  Branches     5272     5268       -4     
==========================================
- Hits        14474    14457      -17     
+ Misses      12832    12831       -1     
Impacted Files Coverage Δ
src/background/auth.ts 15.82% <0.00%> (ø)
src/blocks/renderers/table.tsx 64.28% <0.00%> (ø)
src/blocks/transformers/mapping.ts 0.00% <0.00%> (ø)
.../components/documentBuilder/render/ListElement.tsx 35.55% <0.00%> (ø)
src/options/pages/marketplace/ServicesBody.tsx 60.00% <ø> (ø)
src/registry/internal.ts 24.17% <0.00%> (ø)
src/pageEditor/extensionPoints/base.ts 58.82% <50.00%> (ø)
...lds/schemaFields/widgets/registerDefaultWidgets.ts 95.83% <83.33%> (+0.96%) ⬆️
src/blocks/renderers/customForm.tsx 37.62% <100.00%> (ø)
src/blocks/renderers/dataTable.ts 90.90% <100.00%> (ø)
... and 13 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

if (Object.prototype.hasOwnProperty.call(current, serviceAuthId)) {
// eslint-disable-next-line security/detect-object-injection -- just checked with `hasOwnProperty`
if (Object.hasOwn(current, serviceAuthId)) {
// eslint-disable-next-line security/detect-object-injection -- just checked with `hasOwn`
Copy link
Collaborator

Choose a reason for hiding this comment

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

@@ -369,7 +369,7 @@ export async function launchOAuth2Flow(
throw new BusinessError("authorizeUrl is required for oauth2");
}

const isImplicitFlow = typeof rawTokenUrl === "undefined";
const isImplicitFlow = rawTokenUrl === undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

]);
const prop = freshIdentifier(
"property" as SafeString,
Object.keys(draft)
Copy link
Collaborator

Choose a reason for hiding this comment

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


if (typeof OmitFieldWidget === "undefined" || OmitFieldWidget == null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Redundant check with == null

for (const [name, widget] of Object.entries(defaultWidgets)) {
if (!widget) {
throw new Error(
`Error registering default widgets. ${name} is undefined. Is there a circular dependency?`
Copy link
Collaborator

@fregante fregante Nov 27, 2022

Choose a reason for hiding this comment

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

This loop checks all the widgets, not just 2. This is the only runtime change and it has been verified in the page editor

<Col xs={12} sm={6} xl={4}>
<Card key={serviceId} className={styles.serviceCard}>
<Col xs={12} sm={6} xl={4} key={serviceId}>
<Card className={styles.serviceCard}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand the lint rule change and why the key needs to be on the top level of the optional child here, but the key is now on the entire parent Col rather than just the Card. There are other components in the children of this Col. Does this change affect how those components re-render when/if the serviceId changes? Was this also thoroughly tested?

Copy link
Collaborator

Choose a reason for hiding this comment

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

There are other components in the children of this Col

Col has only one child: Card

What's inside Col doesn't matter anyway as it's tracked as a whole block. As long as the direct child in a loop has the key, there's no problem.

If we used React.StrictMode we'd even get a runtime warning: https://codepen.io/fregante/pen/bGKjqJe?editors=0011

Does this change affect how those components re-render when/if the serviceId changes?

If it does, it's not in a way that matters, it just gives the correct diffing signals at a low level.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh sorry, didn't see that the card wraps everything, never mind 👍

@@ -30,7 +30,7 @@
// Help Madge resolve this dependency
"marked": ["node_modules/marked/lib/marked.esm.js"]
},
"lib": ["ES2021", "DOM", "DOM.Iterable"],
"lib": ["ES2022", "DOM", "DOM.Iterable"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

I verified that our current Chrome version (in the manifest) supports 100% of ES2022 already, so we're covered

http://kangax.github.io/compat-table/es2016plus/

@@ -89,7 +89,6 @@ export async function waitForTargetByUrl(url: string): Promise<Target> {

/**
* Run a brick in the window that opened the source window
* @param request
Copy link
Collaborator

Choose a reason for hiding this comment

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

Empty JSDoc declaration

@fregante fregante merged commit 1bb4755 into main Nov 27, 2022
@fregante fregante deleted the dependabot/npm_and_yarn/eslint-config-pixiebrix-0.20.0 branch November 27, 2022 07:53
@twschiller twschiller added this to the 1.7.15 milestone Nov 27, 2022
<Col xs={12} sm={6} xl={4}>
<Card key={serviceId} className={styles.serviceCard}>
<Col xs={12} sm={6} xl={4} key={serviceId}>
<Card className={styles.serviceCard}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand the lint rule change and why the key needs to be on the top level of the optional child here, but the key is now on the entire parent Col rather than just the Card. There are other components in the children of this Col. Does this change affect how those components re-render when/if the serviceId changes? Was this also thoroughly tested?

@@ -427,7 +427,6 @@ export function readerTypeHack(reader: ReaderConfig): SingleLayerReaderConfig {
* Normalize the pipeline prop name and assign instance ids for tracing.
* @param config the extension configuration
* @param pipelineProp the name of the pipeline prop, currently either "action" or "body"
* @param defaults
Copy link
Collaborator

Choose a reason for hiding this comment

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

As I read more of these, I'm not sure that I agree we should be removing all the name-only @param s like this. Is there a reason to remove them? It still gives a tiny bit of a visual hint for the function inputs when looking at a function definition. I'm not sure I see the harm in keeping them?

Copy link
Collaborator

@fregante fregante Nov 28, 2022

Choose a reason for hiding this comment

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

I'm not sure I see the harm in keeping them?

I see several issues:

  • It doesn't actually add any information whatsoever
  • Having unnecessary lines slows down the reading of code, because my eyes are now on @param value while they could just be on the actual value: Value line and get Type information instead
  • It can get out of sync. Try adding @param misspelledVar anywhere and our tooling won't complain. Now the type definition mentions some non-existent misspelledVar parameter.

As for this specific line, it's the only place where other parameters have been described and this one wasn't. I suppose an argument could be made to leave this one for "consistency among the other parameters." 👍

All the other cases however mention one @param name and then nothing else:

/**
  * Return utility classes from the value
  * @param value
  */
 export function parseValue(value: Value): {

The above doesn't add value over:

/**
  * Return utility classes from the value
  */
 export function parseValue(value: Value): {

visual hint for the function inputs when looking at a function definition

The function definition already has the actual parameter a few pixels away, it doesn't need another hint.

Is there a reason to remove them?

Would you keep this spacing?

/**



  * Return utility classes from the value



  */



 export function parseValue(value: Value): {

You might argue that there's no reason to remove the spacing, it does make the code more pleasant, but we live in a society 😜

Copy link
Collaborator

@BLoe BLoe Nov 28, 2022

Choose a reason for hiding this comment

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

It doesn't actually add any information whatsoever

Sure it does, it tells you the names of the function input params without having to read any of the function code itself.

Having unnecessary lines slows down the reading of code, because my eyes are now on @param value while they could just be on the actual value: Value line and get Type information instead

Not every function just has the params right there on the next line. Some of the examples in this PR have type hints and more complicated inputs, so it can be helpful to just see the params listed at the top there. Also, I disagree that having more lines of comments slows down reading of code. This is a comment, it's not even code. And it's only a few characters of comments.

It can get out of sync. Try adding @param misspelledVar anywhere and our tooling won't complain. Now the type definition mentions some non-existent misspelledVar parameter.

No, it can't. We have a lint rule for that already.

Copy link
Collaborator

@fregante fregante Nov 28, 2022

Choose a reason for hiding this comment

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

It doesn't actually add any information whatsoever

Sure it does, it tells you the names of the function input params without having to read any of the function code itself.

But I can read the function code without having to read any comments. It goes both ways, except one line is required and the JSDoc comment is not.

Plus no information is added, but just duplicated.

We don't need to repeat the same piece of information in multiple parts of the same function. By your logic we should also describe the same variable every time it's used so we don't have to move our eyes higher: it would be useful but it's not practical and it has drawbacks.

Some of the examples in this PR have type hints and more complicated inputs

I don't see any such examples that used @param something without a description (in which case they'd be fine for me).

I disagree that having more lines of comments slows down reading of code.

I suppose I can add unnecessary comments everywhere since they don't slow down the reading of code

// The session ID
export const sessionId = uuidv4();

// The timestamp of the session
export const sessionTimestamp = new Date();

// The ID of the navigation
export let navigationId = uuidv4();

// The navigation timestamp. It stamps the time of the navigation with a timestamp.
export let navigationTimestamp = new Date();

There are useful comments and there are useless comments.

It can get out of sync. Try adding @param misspelledVar anywhere and our tooling won't complain. Now the type definition mentions some non-existent misspelledVar parameter.

No, it can't. We have a lint rule for that already.

I'm not sure why you'd claim that instead of trying my suggestion. The CI on d9b521f is green. We don't have any strict JSDoc lint rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants