Warning
This library is deprecated, as some of the dependencies being used in this library has also been deprecated. It's recommended to switch to alternatives:
Note
This config library only works for:
- Next.js v14 or earlier version
- eslint v8 or earlier
- projects with @typescript-eslint v7 or earlier
eslint-config-sznm v2.x+ only supports prettier v3 as prettier v3 is a breaking change and it applies to its related eslint plugins. If your project is using prettier v2, please install eslint-config-sznm v1.1.2 🙏
npm i --save-dev eslint eslint-config-sznm
# or (if using yarn)
yarn add -D eslint eslint-config-sznm
# or (if using pnpm)
pnpm i -D eslint eslint-config-sznm
npm i --save-dev eslint eslint-config-sznm@^1.1.2
# or (if using yarn)
yarn add -D eslint eslint-config-sznm@^1.1.2
# or (if using pnpm)
pnpm i -D eslint eslint-config-sznm@^1.1.2
add the extends to your project's eslintrc config
(.eslintrc.js
or other extensions whichever you use in your project)
make sure eslint-config-next
is installed (as devDependencies
)
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['sznm/react', 'plugin:@next/next/recommended'],
};
optional:
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: [
'sznm/react',
'plugin:react/jsx-runtime', // to switch off jsx (import React) warning
'plugin:@next/next/recommended',
],
};
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['sznm/react'],
};
❗
⚠️ [WIP] still tinkering around here, I made this config with support for Next.js and React + TypeScript as first priority in mind.
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: [
'sznm', // or 'sznm/bare'
],
};
eslint-config-sznm
extends from and uses these configurations & plugins:
eslint-config-airbnb
: airbnb's javascript styleguideeslint-config-prettier
: to turns off all rules that are unnecessary or might conflict with Prettier.eslint-plugin-prettier
: runs Prettier as an ESLint rule and reports differences as individual ESLint issues.eslint-plugin-sonarjs
: SonarJS rules for ESLint to detect bugs and suspicious patterns in your code.
feel free to give feedbacks or suggestions or start a discussion in Github discussions of the repo.