41 lines
896 B
JavaScript
41 lines
896 B
JavaScript
import { globalIgnores } from "eslint/config"
|
|
import pluginNext from "@next/eslint-plugin-next"
|
|
import pluginReactHooks from "eslint-plugin-react-hooks"
|
|
import globals from "globals"
|
|
|
|
import { config as baseConfig } from "./base.js"
|
|
|
|
/**
|
|
* A custom ESLint configuration for libraries that use Next.js.
|
|
*
|
|
* @type {import("eslint").Linter.Config[]}
|
|
*/
|
|
export const nextJsConfig = [
|
|
...baseConfig,
|
|
globalIgnores([
|
|
// Default ignores of eslint-config-next:
|
|
".next/**",
|
|
"out/**",
|
|
"build/**",
|
|
"next-env.d.ts",
|
|
]),
|
|
{
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.serviceworker,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
plugins: {
|
|
"@next/next": pluginNext,
|
|
},
|
|
rules: {
|
|
...pluginNext.configs.recommended.rules,
|
|
...pluginNext.configs["core-web-vitals"].rules,
|
|
},
|
|
},
|
|
pluginReactHooks.configs.flat.recommended,
|
|
]
|