1.1.6 • Published 1 year ago

eslint-plugin-annotation v1.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago