Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(eslint-plugin): [lines-around-comment] add extension rule#5327

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JoshuaKGoldberg merged 24 commits intotypescript-eslint:mainfromchbdetta:main
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
24 commits
Select commitHold shift + click to select a range
b3b6319
replicate eslint rule and add base test case
chbdettaJun 30, 2022
62efad9
port the eslint lines-around-comment
chbdettaJul 9, 2022
c2433b4
check for comment in interface and allow options
chbdettaJul 9, 2022
d97237e
check for comment in type literals and allow options
chbdettaJul 9, 2022
e9df0ec
add lines-around-comment in index
chbdettaJul 9, 2022
14db2f7
add lines-around-comment in all config
chbdettaJul 9, 2022
7f2661f
add lines-around-comment doc
chbdettaJul 9, 2022
30825c6
delegate non-TS check to the base rule
chbdettaSep 25, 2022
b153dba
Merge branch 'main' into main
chbdettaSep 25, 2022
793d2e7
fix lint errors
chbdettaSep 25, 2022
3b74231
fix doc lint errors
chbdettaSep 25, 2022
b367c61
address comments
chbdettaSep 25, 2022
b763e3a
address jsdoc comments
chbdettaSep 25, 2022
59541ed
proper comment language
chbdettaSep 25, 2022
f92776d
Update packages/eslint-plugin/src/rules/lines-around-comment.ts
chbdettaOct 9, 2022
01371be
remove irrevalant lines and improve test cov
chbdettaOct 10, 2022
7a39437
skip more cases
chbdettaOct 10, 2022
567420a
add enum and module tests
chbdettaOct 10, 2022
9cf58f2
implement enum and module
chbdettaOct 10, 2022
88584c6
improve coverage
chbdettaOct 10, 2022
ade17f3
Merge branch 'main' of github.com:chbdetta/typescript-eslint into main
chbdettaOct 10, 2022
b6b475a
remove ESilnt base rule test casese
chbdettaJan 24, 2023
f32e927
improve coverage
chbdettaJan 24, 2023
75bf6ea
Merge branch 'main' into main
JoshuaKGoldbergJan 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletionspackages/eslint-plugin/docs/rules/lines-around-comment.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
---
description: 'Require empty lines around comments.'
---

> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/lines-around-comment** for documentation.

## Rule Details

This rule extends the base [`eslint/lines-around-comment`](https://eslint.org/docs/rules/lines-around-comment) rule.
It adds support for TypeScript syntax.

See the [ESLint documentation](https://eslint.org/docs/rules/lines-around-comment) for more details on the `comma-dangle` rule.

## Rule Changes

```jsonc
{
// note you must disable the base rule as it can report incorrect errors
"lines-around-comment": "off",
"@typescript-eslint/lines-around-comment": ["error"]
}
```

In addition to the options supported by the `lines-around-comment` rule in ESLint core, the rule adds the following options:

## Options

- `allowInterfaceStart: true` doesn't require a blank line after the interface body block start
- `allowInterfaceEnd: true` doesn't require a blank line before the interface body block end
- `allowTypeStart: true` doesn't require a blank line after the type literal block start
- `allowTypeEnd: true` doesn't require a blank line after the type literal block end

[See the other options allowed](https://eslint.org/docs/rules/comma-dangle#options)

<sup>

Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/lines-around-comment.md)

</sup>
2 changes: 2 additions & 0 deletionspackages/eslint-plugin/src/configs/all.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,6 +41,8 @@ export = {
'@typescript-eslint/key-spacing': 'error',
'keyword-spacing': 'off',
'@typescript-eslint/keyword-spacing': 'error',
'lines-around-comment': 'off',
'@typescript-eslint/lines-around-comment': 'error',
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': 'error',
'@typescript-eslint/member-delimiter-style': 'error',
Expand Down
2 changes: 2 additions & 0 deletionspackages/eslint-plugin/src/rules/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,7 @@ import indent from './indent';
import initDeclarations from './init-declarations';
import keySpacing from './key-spacing';
import keywordSpacing from './keyword-spacing';
import linesAroundComment from './lines-around-comment';
import linesBetweenClassMembers from './lines-between-class-members';
import memberDelimiterStyle from './member-delimiter-style';
import memberOrdering from './member-ordering';
Expand DownExpand Up@@ -156,6 +157,7 @@ export default {
'init-declarations': initDeclarations,
'key-spacing': keySpacing,
'keyword-spacing': keywordSpacing,
'lines-around-comment': linesAroundComment,
'lines-between-class-members': linesBetweenClassMembers,
'member-delimiter-style': memberDelimiterStyle,
'member-ordering': memberOrdering,
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp