1.0.2 • Published 7 months ago

eslint-config-berkekaragoz-react v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Install:

  • NPM: npm i -D eslint-config-berkekaragoz-react
  • Yarn: yarn add -D eslint-config-berkekaragoz-react
  • PNPM: pnpm i -D eslint-config-berkekaragoz-react

eslint-config-berkekaragoz-react

ESLint React configuration aimed to have balanced aspects. A part of eslint-config-berkekaragoz.

Usage

extends:
  - berkekaragoz-react

VSCode Settings

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "indentRainbow.ignoreErrorLanguages": ["*"],
  "indentRainbow.colorOnWhiteSpaceOnly": true
}

Contents:

ESLint configs:

  • berkekaragoz-react
  • berkekaragoz-react/formatting

berkekaragoz-react contents:

{
  env: { browser: true, es2021: true },
  extends: [
    "plugin:react/recommended",
    "plugin:react/jsx-runtime",
    "plugin:react-hooks/recommended",
  ],
  parserOptions: {
    ecmaFeatures: { jsx: true },
    ecmaVersion: "latest",
    sourceType: "module",
  },
  settings: { react: { version: "detect" } },
  plugins: ["react"],
  rules: {
    "react/boolean-prop-naming": [
      "warn",
      { propTypeNames: ["bool", "mutuallyExclusiveTrueProps"] },
    ],
    "react/destructuring-assignment": ["warn", "always"],
    "react/forbid-dom-props": [
      "warn",
      {
        forbid: [
          {
            propName: "style",
            message: "Use the prop 'style' only for debugging.",
          },
        ],
      },
    ],
    "react/function-component-definition": [
      "warn",
      {
        namedComponents: "arrow-function",
        unnamedComponents: "arrow-function",
      },
    ],
    "react/hook-use-state": "warn",
    "react/prop-types": "off",
    "react/no-invalid-html-attribute": "error",
    "react/no-multi-comp": ["warn", { ignoreStateless: true }],
    "react/self-closing-comp": "warn",
    "react/void-dom-elements-no-children": "error",
    "react/jsx-filename-extension": [ "warn", { extensions: [".tsx", ".jsx"] }],
    "react/jsx-sort-props": [
      "warn",
      {
        callbacksLast: true,
        shorthandFirst: true,
        multiline: "last",
        reservedFirst: ["key", "ref"],
      },
    ],
  },
};

Related:

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.4

3 years ago

0.1.5

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.0

3 years ago