-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: cleanup file-progress spinner output
Closes #265 Signed-off-by: Dirk de Visser <github@dirkdevisser.nl>
- Loading branch information
Showing
2 changed files
with
41 additions
and
13 deletions.
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
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,39 @@ | ||
import type { FlatConfig } from "@typescript-eslint/utils/ts-eslint"; | ||
// @ts-expect-error no types available | ||
import pluginFileProgress from "eslint-plugin-file-progress"; | ||
import { globMarkdownSnippetFromGlob, globUse } from "./globs.js"; | ||
|
||
export function progress(): Array<FlatConfig.Config> { | ||
if (process.env.CI === "true") { | ||
return []; | ||
} | ||
|
||
return [ | ||
{ | ||
// Show a friendly spinner. | ||
files: ["**/*"], | ||
plugins: { | ||
"file-progress": pluginFileProgress as unknown as FlatConfig.Plugin, | ||
}, | ||
rules: { | ||
"file-progress/activate": "warn", | ||
}, | ||
}, | ||
|
||
{ | ||
// Don't show snippets in the progress-spinner. | ||
files: globUse([globMarkdownSnippetFromGlob("**/*")]), | ||
rules: { | ||
"file-progress/activate": "off", | ||
}, | ||
}, | ||
|
||
{ | ||
// Don't show virtual format files in the progress-spinner. | ||
files: ["**/*.*/**/*.format"], | ||
rules: { | ||
"file-progress/activate": "off", | ||
}, | ||
}, | ||
]; | ||
} |