tslint-object-literal-smart-keys

Rule for tslint

Usage no npm install needed!

<script type="module">
  import tslintObjectLiteralSmartKeys from 'https://cdn.skypack.dev/tslint-object-literal-smart-keys';
</script>

README

object-literal-smart-keys

TSLint rule for ordering object literal keys like in corresponding type of interface.

See tests for info about provided checkings.

Install

npm i -D tslint-object-literal-smart-keys

Example tslint.json

{
    "rulesDirectory": [
        "./node_modules/tslint-object-literal-smart-keys/rules"
    ],
    "rules" {
        "object-literal-sort-keys": false, // don't forget disable it!
        "object-literal-smart-keys": true
    }
}

Roadmap

  • Complicated cases