@dreipol/eslint-plugin-export-keys

Specify how the object kyes should be exported

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
00Aug 10, 2016Aug 8, 2016Minified + gzip package size for @dreipol/eslint-plugin-export-keys in KB

Readme

eslint-plugin-export-keys

Build Status

NPM version NPM downloads MIT License

Eslint plugin to check the object keys exported by your javascript modules

Installation

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:

{
  "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:

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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.