Skip to content

Commit

Permalink
feat: ✨ add the ability to extends ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-guzman committed Oct 31, 2024
1 parent 52a6f4b commit 161293a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ export default jimmyDotCodes(
);
```

You can also extend what is ignored:

```ts
import jimmyDotCodes from "@jimmy.codes/eslint-config";

export default jimmyDotCodes({
ignores: ["**/*.mjs"],
});
```

## ❤️ Credits

- [@antfu/eslint-config](https://github.com/antfu/eslint-config) by [Anthony Fu](https://antfu.me)
Expand Down
4 changes: 3 additions & 1 deletion src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const jimmyDotCodes = (
astro = false,
autoDetect = true,
configs = [],
ignores = [],
}: Options = {},
...moreConfigs: TypedConfigItem[] | Linter.Config[]
) => {
Expand All @@ -47,7 +48,8 @@ export const jimmyDotCodes = (
{ name: "jimmy.codes/disabled", ...eslintConfigPrettier },
...commonjsConfig(),
{
ignores: GLOB_IGNORES,
name: "jimmy.codes/ignores",
ignores: [...GLOB_IGNORES, ...ignores],
},
...configs,
...moreConfigs,
Expand Down
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,9 @@ export interface Options {
* @default true
*/
autoDetect?: boolean;
/**
* Glob patterns for files that should be ignored
* @see [Ignoring files](https://eslint.org/docs/latest/use/configure/ignore)
*/
ignores?: string[];
}

0 comments on commit 161293a

Please sign in to comment.