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 id-length ESLint rule #1422

Merged
merged 1 commit into from
Oct 22, 2020
Merged

Add id-length ESLint rule #1422

merged 1 commit into from
Oct 22, 2020

Conversation

ehmicky
Copy link
Contributor

@ehmicky ehmicky commented Oct 16, 2020

This adds the id-length ESLint rule.
See also netlify/build#1982

Single-letter variable names makes reading code less clear.

@ehmicky ehmicky added the type: chore work needed to keep the product and development running smoothly label Oct 16, 2020
@ehmicky ehmicky requested a review from erezrokah October 16, 2020 14:25
@ehmicky ehmicky requested a review from a team as a code owner October 16, 2020 14:25
@ehmicky ehmicky self-assigned this Oct 16, 2020
Copy link
Contributor

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

This is huge @ehmicky thanks.
Added a few comments

@@ -92,7 +92,7 @@ async function startFrameworkServer({ settings, log, exit }) {
return ps
}

const getAddonsUrlsAndAddEnvVariablesToProcessEnv = async ({ api, site, flags }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This name is intentionally long since the function does multiple things (which it shouldn't).
I'm going to refactor it soon, probably as a part of #1331

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@@ -16,7 +16,7 @@ exports.handler = async function (event) {
},
user_metadata: {
...user.user_metadata, // append current user metadata
custom_data_from_function: 'hurray this is some extra metadata',
custom_data_from_func: 'hurray this is some extra metadata',
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point 👍

@ehmicky
Copy link
Contributor Author

ehmicky commented Oct 20, 2020

Answered this in the PR for Netlify Build, let's solve this first: netlify/build#1982 (comment)

@ehmicky ehmicky force-pushed the chore/lint-id-length branch from 57ae7a5 to d4c2970 Compare October 21, 2020 12:51
@ehmicky
Copy link
Contributor Author

ehmicky commented Oct 21, 2020

Thanks @erezrokah!
I have removed the max constraint.
I also removed all the changes in this PR related to long variable names, so this PR is a little smaller.

@ehmicky ehmicky requested a review from erezrokah October 21, 2020 12:52
@ehmicky ehmicky force-pushed the chore/lint-id-length branch from d4c2970 to 7af8987 Compare October 22, 2020 10:57
@ehmicky ehmicky requested review from erezrokah and removed request for erezrokah October 22, 2020 11:08
@ehmicky
Copy link
Contributor Author

ehmicky commented Oct 22, 2020

Rebased. Does this look good @erezrokah ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants