eslint-config-sznm

2.0.3 • Public • Published


npm npm

Verified on Openbase Rate this package

⚠️ Pre-Requisites

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 🙏

🔧 Installation

If your project uses prettier v3

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

If your project uses prettier v2

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

💻 Usage

add the extends to your project's eslintrc config (.eslintrc.js or other extensions whichever you use in your project)

⚡ Next.js Projects

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',
  ],
};

⚛️ React Projects

/** @type {import('eslint').Linter.Config} */
module.exports = {
  extends: ['sznm/react'],
};

🟨 Non React Projects

⚠️ [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'
  ],
};

🐣 Rules

eslint-config-sznm extends from and uses these configurations & plugins:

  • eslint-config-airbnb: airbnb's javascript styleguide
  • eslint-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.

📣 Suggestions

feel free to give feedbacks or suggestions or start a discussion in Github discussions of the repo.

Package Sidebar

Install

npm i eslint-config-sznm

Weekly Downloads

987

Version

2.0.3

License

MIT

Unpacked Size

11.9 kB

Total Files

18

Last publish

Collaborators

  • sozonome