@nish1896/eslint-flat-config
v3.1.3
Published
Linting rules configured for ESLint v9 and above to catch potential errors and ensure consistent code formatting.
Maintainers
Keywords
Readme
@nish1896/eslint-flat-config
A modern, modular ESLint flat config for JavaScript, TypeScript, React, and Next.js. Built for ESLint v9+ with a focus on:
- Developer experience
- Readability
- Real-world usability
✨ Features
- ✅ ESLint v9 flat config support
- ✅ Modular (use only what you need)
- ✅ TypeScript-aware linting
- ✅ React & accessibility support
- ✅ Works seamlessly with Next.js
- ✅ Clean, consistent stylistic rules via @stylistic
This package is compatible with eslint v9 and above. For usage with eslint
8.57.1or below check @nish1896/eslint-config.
Quick Setup
Copy the code snippet most relevant to your application and paste it in the eslint.config.mjs file in your project root.
Node.js
Use the ts module only if your code is written in Typescript.
import jsConfig from '@nish1896/eslint-flat-config/js';
import tsConfig from '@nish1896/eslint-flat-config/ts';
export default [
...jsConfig,
...tsConfig
];React.js & Vite
Use the ts module only if your code is written in Typescript.
import jsConfig from '@nish1896/eslint-flat-config/js';
import tsConfig from '@nish1896/eslint-flat-config/ts';
import jsxConfig from '@nish1896/eslint-flat-config/jsx';
export default [
...jsConfig,
...tsConfig,
...jsxConfig,
];Next.js
Update the existing eslint.config.mjs file provided by Next.js app. Include the next/typescript and next-ts modules only if your code is written in Typescript.
Version 16
import { defineConfig, globalIgnores } from 'eslint/config';
import nextVitals from 'eslint-config-next/core-web-vitals';
import nextTs from 'eslint-config-next/typescript';
import jsConfig from '@nish1896/eslint-flat-config/js';
import nextConfig from '@nish1896/eslint-flat-config/next';
import nextTsConfig from '@nish1896/eslint-flat-config/next-ts';
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
...jsConfig,
...nextConfig,
...nextTsConfig,
globalIgnores([
'.next/**',
'out/**',
'build/**',
'next-env.d.ts'
])
]);
export default eslintConfig;Version 15
import jsConfig from '@nish1896/eslint-flat-config/js';
import nextConfig from '@nish1896/eslint-flat-config/next';
import nextTsConfig from '@nish1896/eslint-flat-config/next-ts';
const eslintConfig = [
...compat.extends('next/core-web-vitals', 'next/typescript'),
...jsConfig,
...nextConfig,
...nextTsConfig,
];
export default eslintConfig;⚠️ Important Notes
- Do NOT use
jsxConfigwithnextConfig - This config complements Next.js ESLint — it does not replace it
- TypeScript configs require a valid tsconfig.json
For comprehensive details on installation, setup, rules, and usage, please refer the Documentation 📖.
If you are a React developer, I highly recommend checking out my package, @nish1896/rhf-mui-components.
