forked from stkb/Rewrap
-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Ignore ESLint directive comments in JavaScript and TypeScript #34
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
Merged
+84
−2
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
04f51c9
Ignore `eslint-disable-next-line` + `eslint-disable-line` line comments
karlhorky c2dc3d9
Ignore only the line disables
karlhorky 38659ff
Fix indentation
karlhorky 81edd6a
Switch to single compilation of regex
karlhorky 3a50118
fix(Parsers): redundant // in js regex
dnut f7800d5
fix(Parsing.Documents): eslint only applied to special comments /// a…
dnut c82b6dd
Add tests
karlhorky 22cc3ea
Ignore eslint-disable and eslint-enable in JS/TS block comments
karlhorky b0083ba
Simplify legibility of regex
karlhorky 4f911ca
Fix ESLint directive spec columns
karlhorky 4c111b9
Merge branch 'master' of github.com:dnut/Rewrap into ignore-eslint-co…
karlhorky 485d28a
Detect ESLint directives after comment text
karlhorky c47291b
fix: eslint tests, and move to own file for content type
dnut File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # ESLint Directives | ||
|
|
||
| JavaScript and TypeScript ESLint directives must remain on a single line to preserve their | ||
| effect, so Rewrap does not wrap them. | ||
|
|
||
|
|
||
| ## Line Comments | ||
|
|
||
| > language: javascript | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-base-to-string -- ModuleSource returns -> // eslint-disable-next-line @typescript-eslint/no-base-to-string -- ModuleSource returns | ||
| nextLoad(url).source ¦ nextLoad(url).source ¦ | ||
|
|
||
| > language: typescript | ||
|
|
||
| // eslint-disable-line @typescript-eslint/no-base-to-string -- ModuleSource returns -> // eslint-disable-line @typescript-eslint/no-base-to-string -- ModuleSource returns | ||
| nextLoad(url).source ¦ nextLoad(url).source ¦ | ||
|
|
||
| // eslint-disable no-console, @typescript-eslint/no-base-to-string -- temporary exception -> // eslint-disable no-console, @typescript-eslint/no-base-to-string -- temporary exception | ||
| nextLoad(url).source ¦ nextLoad(url).source ¦ | ||
|
|
||
| // eslint-enable no-console, @typescript-eslint/no-base-to-string -- restore lint checks -> // eslint-enable no-console, @typescript-eslint/no-base-to-string -- restore lint checks | ||
| nextLoad(url).source ¦ nextLoad(url).source ¦ | ||
|
|
||
| // Some comment text ¦ -> // Some comment text ¦ | ||
| // eslint-disable-next-line @typescript-eslint/no-base-to-string -- more comment text // eslint-disable-next-line @typescript-eslint/no-base-to-string -- more comment text | ||
| nextLoad(url).source ¦ nextLoad(url).source ¦ | ||
|
|
||
|
|
||
| ## Block Comments | ||
|
|
||
| > language: javascript | ||
|
|
||
| /* eslint-disable no-console, @typescript-eslint/no-base-to-string -- temporary exception */ -> /* eslint-disable no-console, @typescript-eslint/no-base-to-string -- temporary exception */ | ||
| nextLoad(url).source ¦ nextLoad(url).source ¦ | ||
|
|
||
| /* eslint-enable no-console, @typescript-eslint/no-base-to-string -- restore lint checks */ -> /* eslint-enable no-console, @typescript-eslint/no-base-to-string -- restore lint checks */ | ||
| nextLoad(url).source ¦ nextLoad(url).source ¦ | ||
|
|
||
| /* ¦ -> /* ¦ | ||
| * Some comment text ¦ * Some comment text ¦ | ||
| * eslint-disable no-console -- more comment text * eslint-disable no-console -- more comment text | ||
| */ ¦ */ ¦ | ||
| nextLoad(url).source ¦ nextLoad(url).source ¦ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.