Skip to content

Commit

Permalink
feat: enhance ignores function to accept additional patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
maggot-code committed Dec 17, 2024
1 parent 4a5cb6f commit 4de22a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/configs/ignores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import type { FlatConfigItem } from "../types";

import { GLOB_EXCLUDE } from "../globs";

export function ignores(): FlatConfigItem[] {
export function ignores(extend: string[]): FlatConfigItem[] {
return [
{
name: "uneva/ignores",
ignores: GLOB_EXCLUDE,
ignores: [...GLOB_EXCLUDE, ...extend],
},
];
}
1 change: 1 addition & 0 deletions src/globs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const GLOB_EXCLUDE = [
"**/.vitepress/cache",
"**/.nuxt",
"**/.next",
"**/.eslint*",
"**/.svelte-kit",
"**/.vercel",
"**/.changeset",
Expand Down
2 changes: 1 addition & 1 deletion src/use.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function unlint(config?:(OptionsUseConfigs & FlatConfigItem), ...group: F
const inferIsInEditor = config?.isInEditor || isInEditor;

const configs: Linter.Config[] = [
...ignores(),
...ignores(config?.ignores || []),
...jsdoc({ stylistic: inferStylistic }),
...javascript({ isInEditor: inferIsInEditor }),
];
Expand Down

0 comments on commit 4de22a7

Please sign in to comment.