Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dreipol/eslint-plugin-export-keys
Eslint plugin to check the object keys exported by your javascript modules
https://github.com/dreipol/eslint-plugin-export-keys
Last synced: 7 days ago
JSON representation
Eslint plugin to check the object keys exported by your javascript modules
- Host: GitHub
- URL: https://github.com/dreipol/eslint-plugin-export-keys
- Owner: dreipol
- License: mit
- Created: 2016-08-08T16:37:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-10T14:07:49.000Z (over 8 years ago)
- Last Synced: 2024-09-30T12:08:33.625Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-export-keys
[![Build Status][travis-image]][travis-url]
[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url]
[![MIT License][license-image]][license-url]Eslint plugin to check the object keys exported by your javascript modules
## Installation
```shell
npm i @dreipol/eslint-plugin-export-keys -D
```## Rules
### Order
Enabling the `export-keys/order` rule you will be able to specify the the order in which your object keys should be exported
For example:
```json
{
"plugins": [
"@dreipol/export-keys"
],
"rules": {
"export-keys/order": [1, ["template", "data", "ready"]]
}
}
```This rule will check that all your modules exporting some of all the keys defined inside the `keys` option will be exported in the order defined:
```js
export default {
template: {},
data: {},
ready: {},
}// or also valid
export default {
template: {},
ready: {},
}// this will throw
export default {
ready: {},
template: {},
}
```This rule works with `module.exports` and `exports` as well
[travis-image]:https://img.shields.io/travis/dreipol/eslint-plugin-export-keys.svg?style=flat-square
[travis-url]:https://travis-ci.org/dreipol/eslint-plugin-export-keys[license-image]:http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]:LICENSE.txt[npm-version-image]:http://img.shields.io/npm/v/@dreipol/eslint-plugin-export-keys.svg?style=flat-square
[npm-downloads-image]:http://img.shields.io/npm/dm/@dreipol/eslint-plugin-export-keys.svg?style=flat-square
[npm-url]:https://npmjs.org/package/@dreipol/eslint-plugin-export-keys