Skip to content

Update#8

Merged
hildjj merged 4 commits intopeggyjs:mainfrom
hildjj:update
Mar 20, 2023
Merged

Update#8
hildjj merged 4 commits intopeggyjs:mainfrom
hildjj:update

Conversation

@hildjj
Copy link
Copy Markdown
Contributor

@hildjj hildjj commented Feb 22, 2023

Update dependencies. Update rules. This will cause a bunch of things to lint-fail in peggy, but it's time for that.

@hildjj
Copy link
Copy Markdown
Contributor Author

hildjj commented Feb 22, 2023

I'm not sure why I had a pending change to update to 3.0. It doesn't look like I released it. I'm going to leave it in, and make this PR be the bases for 3.1, hoping for the best.

@hildjj
Copy link
Copy Markdown
Contributor Author

hildjj commented Feb 22, 2023

@Mingun do you have any opinions about the things I changed? I'm sorry I didn't do the patch in two steps to make it easier to separate the moves from the changes.

index.js Outdated
"no-self-assign": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "error",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is going to cause good changes in Peggy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure... It creates a lot of strange renames (when function parameter shadows external variable) without much benefit, IMO. But I'm not strongly against it. Maybe enable shadowing for some names (node, context)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll turn it off for now. Perhaps we can enable it some other time.


// Disabled because multiple spaces are often used for alignment.
"no-multi-spaces": "off",
"no-mixed-operators": "error",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is going to cause a few sets of parens, which is worth it, imo.


// Disabled because `eval` has legitimate uses.
"no-eval": "off",
"no-eval": "error",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We'll put an eslint-ignore in the two places where we want eval explicitly.

"no-constructor-return": "error",
"no-constant-binary-expression": "error",
"no-div-regex": "off",
"no-confusing-arrow": "error",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There are a few places that are legitimately confusing. We'll fix those.

@@ -87,6 +89,7 @@ module.exports = {
"@typescript-eslint/func-call-spacing": "error",
"@typescript-eslint/indent": ["off", 2], // Broken, see https://github.com/typescript-eslint/typescript-eslint/issues/1824
"@typescript-eslint/init-declarations": "error",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is going to be a biggish change, but I think it's good for quality.

"eqeqeq": "error",
"func-name-matching": "error",
"func-names": "off", // Tedious
"func-style": ["error", "declaration"],
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This only causes one change in tests.

ignorePattern: "c8",
ignoreConsecutiveComments: true,
}],
"class-methods-use-this": "error",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Causes a few things that will have to be ignored (abstract methods) and a few places that we might want to move to static.

"no-unused-vars": "error",

// This is going to cause problems, but I don't care.
"no-use-before-define": "error",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This causes a pretty large set of changes, most of which I really like.

@Mingun
Copy link
Copy Markdown
Member

Mingun commented Feb 23, 2023

It would be easier to me see the changes if you show what changes it led to in peggy (making PR there).

@hildjj
Copy link
Copy Markdown
Contributor Author

hildjj commented Feb 23, 2023

See peggyjs/peggy#349

@hildjj
Copy link
Copy Markdown
Contributor Author

hildjj commented Feb 23, 2023

I didn't mind having to explicitly opt out when I was using practices that were questionable.

index.js Outdated
"no-self-assign": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "error",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure... It creates a lot of strange renames (when function parameter shadows external variable) without much benefit, IMO. But I'm not strongly against it. Maybe enable shadowing for some names (node, context)?

@hildjj hildjj merged commit a5af2f4 into peggyjs:main Mar 20, 2023
@hildjj hildjj deleted the update branch March 20, 2023 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants