-
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(package.json, typegen.ts): add Next.js ESLint plugin and config …
…integration feat(configs): introduce Next.js and React specific ESLint rules refactor(typescript/config.ts): add no-misused-promises rule to address React Hook Form discussion chore(utils/extension.ts): import Next.js ESLint plugin with ts-expect-error for missing types feat(utils/factory.ts): add react and nextjs config imports and conditionally apply them based on package existence to support linting for React and Next.js projects
- Loading branch information
Showing
10 changed files
with
93 additions
and
0 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,22 @@ | ||
/* eslint-disable ts/no-unsafe-member-access */ | ||
/* eslint-disable ts/no-unsafe-assignment */ | ||
|
||
import type { TypedFlatConfigItem } from "#/types/type"; | ||
import { nextjsPlugin } from "#/utils/extension"; | ||
import { configName } from "#/utils/naming"; | ||
|
||
export const nextjs = (): TypedFlatConfigItem[] => { | ||
return [ | ||
{ | ||
name: configName("nextjs", "rules"), | ||
files: ["**/*.ts", "**/*.tsx"], | ||
plugins: { | ||
node: nextjsPlugin, | ||
}, | ||
rules: { | ||
...nextjsPlugin.configs.recommended.rules, | ||
...nextjsPlugin.configs["core-web-vitals"].rules, | ||
}, | ||
}, | ||
]; | ||
}; |
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 @@ | ||
export * from "./config"; |
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,22 @@ | ||
/* eslint-disable ts/no-unsafe-assignment */ | ||
|
||
import type { TypedFlatConfigItem } from "#/types/type"; | ||
import { nextjsPlugin } from "#/utils/extension"; | ||
import { configName } from "#/utils/naming"; | ||
|
||
// TODO: https://github.com/antfu/eslint-config/blob/main/src/configs/react.ts | ||
// TODO: https://github.com/we-use/eslint-config/issues/13 | ||
|
||
export const react = (): TypedFlatConfigItem[] => { | ||
return [ | ||
{ | ||
name: configName("nextjs", "rules"), | ||
files: ["**/*.ts", "**/*.tsx"], | ||
plugins: { | ||
node: nextjsPlugin, | ||
}, | ||
rules: { | ||
}, | ||
}, | ||
]; | ||
}; |
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 @@ | ||
export * from "./config"; |
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
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