Socket
Book a DemoInstallSign in
Socket

@ottofeller/eslint-plugin-ottofeller

Package Overview
Dependencies
Maintainers
6
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ottofeller/eslint-plugin-ottofeller

Plugin utilized in ottofeller.com projects

0.1.4
latest
Source
npmnpm
Version published
Maintainers
6
Created
Source

eslint-plugin-ottofeller

Install

npm install @ottofeller/eslint-plugin-ottofeller --save-dev

Usage

Add ottofeller to the plugins section of your eslint configuration:

{
  "plugins": [
    "@ottofeller/ottofeller"
  ]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "@ottofeller/ottofeller/rule-name-without-options": [
      "error"
    ],
    "@ottofeller/ottofeller/rule-name-with-options": [
      "error",
      {
        "option": "value"
      }
    ]
  }
}

Rules

  • ottofeller/jsx-newline-block
{
  "rules": {
    "@ottofeller/ottofeller/jsx-newline-block": ["error"]
  }
}
  • ottofeller/require-comment-before-useeffect

The rule has a single option, which is an object with require property. The latter one is an object that defines the following options:

  • CallExpression - requires a comment before useEffect(...); defaults to true.
  • MemberExpression - requires a comment before React.useEffect(...); defaults to true.
{
  "rules": {
    "@ottofeller/ottofeller/require-comment-before-useeffect": ["error", {
        "require": {
            "CallExpression": true,
            "MemberExpression": false,
        }
    }],
  }
}

All the options are enabled by default. To use defaults just keep the config object off.

{
  "rules": {
    "@ottofeller/ottofeller/require-comment-before-useeffect": ["error"],
  }
}
  • ottofeller/no-import-react

The rule forbids namespace and default imports from React. Named imports are encouraged.

{
  "rules": {
    "@ottofeller/ottofeller/no-import-react": ["error"],
  }
}
  • ottofeller/object-properties-multiline-padding

For multiline Object Expressions the rule requires:

  • empty lines before and after multiline properties;
  • no empty lines between single-line properties;
  • no empty lines at the start and at the end of the object.

NOTE: the rule does not handle comments within Object Expressions.

An autofix is available for the rule.

{
  "rules": {
    "@ottofeller/ottofeller/object-properties-multiline-padding": ["error"],
  }
}

FAQs

Package last updated on 31 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.