tslint-no-data

1.3.1 • Public • Published

no-data

TSLint rules to prevent usage of the word "data" in variables and function names

Usage

Install: npm install --save-dev no-data

In your tslint.json:

{
  "rulesDirectory": [
    "node_modules/no-data/dist"
  ],
  "rules": {
    "no-data-in-variable": true,
    "no-data-in-class": true
  }
}

Available Rules

no-data-in-variable

The word data is not allowed when declaring variable via const let or var

no-data-in-class

The word data is not allowed in class names and class properties.

Options

  • allow-class-name: allow the word data in class names.
  • allow-class-properties: allow the word data in class properties.

Example Usage

  • This will show warning when data appear in class name or property name.
{
  "rules": {
    "no-data-in-class": true
  }
}
  • This will show warning when data appear in property name only.
{
  "rules": {
    "no-data-in-class": [true, "allow-class-name"]
  }
}

Future work

  • Disallow in function arguments.

Readme

Keywords

Package Sidebar

Install

npm i tslint-no-data

Weekly Downloads

1

Version

1.3.1

License

MIT

Unpacked Size

15.2 kB

Total Files

28

Last publish

Collaborators

  • omardev