Migration Guide
This migration guide will help you to use the flat config structure of eslint introduced from v9 onwards.
Due to eslint v9, which introduced a flat-config file, this package was created to make this repository one of the earliest eslint shareable configs to be compatible with the flat file structure.
- For eslint version 9 and above, use @nish1896/eslint-flat-config.
Migrate to eslint v9
To use eslint v9, make sure that the node version being used in your project matches the criteria below as per eslint v9 migration docs.
- Node.js v18.18.0 and above
- Node.js v20.9.0 and above
- Node.js v21 and above
Uninstall @nish1896/eslint-config.
npm uninstall @nish1896/eslint-config
yarn remove @nish1896/eslint-config
pnpm remove @nish1896/eslint-config
Install @nish1896/eslint-flat-config.
npm i --save-dev @nish1896/eslint-flat-config@1
yarn add -D @nish1896/eslint-flat-config@1 @eslint/js@9
pnpm add -D @nish1896/eslint-flat-config@1
Delete the .eslintrc or .eslintrc.js or .eslintrc.json file and create eslint.config.mjs file.
touch eslint.config.mjs
The react folder import from @nish1896/eslint-config/react has been renamed in this package and will be imported as @nish1896/eslint-flat-config/jsx.
Add the following content to this file -
import jsConfig from '@nish1896/eslint-flat-config/js';
import jsxConfig from '@nish1896/eslint-flat-config/jsx';
export default [
...jsConfig,
...jsxConfig,
{
rules: {}
}
];