eslint-plugin-undocumented-env

1.0.0 • Public • Published

eslint-plugin-undocumented-env

eslint plugin to detect use of undocumented environment variables

This looks for usage of process.env.VARIABLE_NAME in your code, and checks that the environment variable is mentioned in your README file.

Usage

Add undocumented-env to the plugins section of your ESLint configuration file. You can omit the eslint-plugin- prefix:

plugins:
  - undocumented-env

Then configure the plugin under the rules section.

rules:
  - undocumented-env/no-undocumented: error

Options

By default undocumented-env will look for references to environment variables in the first README.md file it finds while traversing up the file tree.

To use a filename for documentation other than README.md then specify it as a readme option in your eslint config:

rules:
  - undocumented-env/no-undocumented:
    - error
    - readme: configuration.md

Caveats

This plugin will only detect variables accessed directly via process.env.VARIABLE. It will not detect any dynamic or programmatic references to process.env.

This plugin won't detect bad documentation, only completely absent documentation. You should still document your code.

Readme

Keywords

Package Sidebar

Install

npm i eslint-plugin-undocumented-env

Weekly Downloads

65

Version

1.0.0

License

MIT

Unpacked Size

4.29 kB

Total Files

5

Last publish

Collaborators

  • lennym