Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 522 Bytes

no-hardcoded-password.md

File metadata and controls

23 lines (16 loc) · 522 Bytes

Prohibits using hardcoded passwords.

Passwords should be passed via configuraion mechanism to provide multi-environment support.

Rule Details

The following pattern is considered a warning:

const password = 'DEFAULT_PASSWORD';

const variable = {
    password                : 'DEFAULT_PASSWORD',
    'password'              : 'DEFAULT_PASSWORD',
    [`${variable}password`] : 'DEFAULT_PASSWORD'         
};

The following pattern is not considered a warning:

const password = config.password;