1.0.23 • Published 4 years ago

tslint-config-silind v1.0.23

Weekly downloads
20
License
MIT
Repository
github
Last release
4 years ago

TSLint Config Silind Tweet

NPM Version Github License Build Status Code Coverage

An opinionated TSLint configuration preset for writing scalable, clean and hygienic code

:warning: This project is deprecated

TSLint has been deprecated.
As a consequence, this project will no longer be maintained.

Read more about TSLint deprecation here

Table of content

Getting Started

Install

Install tslint-config-silind as a dev dependency using npm or yarn

npm:

npm install -D tslint-config-silind

yarn:

yarn add -D tslint-config-silind

Create TSLint configuration (tslint.json)

Create a file tslint.json in your project root, and add the following:

{
  "extends": ["tslint-config-silind"],
  "linterOptions": {
    "exclude": ["node_modules/**/*.ts"]
  }
}

If you already have a tslint.json file in your project, make sure to add tslint-config-silind under extends.

Configuration preset

tslint-config-silind comes pre-configured with the following rules.
These can of course be overridden in tslint.json under rules.

rules: {
  "curly": true,
  "max-classes-per-file": false,
  "variable-name": false,
  "member-ordering": false,
  "ordered-imports": [false],
  "object-literal-sort-keys": [false],
  "no-console": [false],
  "import-name": [false],
  "align": [false],
  "max-line-length": { "options": [120], "severity": "warning" },
  "no-consecutive-blank-lines": { "options": [1], "severity": "warning" },
  "quotemark": [true, "single"],
  "array-type": [true, "array-simple"],
  "prefer-array-literal": { 
    "options": [true, { "allow-type-parameters": true }], 
    "severity": "error" 
  },
  "ter-arrow-parens": { 
    "options": ["as-needed", { "requireForBlockBody": true }], 
    "severity": "warning" 
  },
  "trailing-comma": {
    "options": [
      {
        "multiline": {
          "objects": "always",
          "arrays": "always",
          "functions": "ignore",
          "typeLiterals": "ignore"
        },
        "esSpecCompliant": true
      }
    ],
    "severity": "error"
  }
}

Custom rules

Any custom rule can be disabled and severity level can be set individually
In this example, the rule no-lowlevel-commenting is configured with a severity-level of error:

"no-lowlevel-commenting": { "severity": "error" }

To disable a rule, simply set its value to false:

"no-lowlevel-commenting": false

The following table shows the custom rules that comes with tslint-config-silind.

TS OnlyRule NameDescription
:heavy_check_mark:no-lowlevel-commentingFails in the presence of low-level comments that are not part of JSDocs. Read more
:heavy_check_mark:discreet-ternaryPrevents overuse of the ternary operator Read more
:heavy_check_mark:structured-importRequires import statements to be structured based on content and origin Read more

Contributing

Issues

In the case of a bug report, bugfix or a suggestions, please feel very free to open an issue.

Pull request

Pull requests are always welcome, and I'll do my best to do reviews as fast as I can.

License

This project is licensed under the MIT License

Get Help

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago