Shared ESLint flat config for Next.js + TypeScript projects.
pnpm add -D @tkodev/config-eslint-next eslint typescriptThis config expects next to already be installed in the consuming project.
If using GitHub Packages, add this to your project .npmrc:
@tkodev:registry=https://npm.pkg.github.comCreate eslint.config.mjs in your project:
import tkodevEslintConfig from '@tkodev/config-eslint-next'
import { defineConfig } from 'eslint/config'
export default defineConfig([
...tkodevEslintConfig,
// your project-specific rules/config entries here
])Or use the helper:
import { withTkodevConfig } from '@tkodev/config-eslint-next'
export default withTkodevConfig([
// your project-specific rules/config entries here
])- Ensure
package.jsonname is@tkodev/config-eslint-next. - Create a GitHub token with
write:packagesandread:packages. - Authenticate npm/pnpm for GitHub Packages:
echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> ~/.npmrc- Publish:
pnpm publish --access restricted --no-git-checks