Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
eslint-plugin-eslint-comments
(#163)
- Loading branch information
1 parent
87b27f1
commit 72f0ec1
Showing
16 changed files
with
318 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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,6 @@ | ||
/** | ||
* Eslint EslintComments extensions. | ||
* | ||
* @see [Eslint EslintComments extensions](https://mysticatea.github.io/eslint-plugin-eslint-comments/#%F0%9F%93%96-usage) | ||
*/ | ||
export type EslintCommentsExtensions = 'plugin:eslint-comments/recommended'; |
This file contains 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 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,34 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Option. | ||
*/ | ||
export interface DisableEnablePairOption { | ||
allowWholeFile?: boolean; | ||
} | ||
|
||
/** | ||
* Options. | ||
*/ | ||
export type DisableEnablePairOptions = [DisableEnablePairOption?]; | ||
|
||
/** | ||
* Require a `eslint-enable` comment for every `eslint-disable` comment. | ||
* | ||
* @see [disable-enable-pair](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html) | ||
*/ | ||
export type DisableEnablePairRuleConfig = RuleConfig<DisableEnablePairOptions>; | ||
|
||
/** | ||
* Require a `eslint-enable` comment for every `eslint-disable` comment. | ||
* | ||
* @see [disable-enable-pair](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html) | ||
*/ | ||
export interface DisableEnablePairRule { | ||
/** | ||
* Require a `eslint-enable` comment for every `eslint-disable` comment. | ||
* | ||
* @see [disable-enable-pair](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html) | ||
*/ | ||
'eslint-comments/disable-enable-pair': DisableEnablePairRuleConfig; | ||
} |
This file contains 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,22 @@ | ||
import type { DisableEnablePairRule } from './disable-enable-pair'; | ||
import type { NoAggregatingEnableRule } from './no-aggregating-enable'; | ||
import type { NoDuplicateDisableRule } from './no-duplicate-disable'; | ||
import type { NoRestrictedDisableRule } from './no-restricted-disable'; | ||
import type { NoUnlimitedDisableRule } from './no-unlimited-disable'; | ||
import type { NoUnusedDisableRule } from './no-unused-disable'; | ||
import type { NoUnusedEnableRule } from './no-unused-enable'; | ||
import type { NoUseRule } from './no-use'; | ||
import type { RequireDescriptionRule } from './require-description'; | ||
|
||
/** | ||
* All EslintComments rules. | ||
*/ | ||
export type EslintCommentsRules = DisableEnablePairRule & | ||
NoAggregatingEnableRule & | ||
NoDuplicateDisableRule & | ||
NoRestrictedDisableRule & | ||
NoUnlimitedDisableRule & | ||
NoUnusedDisableRule & | ||
NoUnusedEnableRule & | ||
NoUseRule & | ||
RequireDescriptionRule; |
This file contains 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,22 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Disallow a `eslint-enable` comment for multiple `eslint-disable` comments. | ||
* | ||
* @see [no-aggregating-enable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html) | ||
*/ | ||
export type NoAggregatingEnableRuleConfig = RuleConfig<[]>; | ||
|
||
/** | ||
* Disallow a `eslint-enable` comment for multiple `eslint-disable` comments. | ||
* | ||
* @see [no-aggregating-enable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html) | ||
*/ | ||
export interface NoAggregatingEnableRule { | ||
/** | ||
* Disallow a `eslint-enable` comment for multiple `eslint-disable` comments. | ||
* | ||
* @see [no-aggregating-enable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html) | ||
*/ | ||
'eslint-comments/no-aggregating-enable': NoAggregatingEnableRuleConfig; | ||
} |
This file contains 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,22 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Disallow duplicate `eslint-disable` comments. | ||
* | ||
* @see [no-duplicate-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html) | ||
*/ | ||
export type NoDuplicateDisableRuleConfig = RuleConfig<[]>; | ||
|
||
/** | ||
* Disallow duplicate `eslint-disable` comments. | ||
* | ||
* @see [no-duplicate-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html) | ||
*/ | ||
export interface NoDuplicateDisableRule { | ||
/** | ||
* Disallow duplicate `eslint-disable` comments. | ||
* | ||
* @see [no-duplicate-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html) | ||
*/ | ||
'eslint-comments/no-duplicate-disable': NoDuplicateDisableRuleConfig; | ||
} |
This file contains 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,33 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Option. | ||
*/ | ||
export type NoRestrictedDisableOption = string[]; | ||
|
||
/** | ||
* Options. | ||
*/ | ||
export type NoRestrictedDisableOptions = NoRestrictedDisableOption; | ||
|
||
/** | ||
* Disallow `eslint-disable` comments about specific rules. | ||
* | ||
* @see [no-restricted-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html) | ||
*/ | ||
export type NoRestrictedDisableRuleConfig = | ||
RuleConfig<NoRestrictedDisableOptions>; | ||
|
||
/** | ||
* Disallow `eslint-disable` comments about specific rules. | ||
* | ||
* @see [no-restricted-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html) | ||
*/ | ||
export interface NoRestrictedDisableRule { | ||
/** | ||
* Disallow `eslint-disable` comments about specific rules. | ||
* | ||
* @see [no-restricted-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html) | ||
*/ | ||
'eslint-comments/no-restricted-disable': NoRestrictedDisableRuleConfig; | ||
} |
This file contains 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,22 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Disallow `eslint-disable` comments without rule names. | ||
* | ||
* @see [no-unlimited-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html) | ||
*/ | ||
export type NoUnlimitedDisableRuleConfig = RuleConfig<[]>; | ||
|
||
/** | ||
* Disallow `eslint-disable` comments without rule names. | ||
* | ||
* @see [no-unlimited-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html) | ||
*/ | ||
export interface NoUnlimitedDisableRule { | ||
/** | ||
* Disallow `eslint-disable` comments without rule names. | ||
* | ||
* @see [no-unlimited-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html) | ||
*/ | ||
'eslint-comments/no-unlimited-disable': NoUnlimitedDisableRuleConfig; | ||
} |
This file contains 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,22 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Disallow unused `eslint-disable` comments. | ||
* | ||
* @see [no-unused-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html) | ||
*/ | ||
export type NoUnusedDisableRuleConfig = RuleConfig<[]>; | ||
|
||
/** | ||
* Disallow unused `eslint-disable` comments. | ||
* | ||
* @see [no-unused-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html) | ||
*/ | ||
export interface NoUnusedDisableRule { | ||
/** | ||
* Disallow unused `eslint-disable` comments. | ||
* | ||
* @see [no-unused-disable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html) | ||
*/ | ||
'eslint-comments/no-unused-disable': NoUnusedDisableRuleConfig; | ||
} |
This file contains 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,22 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Disallow unused `eslint-enable` comments. | ||
* | ||
* @see [no-unused-enable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html) | ||
*/ | ||
export type NoUnusedEnableRuleConfig = RuleConfig<[]>; | ||
|
||
/** | ||
* Disallow unused `eslint-enable` comments. | ||
* | ||
* @see [no-unused-enable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html) | ||
*/ | ||
export interface NoUnusedEnableRule { | ||
/** | ||
* Disallow unused `eslint-enable` comments. | ||
* | ||
* @see [no-unused-enable](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html) | ||
*/ | ||
'eslint-comments/no-unused-enable': NoUnusedEnableRuleConfig; | ||
} |
This file contains 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 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Option. | ||
*/ | ||
export interface NoUseOption { | ||
allow?: ( | ||
| 'eslint' | ||
| 'eslint-disable' | ||
| 'eslint-disable-line' | ||
| 'eslint-disable-next-line' | ||
| 'eslint-enable' | ||
| 'eslint-env' | ||
| 'exported' | ||
| 'global' | ||
| 'globals' | ||
)[]; | ||
} | ||
|
||
/** | ||
* Options. | ||
*/ | ||
export type NoUseOptions = [NoUseOption?]; | ||
|
||
/** | ||
* Disallow ESLint directive-comments. | ||
* | ||
* @see [no-use](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-use.html) | ||
*/ | ||
export type NoUseRuleConfig = RuleConfig<NoUseOptions>; | ||
|
||
/** | ||
* Disallow ESLint directive-comments. | ||
* | ||
* @see [no-use](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-use.html) | ||
*/ | ||
export interface NoUseRule { | ||
/** | ||
* Disallow ESLint directive-comments. | ||
* | ||
* @see [no-use](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-use.html) | ||
*/ | ||
'eslint-comments/no-use': NoUseRuleConfig; | ||
} |
This file contains 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,45 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Option. | ||
*/ | ||
export interface RequireDescriptionOption { | ||
ignore?: ( | ||
| 'eslint' | ||
| 'eslint-disable' | ||
| 'eslint-disable-line' | ||
| 'eslint-disable-next-line' | ||
| 'eslint-enable' | ||
| 'eslint-env' | ||
| 'exported' | ||
| 'global' | ||
| 'globals' | ||
)[]; | ||
} | ||
|
||
/** | ||
* Options. | ||
*/ | ||
export type RequireDescriptionOptions = [RequireDescriptionOption?]; | ||
|
||
/** | ||
* Require include descriptions in ESLint directive-comments. | ||
* | ||
* @see [require-description](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/require-description.html) | ||
*/ | ||
export type RequireDescriptionRuleConfig = | ||
RuleConfig<RequireDescriptionOptions>; | ||
|
||
/** | ||
* Require include descriptions in ESLint directive-comments. | ||
* | ||
* @see [require-description](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/require-description.html) | ||
*/ | ||
export interface RequireDescriptionRule { | ||
/** | ||
* Require include descriptions in ESLint directive-comments. | ||
* | ||
* @see [require-description](https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/require-description.html) | ||
*/ | ||
'eslint-comments/require-description': RequireDescriptionRuleConfig; | ||
} |
Oops, something went wrong.