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

eslint-plugin-annotation

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-annotation

Lint rules to validate and auto-correct annotation-based policies

  • 1.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1K
decreased by-34.09%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-annotation

NPM version Build Status

An ESLint plugin that collects rules to exceptionally validate and autocorrect code with annotations in comments.

annotation/sortannotation/sort-keys
sortsort-keys

Installation

You’ll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-annotation:

npm i eslint-plugin-annotation --save-dev

Usage

Here’s a suggested ESLint configuration that:

{
  "parserOptions": { ... }, // Nothing changed
  "plugins": [..., "annotation"], // Add 'annotation' next to old plugins
  "rules": {
    ...
    // Add below rules next to old rules 
    'annotation/format-date': 'error',
    'annotation/sort-keys': 'error',
    'annotation/sort': 'error',
    'annotation/unique': 'error',
  }
}

Supported Rules

RuleDescriptionAutofix
format-dateEnsure dates in strings match the specified @format-date annotation
sort-keysSort interface properties or object keys if has @sort-keys annotation✔️
sortSort array values if has @sort annotation✔️
uniqueEnsure array values are unique if annotated with @unique✔️

License

BSD License

Keywords

FAQs

Package last updated on 30 May 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