Skip to content

Update lint rules to match @peggyjs/eslint-config@3.1.0. #349

Merged
hildjj merged 3 commits intopeggyjs:mainfrom
hildjj:update-lint
Mar 21, 2023
Merged

Update lint rules to match @peggyjs/eslint-config@3.1.0. #349
hildjj merged 3 commits intopeggyjs:mainfrom
hildjj:update-lint

Conversation

@hildjj
Copy link
Copy Markdown
Contributor

@hildjj hildjj commented Feb 23, 2023

Still need to update package.json and package-lock.json once that version is shipped.

@hildjj hildjj force-pushed the update-lint branch 2 times, most recently from db2d723 to 99ed7e6 Compare February 25, 2023 00:25
Mingun
Mingun previously approved these changes Feb 26, 2023
Copy link
Copy Markdown
Member

@Mingun Mingun left a comment

Choose a reason for hiding this comment

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

Generally approve, although no-shadow, in my mind, are not so useful.

@hildjj
Copy link
Copy Markdown
Contributor Author

hildjj commented Mar 20, 2023

I really like no-shadow, but I'll turn it off for now.

return "/^["
+ (cls.inverted ? "^" : "")
+ cls.value.map(part => Array.isArray(part)
+ cls.value.map(part => (Array.isArray(part)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd rather disable the eslint rule instead. IMO this code was completely fine.

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 actually like that it's clearer now.

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.

Ironically, I put the parens in the WRONG PLACE the first time. :)

expect(parser).to.parse("42*43+44*45+46*47+48*49", 42 * 43 + 44 * 45 + 46 * 47 + 48 * 49);
expect(parser).to.parse("42*43-44*45", 42 * 43 - 44 * 45);
expect(parser).to.parse("42*43-44*45-46*47-48*49", 42 * 43 - 44 * 45 - 46 * 47 - 48 * 49);
expect(parser).to.parse("42*43+44*45", (42 * 43) + (44 * 45));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So even basic arithmetic priorities should be highlighted with parens? :)

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.

Yep. I actually agree with this.

@hildjj
Copy link
Copy Markdown
Contributor Author

hildjj commented Mar 20, 2023

note that I messed something up and the tests don't pass. Fixing that now.

@hildjj hildjj requested a review from Mingun March 20, 2023 23:00
Mingun
Mingun previously approved these changes Mar 21, 2023
@hildjj hildjj merged commit 4b69b0d into peggyjs:main Mar 21, 2023
@hildjj hildjj deleted the update-lint branch March 21, 2023 17:52
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.

3 participants