Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Replace TSLint rules with presets #281

Merged
merged 6 commits into from
Mar 23, 2018
Merged

Conversation

nielsdB97
Copy link
Contributor

@nielsdB97 nielsdB97 commented Mar 21, 2018

As discussed in #77 I have replaced the extensive custom ruleset with some sane defaults by using the tslint:recommended preset and added support for React by also using tslint-react.

Also I added tslint-config-prettier which disables any rule regarding code style (e.g. quote style) to avoid collisions with automatic code formatters.

@nielsdB97
Copy link
Contributor Author

It would probably be nice for us to Prettify the existing template files as well, but I think that should be a separate PR.

@@ -48,6 +48,7 @@
"ts-loader": "^2.3.7",
"tsconfig-paths-webpack-plugin": "^2.0.0",
"tslint": "^5.7.0",
"tslint-config-prettier": "^1.10.0",
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think we should add this. We should aim to be as flexible as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seemed you agreed to using this package in #77, that's why I added it. If I understand you correctly you now want to not use Prettier but instead use just the tslint:recommended and tslint-react presets?

Copy link
Owner

Choose a reason for hiding this comment

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

Apologies, yes no style rules from prettier.

@nielsdB97
Copy link
Contributor Author

nielsdB97 commented Mar 21, 2018

@wmonk The custom rules that you were using do not match the presets. Do you want to add custom rules to fix the linting issues or do you want to update the template files to pass the test?

@nielsdB97 nielsdB97 changed the title Replace TSLint rules and use Prettier Replace TSLint rules with presets Mar 21, 2018
@DorianGrey
Copy link
Collaborator

DorianGrey commented Mar 22, 2018

I'd favor to use tslint-config-prettier in the preset - even if the name tends towards prettier, it actually just disables any rule regarding code style (e.g. quote style) to avoid collisions with automatic code formatters. It has nothing specific for prettier inside, just shares a part of the name. People are still free to define these rules in their particular tslint.json, e.g. in case they don't use an automatic code formatter like prettier.
Besides, that would change the linting behavior to be more similar to CRA's eslint setup, which also does not apply style related rules.

@wmonk
Copy link
Owner

wmonk commented Mar 22, 2018

Sorry for flip-flopping agree with @DorianGrey here, didn't realise the function of prettier in this case.

@DorianGrey
Copy link
Collaborator

Travis build is still failing ... which is curious, since it fails on a .js file.
Would you mind adding the following to the tslint.json to see if it makes things work?

"linterOptions": {
  "exclude": [
    "config/**/*.js",
    "node_modules/**/*.ts"
  ]
}

@DorianGrey
Copy link
Collaborator

LGTM, thanks!

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

Successfully merging this pull request may close these issues.

3 participants