Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-perfectionist

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-perfectionist

ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.

  • 4.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
391K
increased by14%
Maintainers
1
Weekly downloads
 
Created

What is eslint-plugin-perfectionist?

eslint-plugin-perfectionist is an ESLint plugin designed to enforce consistent code style and formatting rules. It helps developers maintain a clean and organized codebase by providing rules for sorting and organizing various code elements such as imports, properties, and more.

What are eslint-plugin-perfectionist's main functionalities?

Sort Imports

This rule enforces a specific order for import statements. In this example, the order is set to 'builtin', 'external', and 'internal' imports.

module.exports = {
  "rules": {
    "perfectionist/sort-imports": ["error", {
      "order": ["builtin", "external", "internal"]
    }]
  }
};

Sort Object Properties

This rule enforces sorting of object properties in ascending order. The 'caseSensitive' option ensures that the sorting is case-sensitive.

module.exports = {
  "rules": {
    "perfectionist/sort-keys": ["error", "asc", {
      "caseSensitive": true,
      "natural": false
    }]
  }
};

Sort Class Members

This rule enforces a specific order for class members. In this example, the order is set to 'field', 'constructor', and 'method'.

module.exports = {
  "rules": {
    "perfectionist/sort-class-members": ["error", {
      "order": ["field", "constructor", "method"]
    }]
  }
};

Other packages similar to eslint-plugin-perfectionist

Keywords

FAQs

Package last updated on 25 Nov 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc