Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

tslint-config-loris #102

Merged
merged 7 commits into from
Jan 14, 2018
Merged

tslint-config-loris #102

merged 7 commits into from
Jan 14, 2018

Conversation

dmikis
Copy link
Contributor

@dmikis dmikis commented Oct 21, 2017

#92

Copy link
Contributor

@ikokostya ikokostya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good practice to add CHANGELOG.md to the repository. We can add it later in a separated commit just before release.

"Konstantin Ikonnikov <ikokostya@gmail.com>"
],
"peerDependencies": {
"eslint": "^5.8.0",
Copy link
Contributor

@ikokostya ikokostya Nov 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dependency from eslint is redundant. Instead, this package must depend from tslint. I suggest use the following versions (or greater):

├── tslint@5.7.0 
└── tslint-eslint-rules@4.1.1

## Installation

```
npm install --save-dev tslint tslint-config-loris
Copy link
Contributor

@ikokostya ikokostya Nov 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because package includes tslint-eslint-rules as peer dependency, it must be presented here (npm doesn't install peer dependency automatically since v3).

'variable-name': [true, 'ban-keywords'],
'eofline': true,
// TODO(ikokostya): Find easy way to disable rules in subdirectory.
'ter-indent': false, // [true, 4, {SwitchCase: 1}],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disabled this rule, because it got false positive results. I try enable this rule again now and it works as expected for the following versions:

├── tslint@5.7.0 
└── tslint-eslint-rules@4.1.1

So, I suggest to enable it.

'triple-equals': true,
'no-arg': true,
// Disable this rule, because it isn't configurable
// https://github.com/palantir/tslint/issues/1088
Copy link
Contributor

@ikokostya ikokostya Nov 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First issue can be removed, because since tslint v5.5 this rule has option for empty catch blocks:

'no-empty': [true, 'allow-empty-catch']

@@ -0,0 +1,115 @@
module.exports = {
// Add additional rules from https://github.com/buzinas/tslint-eslint-rules
'rulesDirectory': 'node_modules/tslint-eslint-rules/dist/rules',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- 'rulesDirectory': 'node_modules/tslint-eslint-rules/dist/rules',
+ 'extends': 'tslint-eslint-rules',

See https://github.com/buzinas/tslint-eslint-rules#configure-tslint-to-use-tslint-eslint-rules

Copy link
Contributor

@ikokostya ikokostya Nov 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wrong. extends includes all rules with all default values. Current solution is right. buzinas/tslint-eslint-rules#214 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to leave rulesDirectory property as safe by default (it will not enable any rules), but specify only name of npm module instead of pull path.

'no-constant-condition': [true, {checkLoops: false}],
'no-control-regex': true,
'no-debugger': true,
'no-duplicate-case': true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rule was added in tslint 5.8.0: no-duplicate-switch-case

'no-duplicate-case': true,
'no-empty-character-class': true,
'no-ex-assign': true,
'no-extra-semi': true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this rule is covered by semicolon rule from tslint, which is used below.

'no-unexpected-multiline': true,
'no-unsafe-finally': true,
'use-isnan': true,
'valid-typeof': true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rule is covered by typeof-compare rule from tslint. But it's deprecated in tslint 5.8.0. We can remove it.

Copy link
Contributor

@ikokostya ikokostya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add link to this package from root README.md?

@dmikis
Copy link
Contributor Author

dmikis commented Nov 7, 2017

Can you add link to this package from root README.md?

It's not uploaded yet.

@ikokostya
Copy link
Contributor

@dmikis any news?

@ikokostya
Copy link
Contributor

ikokostya commented Jan 7, 2018

@dmikis Please take a look new changes.

@dmikis
Copy link
Contributor Author

dmikis commented Jan 14, 2018

I can't approve the PR cause I'm the author:) If there's no objections, let's merge it.

@ikokostya ikokostya merged commit 3d8e442 into master Jan 14, 2018
@ikokostya ikokostya deleted the dmikis/tslint_config branch January 14, 2018 20:22
@vsesh
Copy link

vsesh commented Jan 14, 2018

🆒

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants