eslint-plugin-lintr
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Lintr Linting Rules

This library contains miscellaneous ESLint linting rules.

if-no-string-literal

Type: problem

Prevents short upper-case string literals being used as values in if statement tests (enumerations or consts are preferred).

Invalid Code

const buySell = 'S';

if (buySell === 'S') {
  createSellTrade();
}

Valid Code

enum BuySell {
  Sell = 'S'
};

const buySell = BuySell.Sell;

if (buySell === BuySell.Sell) {
  createSellTrade();
}

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i eslint-plugin-lintr

    Weekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    12.4 kB

    Total Files

    15

    Last publish

    Collaborators

    • iancharlesdouglas