-
Notifications
You must be signed in to change notification settings - Fork 105
Package can't be used by an "extended" tslint configuration #165
Comments
This matches what https://github.com/palantir/tslint-react does. |
Seems like the right move, considering that @jkillian wrote something similar when index.js was created: aa17d2e. On the issue with a possible custom config, shouldn't we be using this project as a peerDependency? Even airbnb installs a custom configuration for eslint by declaring eslint and other packages as peers. See https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb. I looked more into it when deciding to look into publishing packages and I found this: npm/npm#11213 I'm not opposed to using extends as in the PR. It does make it easier to start using the rules without providing a configuration. I'm just not sure if this would open future pull request in which people will want to provide a set configuration for tslint-eslint-rules which will create problems outside the scope of the project. The tslint-config-standard project seems to have solved the problem of path resolutions with this: https://github.com/blakeembrey/tslint-config-standard/blob/master/tslint.js @blakeembrey Any thoughts on this discussion? It would make your configuration much shorter. |
|
Setting On the matter of recommending @jmlopez-rod's point about opening the possibility for setting default rule settings in this package is valid, but I don't think it's a problem. If someone wants to add defaults to this package, they could be exposed in a separate configuration. (keep the package's main |
@apexskier we do have an opinionated configuration, that's the one we are use on our own source files https://github.com/buzinas/tslint-eslint-rules/blob/master/tslint_eslint_rules.json, we should probably add a comment on |
[feat] exported a configuration from this package (closes #165)
Scenario and problem
I've got a custom tslint configuration that's intended to be shared among several projects. I want that custom configuration to include this package's rules. Since
tslint
's custom rules loading always uses a relative/absolute path, specifying"rulesDirectory": "node_modules/tslint-eslint-rules/dist/rules"
breaks when my custom configuration is inside the node_modules of another package.Say my custom config is the package
tslint-config-custom
. It's gottslint-eslint-rules
as a dev and peer dependency (this style is copied from airbnb's linter setup and exposes a config like:When I have another project with
tslint-config-custom
andtslint-eslint-rules
as dev dependencies, this breaks:Fix
To resolve this, I'd suggest allowing people to load these rules by extending this repository as a tslint configuration.
This means my
tslint-config-custom
looks like:I'll submit a PR shortly with the change.
The text was updated successfully, but these errors were encountered: