From aa037f621eb6a4e295a48a3268b62e0093b2d796 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Tue, 4 Oct 2022 15:12:21 -0400 Subject: [PATCH 1/3] fix(types): remove unused type import This type import was added in https://github.com/stylelint/stylelint/pull/6356, but during code review that PR was refactored to obviate the `file-entry-cache` types in the public API. The import was never removed. Keeping the import here results in [compilation errors](https://app.circleci.com/pipelines/github/palantir/blueprint/3156/workflows/9eda97ec-3a2f-4aa6-aa6c-89d5b65b8491/jobs/61694) for downstream consumers: ``` ../../node_modules/stylelint/types/stylelint/index.d.ts:5:39 - error TS7016: Could not find a declaration file for module 'file-entry-cache'. '/home/circleci/project/node_modules/file-entry-cache/cache.js' implicitly has an 'any' type. Try `npm i --save-dev @types/file-entry-cache` if it exists or add a new declaration (.d.ts) file containing `declare module 'file-entry-cache';` 5 import type * as fileEntryCache from 'file-entry-cache' ``` @jeddy3 @kimulaco --- types/stylelint/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/stylelint/index.d.ts b/types/stylelint/index.d.ts index 940ab88106..1a12c44f81 100644 --- a/types/stylelint/index.d.ts +++ b/types/stylelint/index.d.ts @@ -2,7 +2,6 @@ declare module 'stylelint' { import type * as PostCSS from 'postcss'; import type { GlobbyOptions } from 'globby'; import type { cosmiconfig } from 'cosmiconfig'; - import type * as fileEntryCache from 'file-entry-cache'; namespace stylelint { export type Severity = 'warning' | 'error'; From e222ff1e9f8cb32a02453bdb886f4d5e57443e00 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Tue, 4 Oct 2022 15:19:41 -0400 Subject: [PATCH 2/3] Create fix-unused-type-import.md --- .changeset/fix-unused-type-import.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix-unused-type-import.md diff --git a/.changeset/fix-unused-type-import.md b/.changeset/fix-unused-type-import.md new file mode 100644 index 0000000000..c9e2d4f763 --- /dev/null +++ b/.changeset/fix-unused-type-import.md @@ -0,0 +1,5 @@ +--- +"stylelint": patch +--- + +Fixed: remove unused type import in `index.d.ts` to avoid TS compilation error for plugin authors From 24ffdd9b2661576ac3b1ef787d7537a8b45f1e25 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Tue, 4 Oct 2022 23:40:45 -0400 Subject: [PATCH 3/3] Update .changeset/fix-unused-type-import.md Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> --- .changeset/fix-unused-type-import.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/fix-unused-type-import.md b/.changeset/fix-unused-type-import.md index c9e2d4f763..385955e386 100644 --- a/.changeset/fix-unused-type-import.md +++ b/.changeset/fix-unused-type-import.md @@ -2,4 +2,4 @@ "stylelint": patch --- -Fixed: remove unused type import in `index.d.ts` to avoid TS compilation error for plugin authors +Fixed: TS compilation error due to needless `file-entry-cache` import