JSPM

eslint-plugin-annotation

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11561
  • Score
    100M100P100Q142565F
  • License MIT

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

Package Exports

  • eslint-plugin-annotation
  • eslint-plugin-annotation/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-annotation) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

eslint-plugin-annotation

NPM version Build Status

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

annotation/sort annotation/sort-keys
sort sort-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',
  }
}

Supported Rules

다음은 @format-date, @sort-keys, @sort 어노테이션을 표로 정리한 것입니다. @sort-keys@sort는 자동 수정을 지원하고, @format-date는 자동 수정을 지원하지 않음을 아이콘으로 표시했습니다.

eslint-plugin-annotation

Rule Description Autofix
format-date Ensure dates in strings match the specified @format-date annotation
sort-keys Sort interface properties or object keys if has @sort-keys annotation ✔️
sort Sort array values if has @sort annotation ✔️

License

BSD License