Skip to content

Commit

Permalink
feat(experimental-utils): add suggestion property for rule modules (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed May 17, 2020
1 parent c66f97c commit f42a5b0
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 0 deletions.
Expand Up @@ -39,6 +39,7 @@ export default createRule({
"Enforces rules don't use TS API properties with known bad type definitions",
category: 'Possible Errors',
recommended: 'error',
suggestion: true,
requiresTypeChecking: true,
},
fixable: 'code',
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/rules/no-empty-interface.ts
Expand Up @@ -19,6 +19,7 @@ export default util.createRule<Options, MessageIds>({
description: 'Disallow the declaration of empty interfaces',
category: 'Best Practices',
recommended: 'error',
suggestion: true,
},
fixable: 'code',
messages: {
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/rules/no-explicit-any.ts
Expand Up @@ -21,6 +21,7 @@ export default util.createRule<Options, MessageIds>({
description: 'Disallow usage of the `any` type',
category: 'Best Practices',
recommended: 'warn',
suggestion: true,
},
fixable: 'code',
messages: {
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/rules/no-floating-promises.ts
Expand Up @@ -24,6 +24,7 @@ export default util.createRule<Options, MessageId>({
description: 'Requires Promise-like values to be handled appropriately',
category: 'Best Practices',
recommended: false,
suggestion: true,
requiresTypeChecking: true,
},
messages: {
Expand Down
Expand Up @@ -12,6 +12,7 @@ export default util.createRule<[], MessageIds>({
'Disallows using a non-null assertion after an optional chain expression',
category: 'Possible Errors',
recommended: false,
suggestion: true,
},
messages: {
noNonNullOptionalChain:
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/rules/no-non-null-assertion.ts
Expand Up @@ -15,6 +15,7 @@ export default util.createRule<[], MessageIds>({
'Disallows non-null assertions using the `!` postfix operator',
category: 'Stylistic Issues',
recommended: 'warn',
suggestion: true,
},
messages: {
noNonNull: 'Forbidden non-null assertion.',
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/rules/prefer-as-const.ts
Expand Up @@ -13,6 +13,7 @@ export default util.createRule({
description: 'Prefer usage of `as const` over literal type',
category: 'Best Practices',
recommended: false,
suggestion: true,
},
fixable: 'code',
messages: {
Expand Down
Expand Up @@ -24,6 +24,7 @@ export default util.createRule<Options, MessageIds>({
'Enforce the usage of the nullish coalescing operator instead of logical chaining',
category: 'Best Practices',
recommended: false,
suggestion: true,
requiresTypeChecking: true,
},
fixable: 'code',
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/rules/prefer-optional-chain.ts
Expand Up @@ -48,6 +48,7 @@ export default util.createRule<Options, MessageIds>({
'Prefer using concise optional chain expressions instead of chained logical ands',
category: 'Best Practices',
recommended: false,
suggestion: true,
},
fixable: 'code',
messages: {
Expand Down
Expand Up @@ -17,6 +17,7 @@ export default createRule({
description: 'Exhaustiveness checking in switch with union type',
category: 'Best Practices',
recommended: false,
suggestion: true,
requiresTypeChecking: true,
},
schema: [],
Expand Down
4 changes: 4 additions & 0 deletions packages/experimental-utils/src/ts-eslint/Rule.ts
Expand Up @@ -28,6 +28,10 @@ interface RuleMetaDataDocs {
* The URL of the rule's docs
*/
url: string;
/**
* Specifies whether the rule can return suggestions.
*/
suggestion?: boolean;
/**
* Does the rule require us to create a full TypeScript Program in order for it
* to type-check code. This is only used for documentation purposes.
Expand Down

0 comments on commit f42a5b0

Please sign in to comment.