Skip to content

Commit

Permalink
allowing to change next settings
Browse files Browse the repository at this point in the history
  • Loading branch information
zemd committed Jan 25, 2025
1 parent 0801a0d commit 166b054
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-wasps-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zemd/eslint-next": patch
---

allowing to change next settings
12 changes: 12 additions & 0 deletions packages/next/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@ import rock from "@zemd/eslint-rock-stack";

export * from "@zemd/eslint-rock-stack";

type NextSettings = {
rootDir?: string[];
[key: string]: unknown;
};

type NextOptions = {
enableRefresh: boolean;
files: string[];
nextSettings: NextSettings;
};

export function next({
enableRefresh = false,
files = [GLOB_SRC_ALL],
nextSettings = {},
}: Partial<NextOptions> = {}): Array<Linter.Config> {
return [
{
Expand All @@ -32,6 +39,11 @@ export function next({
plugins: {
"@next/next": nextjs,
},
settings: {
next: {
...nextSettings,
},
},
rules: {
...nextjs.configs.recommended.rules,
...nextjs.configs["core-web-vitals"].rules,
Expand Down

0 comments on commit 166b054

Please sign in to comment.