From 5b7902840ba4c7db75beebdadfd09d72ddfbbb53 Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Thu, 7 Apr 2022 14:42:52 +0900 Subject: [PATCH 01/35] feat: update repository --- packages/eslint-plugin/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index d54b733b40f1..393f954e43aa 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -5,7 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) - + ### Bug Fixes * **eslint-plugin:** method-signature-style respect getter signature ([#4777](https://github.com/typescript-eslint/typescript-eslint/issues/4777)) ([12dd670](https://github.com/typescript-eslint/typescript-eslint/commit/12dd670bc8621867c5105d8892dba9f9550a2f35)) From 5c3af4da8a09e0ec15fa3a1b2da916fbd150327a Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Thu, 7 Apr 2022 15:52:42 +0900 Subject: [PATCH 02/35] remove duplicate examples --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 9145d83d29f6..93aff33469ea 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -70,8 +70,6 @@ export type { ButtonProps } from 'some-library'; ### ✅ Correct ```ts -export { Button } from 'some-library'; -export type { ButtonProps } from 'some-library'; export { Button, type ButtonProps } from 'some-library'; ``` From f5674a821275254ea49b44157a6fc3db58d27b76 Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Thu, 7 Apr 2022 15:59:23 +0900 Subject: [PATCH 03/35] feat:add about re-exporting --isolatedModules in When Not To Use It --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 93aff33469ea..1e5749139a5c 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -77,6 +77,7 @@ export { Button, type ButtonProps } from 'some-library'; - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule. +- Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'. ## Attributes From d47eeb4624c5eaed708c54678fe0c7db600f4d9f Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Fri, 8 Apr 2022 13:57:34 +0900 Subject: [PATCH 04/35] feat: add exmaples --- .../docs/rules/consistent-type-exports.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 1e5749139a5c..45aa7d77ae09 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -13,6 +13,21 @@ This rule aims to standardize the use of type exports style across a codebase. Given a class `Button`, and an interface `ButtonProps`, examples of code: + +```ts + export interface ButtonProps{ + onClick: () => void; + } + + class Button implements ButtonProps { + onClick(){ + concole.log('button!') + } + + } + +``` + ## Options ```ts @@ -70,6 +85,8 @@ export type { ButtonProps } from 'some-library'; ### ✅ Correct ```ts +export { Button } from 'some-library'; +export type { ButtonProps } from 'some-library'; export { Button, type ButtonProps } from 'some-library'; ``` @@ -77,7 +94,7 @@ export { Button, type ButtonProps } from 'some-library'; - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule. -- Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'. +- If you use --isolatedModules, you don't need this rule since TS would enforce type-export specifiers ## Attributes From 6f74fea7094ab9e9e0188ba77c8ac71904cea67c Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Fri, 8 Apr 2022 13:59:09 +0900 Subject: [PATCH 05/35] fix: remove duplicate examples in correct --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 45aa7d77ae09..bf849b925867 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -85,8 +85,6 @@ export type { ButtonProps } from 'some-library'; ### ✅ Correct ```ts -export { Button } from 'some-library'; -export type { ButtonProps } from 'some-library'; export { Button, type ButtonProps } from 'some-library'; ``` From 7fb6dc76c765b331de4901ea8bfae2baf0c7d0d7 Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Fri, 8 Apr 2022 14:00:51 +0900 Subject: [PATCH 06/35] fix:correct words --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index bf849b925867..8e27582f7b4c 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -92,7 +92,7 @@ export { Button, type ButtonProps } from 'some-library'; - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule. -- If you use --isolatedModules, you don't need this rule since TS would enforce type-export specifiers +- If you use --isolatedModules, you don't need this rule since TS would enforce type-export specifiers. ## Attributes From e77ae67fe5dc81bf8874dff9d648f045cc5ff2f1 Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Fri, 8 Apr 2022 14:12:39 +0900 Subject: [PATCH 07/35] fix: fix space-between --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 8e27582f7b4c..5f58398ded11 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -25,7 +25,6 @@ Given a class `Button`, and an interface `ButtonProps`, examples of code: } } - ``` ## Options From 2572fd67c33d8c79156fc1a5370acced9544b382 Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Fri, 8 Apr 2022 14:16:38 +0900 Subject: [PATCH 08/35] fix: fix code --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 5f58398ded11..55b7c4d2e061 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -16,7 +16,7 @@ Given a class `Button`, and an interface `ButtonProps`, examples of code: ```ts export interface ButtonProps{ - onClick: () => void; + onClick() } class Button implements ButtonProps { From 40f496fae87f1fe2f8de5971ed3c94aafe9497fc Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Fri, 8 Apr 2022 14:17:42 +0900 Subject: [PATCH 09/35] fix: fix code space --- .../docs/rules/consistent-type-exports.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 55b7c4d2e061..699d6b3e8787 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -15,16 +15,16 @@ Given a class `Button`, and an interface `ButtonProps`, examples of code: ```ts - export interface ButtonProps{ - onClick() - } - - class Button implements ButtonProps { - onClick(){ - concole.log('button!') - } +export interface ButtonProps{ + onClick() +} +class Button implements ButtonProps { + onClick(){ + concole.log('button!') } + +} ``` ## Options From b5081382608a0158f1f71439faaf27d56a192757 Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Fri, 8 Apr 2022 14:25:53 +0900 Subject: [PATCH 10/35] fix: check error --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 699d6b3e8787..cdea4494e35d 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -23,7 +23,6 @@ class Button implements ButtonProps { onClick(){ concole.log('button!') } - } ``` From 70dc242f91e4de14db131b9f31915442d18f6286 Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Fri, 8 Apr 2022 14:27:00 +0900 Subject: [PATCH 11/35] fix:missed examples --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index cdea4494e35d..3f95e6a3576b 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -16,12 +16,12 @@ Given a class `Button`, and an interface `ButtonProps`, examples of code: ```ts export interface ButtonProps{ - onClick() + onClick: () => void; } class Button implements ButtonProps { onClick(){ - concole.log('button!') + console.log('button!') } } ``` From c895ad852c66003b141c25996405242cd1e1a435 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Fri, 8 Apr 2022 20:50:21 +0900 Subject: [PATCH 12/35] feat: read review and fix them fix examples and --Isolatedmodules explain --- .../docs/rules/consistent-type-exports.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 3f95e6a3576b..439d799099ab 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -13,17 +13,20 @@ This rule aims to standardize the use of type exports style across a codebase. Given a class `Button`, and an interface `ButtonProps`, examples of code: - ```ts -export interface ButtonProps{ +interface ButtonProps { onClick: () => void; } - class Button implements ButtonProps { - onClick(){ - console.log('button!') + onClick() { + console.log('button!'); } } +export { Button }; +export type { ButtonProps }; + +//invalid example +export { Button, ButtonProps }; ``` ## Options @@ -90,7 +93,7 @@ export { Button, type ButtonProps } from 'some-library'; - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule. -- If you use --isolatedModules, you don't need this rule since TS would enforce type-export specifiers. +- If you use `--isolatedModules`, you don't need this rule since the compiler would error if a type is not re-exported using `export type`. ## Attributes From 6158e57d0b438d86a8be02baf2b1982e527d53e5 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Fri, 8 Apr 2022 21:24:17 +0900 Subject: [PATCH 13/35] feat: add two taps one is correct, another is incorrect --- .../docs/rules/consistent-type-exports.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 439d799099ab..30600be4fdd8 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -13,6 +13,22 @@ This rule aims to standardize the use of type exports style across a codebase. Given a class `Button`, and an interface `ButtonProps`, examples of code: +### ❌ Incorrect + +```ts +interface ButtonProps { + onClick: () => void; +} +class Button implements ButtonProps { + onClick() { + console.log('button!'); + } +} +export { Button, ButtonProps }; +``` + +### ✅ Correct + ```ts interface ButtonProps { onClick: () => void; @@ -24,9 +40,6 @@ class Button implements ButtonProps { } export { Button }; export type { ButtonProps }; - -//invalid example -export { Button, ButtonProps }; ``` ## Options From c4a25fd57cfb0a8ca721bc9198205f56e08ead30 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Sat, 9 Apr 2022 00:40:54 +0900 Subject: [PATCH 14/35] fix: add --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 30600be4fdd8..3fcf2a514f09 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -13,6 +13,8 @@ This rule aims to standardize the use of type exports style across a codebase. Given a class `Button`, and an interface `ButtonProps`, examples of code: + + ### ❌ Incorrect ```ts From cc71beae3523b611eb4db861b1bc7300b3470e11 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Sat, 9 Apr 2022 01:40:12 +0900 Subject: [PATCH 15/35] feat: fix explaination about `isolatedmodules` --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 3fcf2a514f09..5cc6baf52c83 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -108,7 +108,7 @@ export { Button, type ButtonProps } from 'some-library'; - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule. -- If you use `--isolatedModules`, you don't need this rule since the compiler would error if a type is not re-exported using `export type`. +- If you use `--isolatedModules`, you don't need this rule since the compiler would error if a type is not re-exported using `export type`. If you also don't wish to enforce one style over the other, you can disable this rule. ## Attributes From 251f49e10c98fd084734b47560e86347c5c2b4fc Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Sat, 9 Apr 2022 01:42:03 +0900 Subject: [PATCH 16/35] fix: fix explain about `isolatedModules` --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 5cc6baf52c83..50a6fea96da9 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -108,7 +108,7 @@ export { Button, type ButtonProps } from 'some-library'; - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule. -- If you use `--isolatedModules`, you don't need this rule since the compiler would error if a type is not re-exported using `export type`. If you also don't wish to enforce one style over the other, you can disable this rule. +- If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. If you also don't wish to enforce one style over the other, you can disable this rule. ## Attributes From d42a546182cd0cc62f4c304fef9d27674236c378 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Sat, 9 Apr 2022 15:07:01 +0900 Subject: [PATCH 17/35] fis: modify When no to use it --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 50a6fea96da9..894cbe0482c7 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -108,7 +108,8 @@ export { Button, type ButtonProps } from 'some-library'; - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule. -- If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. If you also don't wish to enforce one style over the other, you can disable this rule. +- If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. +- If you also don't wish to enforce one style over the other, you can disable this rule. ## Attributes From f1c3ce499535c9bb28eed011b6440b9707799281 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Sat, 9 Apr 2022 15:12:27 +0900 Subject: [PATCH 18/35] fix: revert change log --- packages/eslint-plugin/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 393f954e43aa..d54b733b40f1 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -5,7 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) - + ### Bug Fixes * **eslint-plugin:** method-signature-style respect getter signature ([#4777](https://github.com/typescript-eslint/typescript-eslint/issues/4777)) ([12dd670](https://github.com/typescript-eslint/typescript-eslint/commit/12dd670bc8621867c5105d8892dba9f9550a2f35)) From 4246b6b490f1c98bea948d34db07ec32992f4a81 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Sat, 9 Apr 2022 15:25:17 +0900 Subject: [PATCH 19/35] fix: add lint --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 894cbe0482c7..84f85892ef63 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -103,7 +103,6 @@ export type { ButtonProps } from 'some-library'; ```ts export { Button, type ButtonProps } from 'some-library'; ``` - ## When Not To Use It - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. From c1af45ca2dbaa6ac96a09d0e3b5eaccaaaac0a4f Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Sun, 10 Apr 2022 20:35:42 +0900 Subject: [PATCH 20/35] fix: add lint --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 84f85892ef63..894cbe0482c7 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -103,6 +103,7 @@ export type { ButtonProps } from 'some-library'; ```ts export { Button, type ButtonProps } from 'some-library'; ``` + ## When Not To Use It - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. From 42d89587b6908021a33f9c5f1d4994aa71752b6b Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Sun, 10 Apr 2022 20:41:01 +0900 Subject: [PATCH 21/35] add: fix code --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 894cbe0482c7..1d02bf9febc2 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -11,8 +11,10 @@ transpilers to drop exports without knowing the types of the dependencies. This rule aims to standardize the use of type exports style across a codebase. + Given a class `Button`, and an interface `ButtonProps`, examples of code: + ### ❌ Incorrect @@ -50,7 +52,6 @@ export type { ButtonProps }; interface Options { fixMixedExportsWithInlineTypeSpecifier?: boolean; } - const defaultOptions: Options = { fixMixedExportsWithInlineTypeSpecifier: false, }; From efd3668f419410dcc23460d2e58434d181482b62 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Sun, 10 Apr 2022 20:46:38 +0900 Subject: [PATCH 22/35] fix:fix docs splits --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 1d02bf9febc2..894cbe0482c7 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -11,10 +11,8 @@ transpilers to drop exports without knowing the types of the dependencies. This rule aims to standardize the use of type exports style across a codebase. - Given a class `Button`, and an interface `ButtonProps`, examples of code: - ### ❌ Incorrect @@ -52,6 +50,7 @@ export type { ButtonProps }; interface Options { fixMixedExportsWithInlineTypeSpecifier?: boolean; } + const defaultOptions: Options = { fixMixedExportsWithInlineTypeSpecifier: false, }; From 8b4f9de84b72ff3ed543fc7988cf90cedd0685f6 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Sun, 10 Apr 2022 20:50:02 +0900 Subject: [PATCH 23/35] feat: add lint --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 894cbe0482c7..97fa837b44c5 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -108,7 +108,7 @@ export { Button, type ButtonProps } from 'some-library'; - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule. -- If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. +- If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. - If you also don't wish to enforce one style over the other, you can disable this rule. ## Attributes From 24c0f2e21912c08dc87d513c03c7d8c6a8280ac6 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 10 Apr 2022 16:29:33 -0400 Subject: [PATCH 24/35] Update packages/eslint-plugin/docs/rules/consistent-type-exports.md --- packages/eslint-plugin/docs/rules/consistent-type-exports.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 97fa837b44c5..50a6fea96da9 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -108,8 +108,7 @@ export { Button, type ButtonProps } from 'some-library'; - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule. -- If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. -- If you also don't wish to enforce one style over the other, you can disable this rule. +- If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. If you also don't wish to enforce one style over the other, you can disable this rule. ## Attributes From bcccb43defdcb7a10bb675912dd15c92f547468e Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Thu, 30 Jun 2022 17:32:29 +0900 Subject: [PATCH 25/35] feat:change error message better --- packages/eslint-plugin/src/rules/no-invalid-void-type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index a6e798217cae..aad021bc097b 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -25,7 +25,7 @@ export default util.createRule<[Options], MessageIds>({ invalidVoidForGeneric: '{{ generic }} may not have void as a type variable.', invalidVoidNotReturnOrGeneric: - 'void is only valid as a return type or generic type variable.', + 'void is valid as a return type in the case of a union or intersection type and generic type variable', invalidVoidNotReturn: 'void is only valid as a return type.', invalidVoidNotReturnOrThisParam: 'void is only valid as return type or type of `this` parameter.', From 8154c5cb52f1a28c3d16225909543c51af0c9ae0 Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Thu, 30 Jun 2022 23:21:44 +0900 Subject: [PATCH 26/35] fix:separating message and made types about union --- packages/eslint-plugin/src/rules/no-invalid-void-type.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index aad021bc097b..c48f3f7df273 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -11,7 +11,8 @@ type MessageIds = | 'invalidVoidNotReturnOrGeneric' | 'invalidVoidNotReturn' | 'invalidVoidNotReturnOrThisParam' - | 'invalidVoidNotReturnOrThisParamOrGeneric'; + | 'invalidVoidNotReturnOrThisParamOrGeneric' + | 'InvalidVoidForUnion'; export default util.createRule<[Options], MessageIds>({ name: 'no-invalid-void-type', @@ -25,12 +26,14 @@ export default util.createRule<[Options], MessageIds>({ invalidVoidForGeneric: '{{ generic }} may not have void as a type variable.', invalidVoidNotReturnOrGeneric: - 'void is valid as a return type in the case of a union or intersection type and generic type variable', + 'void is only valid as a return type or generic type variable.', invalidVoidNotReturn: 'void is only valid as a return type.', invalidVoidNotReturnOrThisParam: 'void is only valid as return type or type of `this` parameter.', invalidVoidNotReturnOrThisParamOrGeneric: 'void is only valid as a return type or generic type variable or the type of a `this` parameter.', + InvalidVoidForUnion: + 'void is void is valid as a return type in the case of a union or intersection type', }, schema: [ { From aeb5cadb7b2b8d907aa67231f26494e2c1dda073 Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Thu, 30 Jun 2022 23:26:30 +0900 Subject: [PATCH 27/35] fix: separate error message --- packages/eslint-plugin/src/rules/no-invalid-void-type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index c48f3f7df273..59b5708aeb77 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -33,7 +33,7 @@ export default util.createRule<[Options], MessageIds>({ invalidVoidNotReturnOrThisParamOrGeneric: 'void is only valid as a return type or generic type variable or the type of a `this` parameter.', InvalidVoidForUnion: - 'void is void is valid as a return type in the case of a union or intersection type', + 'void is void is valid as a return type in the case of a union', }, schema: [ { From 3c531e8e85b41cd2d1302d51fa5d60b7ffc484cd Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Thu, 30 Jun 2022 23:32:52 +0900 Subject: [PATCH 28/35] fix:fix mistake type --- packages/eslint-plugin/src/rules/no-invalid-void-type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index 59b5708aeb77..caeea13e43b0 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -33,7 +33,7 @@ export default util.createRule<[Options], MessageIds>({ invalidVoidNotReturnOrThisParamOrGeneric: 'void is only valid as a return type or generic type variable or the type of a `this` parameter.', InvalidVoidForUnion: - 'void is void is valid as a return type in the case of a union', + 'void is valid as a return type in the case of a union', }, schema: [ { From af8ceded5e0a2cae0b429db61563f2d7433af9df Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Thu, 30 Jun 2022 23:37:27 +0900 Subject: [PATCH 29/35] fix:fix typo --- packages/eslint-plugin/src/rules/no-invalid-void-type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index caeea13e43b0..0424b50143e2 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -33,7 +33,7 @@ export default util.createRule<[Options], MessageIds>({ invalidVoidNotReturnOrThisParamOrGeneric: 'void is only valid as a return type or generic type variable or the type of a `this` parameter.', InvalidVoidForUnion: - 'void is valid as a return type in the case of a union', + 'void is only valid as a return type in the case of a union', }, schema: [ { From f7627e7eca84643eaad1d99b804fac040522a576 Mon Sep 17 00:00:00 2001 From: kmin-jeong Date: Sat, 2 Jul 2022 20:30:31 +0900 Subject: [PATCH 30/35] fix:fix error message in case of union --- packages/eslint-plugin/src/rules/no-invalid-void-type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index 0424b50143e2..26f1afe7e3ee 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -33,7 +33,7 @@ export default util.createRule<[Options], MessageIds>({ invalidVoidNotReturnOrThisParamOrGeneric: 'void is only valid as a return type or generic type variable or the type of a `this` parameter.', InvalidVoidForUnion: - 'void is only valid as a return type in the case of a union', + 'Void is valid when any types used together only as part of a union type.', }, schema: [ { From 3ae90bf263f28ed884e08454a05bb9316fdfeb15 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Mon, 25 Jul 2022 01:17:42 +0900 Subject: [PATCH 31/35] fix:fix error message in InvalidVoidForUnion --- packages/eslint-plugin/src/rules/no-invalid-void-type.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index 26f1afe7e3ee..dbbbab782f0f 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -4,6 +4,7 @@ import * as util from '../util'; interface Options { allowInGenericTypeArguments?: boolean | string[]; allowAsThisParameter?: boolean; + allowUnionType?: boolean | string[]; } type MessageIds = @@ -33,7 +34,7 @@ export default util.createRule<[Options], MessageIds>({ invalidVoidNotReturnOrThisParamOrGeneric: 'void is only valid as a return type or generic type variable or the type of a `this` parameter.', InvalidVoidForUnion: - 'Void is valid when any types used together only as part of a union type.', + 'void is not valid as a type constituent in a return type.', }, schema: [ { From 369f44724cfbd410b1af057d4f34a96e689176bc Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Thu, 18 Aug 2022 16:34:39 +0900 Subject: [PATCH 32/35] fix: add logic about union --- .../src/rules/no-invalid-void-type.ts | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index dbbbab782f0f..8b1fb42494fb 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -4,7 +4,8 @@ import * as util from '../util'; interface Options { allowInGenericTypeArguments?: boolean | string[]; allowAsThisParameter?: boolean; - allowUnionType?: boolean | string[]; + allowUnionType?: boolean; + invalidUnionParameter?: boolean | string[]; } type MessageIds = @@ -53,15 +54,33 @@ export default util.createRule<[Options], MessageIds>({ allowAsThisParameter: { type: 'boolean', }, + invalidUnionParameter: { + oneOf: [ + { type: 'boolean' }, + { + type: 'array', + items: { type: 'string' }, + minLength: 1, + }, + ], + }, + allowUnionType: { + type: 'boolean', + }, }, additionalProperties: false, }, ], }, defaultOptions: [ - { allowInGenericTypeArguments: true, allowAsThisParameter: false }, + { + allowInGenericTypeArguments: true, + allowAsThisParameter: false, + invalidUnionParameter: true, + allowUnionType:true, + }, ], - create(context, [{ allowInGenericTypeArguments, allowAsThisParameter }]) { + create(context, [{ allowInGenericTypeArguments, allowAsThisParameter, invalidUnionParameter,allowUnionType }]) { const validParents: AST_NODE_TYPES[] = [ AST_NODE_TYPES.TSTypeAnnotation, // ]; @@ -127,6 +146,15 @@ export default util.createRule<[Options], MessageIds>({ node, }); } + + if (!invalidUnionParameter) { + context.report({ + messageId: invalidUnionParameter + ? 'InvalidVoidForUnion' + : 'InvalidVoidForUnion', + node, + }); + } } /** @@ -192,7 +220,7 @@ export default util.createRule<[Options], MessageIds>({ context.report({ messageId: - allowInGenericTypeArguments && allowAsThisParameter + allowInGenericTypeArguments && allowAsThisParameter && allowUnionType ? 'invalidVoidNotReturnOrThisParamOrGeneric' : allowInGenericTypeArguments ? 'invalidVoidNotReturnOrGeneric' From 1a9d56d697bba65e01b5e72cea37caca69aed9e8 Mon Sep 17 00:00:00 2001 From: kmin-jeong <53456037+kmin-jeong@users.noreply.github.com> Date: Thu, 18 Aug 2022 16:38:30 +0900 Subject: [PATCH 33/35] feat: add test case --- .../tests/rules/no-invalid-void-type.test.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts b/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts index 0141da093b50..9fa6ade609b0 100644 --- a/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts +++ b/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts @@ -98,6 +98,28 @@ function foo(): void | never { ], }); +ruleTester.run('invalidUnionParameter:true', rule, { + valid: [ + { + code: 'type allowUnion = string | number', + options: [{ allowUnionType: true }], + }, + ], + invalid: [ + { + code: 'type invalidVoidUnion = void | number;', + options: [{ invalidUnionParameter: false }], + errors: [ + { + messageId: 'InvalidVoidForUnion', + line: 1, + column: 25, + }, + ], + }, + ], +}); + ruleTester.run('allowInGenericTypeArguments: true', rule, { valid: [ 'function func(): void {}', From ad238bc7af11e1de1d51c119160a711d4bf8f9ad Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 27 Oct 2022 11:10:16 -0400 Subject: [PATCH 34/35] Switched change to just enhance error message --- .../src/rules/no-invalid-void-type.ts | 59 ++++++------------- .../tests/rules/no-invalid-void-type.test.ts | 48 ++++++++------- 2 files changed, 42 insertions(+), 65 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index cd29fb45571e..3cf68dcd410a 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -6,8 +6,6 @@ import * as util from '../util'; interface Options { allowInGenericTypeArguments?: boolean | string[]; allowAsThisParameter?: boolean; - allowUnionType?: boolean; - invalidUnionParameter?: boolean | string[]; } type MessageIds = @@ -16,7 +14,7 @@ type MessageIds = | 'invalidVoidNotReturn' | 'invalidVoidNotReturnOrThisParam' | 'invalidVoidNotReturnOrThisParamOrGeneric' - | 'InvalidVoidForUnion'; + | 'invalidVoidUnionConstituent'; export default util.createRule<[Options], MessageIds>({ name: 'no-invalid-void-type', @@ -28,16 +26,16 @@ export default util.createRule<[Options], MessageIds>({ }, messages: { invalidVoidForGeneric: - '{{ generic }} may not have void as a type variable.', + '{{ generic }} may not have void as a type argument.', invalidVoidNotReturnOrGeneric: - 'void is only valid as a return type or generic type variable.', + 'void is only valid as a return type or generic type argument.', invalidVoidNotReturn: 'void is only valid as a return type.', invalidVoidNotReturnOrThisParam: 'void is only valid as return type or type of `this` parameter.', invalidVoidNotReturnOrThisParamOrGeneric: - 'void is only valid as a return type or generic type variable or the type of a `this` parameter.', - InvalidVoidForUnion: - 'void is not valid as a type constituent in a return type.', + 'void is only valid as a return type or generic type argument or the type of a `this` parameter.', + invalidVoidUnionConstituent: + 'void is not valid as a constituent in a union type', }, schema: [ { @@ -56,33 +54,15 @@ export default util.createRule<[Options], MessageIds>({ allowAsThisParameter: { type: 'boolean', }, - invalidUnionParameter: { - oneOf: [ - { type: 'boolean' }, - { - type: 'array', - items: { type: 'string' }, - minLength: 1, - }, - ], - }, - allowUnionType: { - type: 'boolean', - }, }, additionalProperties: false, }, ], }, defaultOptions: [ - { - allowInGenericTypeArguments: true, - allowAsThisParameter: false, - invalidUnionParameter: true, - allowUnionType:true, - }, + { allowInGenericTypeArguments: true, allowAsThisParameter: false }, ], - create(context, [{ allowInGenericTypeArguments, allowAsThisParameter, invalidUnionParameter,allowUnionType }]) { + create(context, [{ allowInGenericTypeArguments, allowAsThisParameter }]) { const validParents: AST_NODE_TYPES[] = [ AST_NODE_TYPES.TSTypeAnnotation, // ]; @@ -148,15 +128,6 @@ export default util.createRule<[Options], MessageIds>({ node, }); } - - if (!invalidUnionParameter) { - context.report({ - messageId: invalidUnionParameter - ? 'InvalidVoidForUnion' - : 'InvalidVoidForUnion', - node, - }); - } } /** @@ -168,7 +139,7 @@ export default util.createRule<[Options], MessageIds>({ ): void { if (parentNode.default !== node) { context.report({ - messageId: 'invalidVoidNotReturnOrGeneric', + messageId: getNotReturnOrGenericMessageId(node), // 'invalidVoidNotReturnOrGeneric', node, }); } @@ -247,10 +218,10 @@ export default util.createRule<[Options], MessageIds>({ context.report({ messageId: - allowInGenericTypeArguments && allowAsThisParameter && allowUnionType + allowInGenericTypeArguments && allowAsThisParameter ? 'invalidVoidNotReturnOrThisParamOrGeneric' : allowInGenericTypeArguments - ? 'invalidVoidNotReturnOrGeneric' + ? getNotReturnOrGenericMessageId(node) : allowAsThisParameter ? 'invalidVoidNotReturnOrThisParam' : 'invalidVoidNotReturn', @@ -260,3 +231,11 @@ export default util.createRule<[Options], MessageIds>({ }; }, }); + +function getNotReturnOrGenericMessageId( + node: TSESTree.TSVoidKeyword, +): MessageIds { + return node.parent!.type === AST_NODE_TYPES.TSUnionType + ? 'invalidVoidUnionConstituent' + : 'invalidVoidNotReturnOrGeneric'; +} diff --git a/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts b/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts index e941da626134..1a972b665be5 100644 --- a/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts +++ b/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts @@ -98,28 +98,6 @@ function foo(): void | never { ], }); -ruleTester.run('invalidUnionParameter:true', rule, { - valid: [ - { - code: 'type allowUnion = string | number', - options: [{ allowUnionType: true }], - }, - ], - invalid: [ - { - code: 'type invalidVoidUnion = void | number;', - options: [{ invalidUnionParameter: false }], - errors: [ - { - messageId: 'InvalidVoidForUnion', - line: 1, - column: 25, - }, - ], - }, - ], -}); - ruleTester.run('allowInGenericTypeArguments: true', rule, { valid: [ 'function func(): void {}', @@ -338,7 +316,7 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { code: 'type UnionType2 = string | number | void;', errors: [ { - messageId: 'invalidVoidNotReturnOrGeneric', + messageId: 'invalidVoidUnionConstituent', line: 1, column: 37, }, @@ -348,12 +326,32 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { code: 'type UnionType3 = string | ((number & any) | (string | void));', errors: [ { - messageId: 'invalidVoidNotReturnOrGeneric', + messageId: 'invalidVoidUnionConstituent', line: 1, column: 56, }, ], }, + { + code: 'declare function test(): number | void;', + errors: [ + { + messageId: 'invalidVoidUnionConstituent', + line: 1, + column: 35, + }, + ], + }, + { + code: 'declare function test(): T;', + errors: [ + { + messageId: 'invalidVoidUnionConstituent', + line: 1, + column: 42, + }, + ], + }, { code: 'type IntersectionType = string & number & void;', errors: [ @@ -416,7 +414,7 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { code: 'type invalidVoidUnion = void | Map;', errors: [ { - messageId: 'invalidVoidNotReturnOrGeneric', + messageId: 'invalidVoidUnionConstituent', line: 1, column: 25, }, From 20d46de30788f25629efe088947edc04241b6675 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 27 Oct 2022 11:10:56 -0400 Subject: [PATCH 35/35] oops comment --- packages/eslint-plugin/src/rules/no-invalid-void-type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index 3cf68dcd410a..9f938ac438f7 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -139,7 +139,7 @@ export default util.createRule<[Options], MessageIds>({ ): void { if (parentNode.default !== node) { context.report({ - messageId: getNotReturnOrGenericMessageId(node), // 'invalidVoidNotReturnOrGeneric', + messageId: getNotReturnOrGenericMessageId(node), node, }); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy