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
Bug: [lines-around-comment] afterHashbangComment option is not supported #6636
Comments
I can confirm this issue. According to the eslint changelog, the And if we look at the latest https://github.com/typescript-eslint source: typescript-eslint/packages/eslint-plugin/src/rules/lines-around-comment.ts Lines 54 to 136 in a1a20b3
We can see that the afterHashbangComment is not yet supported (not yet added to @typescript-eslint/lines-around-comment schema).
On a side note, I just noticed by reading the source, apparently there's more options for the
Is these options meant to be supported? |
Yup, ESLint core added an
Good spot, I'll send a PR to fix up those docs now. Thanks! |
@JoshuaKGoldberg I'd like to fix this, however this requires Context: |
Hmm I actually don't know what to do in this situation. @bradzacher? |
Given the rule is an extension rule and not a fork - really the schema for the rule should be based off of the base rule's schema and we just add our additional options to the schema. That way we aren't allowing options that aren't supported in the base implementation. |
Sorry, I am unsure what this means in the
|
Correct. Currently the schema is hard-coded: typescript-eslint/packages/eslint-plugin/src/rules/lines-around-comment.ts Lines 54 to 136 in aa537e5
Instead of it being hard-coded it should be described in relation to the base rule's schema so that it exposes the same options the base rule does. |
Okay, I will try to fix this 🙌🏻 |
Hi there 👋! As you may have heard ESLint core is deprecating its formatting rules. We are likewise moving in the same direction and deprecating our formatting rules. Deprecated rules will be removed in the next major version as their new home is the eslint-stylistic project. If this issue is important to you please consider filling an issue over at eslint-stylistic which will be the new home for stylistic/formatting rules. Thanks! |
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.0.1-rc&sourceType=module&code=MQQgZg9hBQBuCGAnABAE3gT2QXmQIgHNEBTeAFz2iA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6RplWgQ2gHtYTACa0yfALbjELdGADa4bDkTR+0SABpFSrEuyRuAM3wqAEt2QALAEbcmAcwDCEqTIz44ibdgC+3gLqKfj5AA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA
Repro Code
ESLint Config
tsconfig
Expected Result
Should not crash, should warn about missing blank line after hashbang comment
Actual Result
Configuration for rule "@typescript-eslint/lines-around-comment" is invalid:
Value {"afterHashbangComment":true,"beforeBlockComment":true,"afterBlockComment":false,"beforeLineComment":false,"afterLineComment":false,"allowBlockStart":false,"allowBlockEnd":false} should NOT have additional properties.
Additional Info
The playground example doesn't crash, but CLI crashes.
The text was updated successfully, but these errors were encountered: