UNPKG

@shayanthenerd/eslint-config

Version:

A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style

21 lines (20 loc) 783 B
import { globs } from "../helpers/globs.mjs"; import { isEnabled } from "../utils/isEnabled.mjs"; import { defaultOptions } from "../helpers/options/defaultOptions.mjs"; import { getNextRules } from "../rules/next.mjs"; import { mergeConfigs } from "eslint-flat-config-utils"; import eslintPluginNext from "@next/eslint-plugin-next"; //#region src/configs/next.ts function getNextConfig(options) { const { packageDir, configs: { next } } = options; const { overrides } = isEnabled(next) ? next : defaultOptions.configs.next; return mergeConfigs({ name: "shayanthenerd/next", files: [globs.src, globs.jsxTsx], plugins: { next: eslintPluginNext }, settings: { next: { rootDir: packageDir } }, rules: getNextRules() }, overrides); } //#endregion export { getNextConfig };