eslint-plugin-supernext
v0.1.0
Published
ESLint plugin for Next.js projects with shadcn/ui, layered architecture, and security best practices
Maintainers
Readme
eslint-plugin-supernext
ESLint plugin for Next.js projects with shadcn/ui, layered architecture, and security best practices.
Installation
npm install --save-dev eslint-plugin-supernextUsage
ESLint Flat Config (ESLint 9+)
// eslint.config.js
import supernext from "eslint-plugin-supernext";
export default [
{
plugins: {
supernext,
},
rules: {
"supernext/ui/prefer-shadcn-components": "warn",
"supernext/arch/no-cross-layer-imports": ["error", {
rootDir: "src",
layers: ["shared", "entities", "features", "app"]
}],
"supernext/next/no-server-import-in-client": "error",
"supernext/security/ban-http-link": ["error", {
allowLocalhost: true
}]
}
}
];Rules
ui/prefer-shadcn-components
Encourages using shadcn/ui components instead of styling basic HTML elements directly.
Options:
targets: Array of HTML tag names to check (default:["button", "input"])preferredComponents: Object mapping tag names to recommended component names
arch/no-cross-layer-imports
Prevents lower layers from importing higher layers in a layered architecture.
Options:
rootDir: Root directory name (default:"src")layers: Array of layer names from lowest to highest (default:["shared", "entities", "features", "app"])aliasPrefix: Import alias prefix (default:"@")
next/no-server-import-in-client
Prevents server-only modules from being imported in client components.
Options:
serverPatterns: Array of import path prefixes to ban (default:["@/server/", "@/lib/server/", "server-only"])bannedNextModules: Array of Next.js modules to ban (default:["next/headers", "next/server", "next/cache"])
security/ban-http-link
Bans HTTP links in code, enforcing HTTPS only.
Options:
allowLocalhost: Whether to allow localhost URLs (default:true)
License
MIT
