-
Notifications
You must be signed in to change notification settings - Fork 105
add empty "index.js" to "rules/" directory #214
Comments
@donaldpipowitch Why not just use the |
Because of my comment below 😄 palantir/tslint#2163 (comment) AFAIK |
the config provided by |
@donaldpipowitch Fair enough. The original comment didn't make any sense when I read it. The main concern I have (apart from having to add empty files around the place to make people happy) is that this could have adverse affects tying the directory structure to the module. Is there maybe a better way this feature could be implemented in TSLint to avoid that? For instance, could it do regular resolution and then use the Edit: Realised |
Sorry, I'm confused. When I do
The reviewers recommended to remove I'd prefer to use |
@donaldpipowitch you get this file: https://github.com/buzinas/tslint-eslint-rules/blob/master/index.js because of this line: https://github.com/buzinas/tslint-eslint-rules/blob/master/package.json#L5 Instead of adding an empty index.js, it could be moved to |
@ajafff Thank you for the clarification. So currently I could use |
The goal of this project is to make it possible to people who use
TypeScript to easily migrate an ESLint configuration to TSLint. We're not
opinionated about what rules you should use, and never will.
We only created the "extends" option because people thought it was simpler
to use than rulesDirectory, but we will never add any configuration by
default.
|
@ajafff That might be a reasonable way to make use of both features in one go, nice! 😄 Would it make sense to make a request to TSLint to make it possible to extend with only We'd need to document the directory also in the README, I don't think it's enough just to add an empty |
Small feedback to the |
I think that using "rulesDirectory" like suggested by @donaldpipowitch would be an amazing good practice for rule packages in general. That way "rulesDirectory" would always be the way to "import" the rules and "extend" is the way to enable a preset, that is more like ESLint btw, where you have "plugins" for new rules and "extend" for presets (correct me if I'm wrong on this one). While tslint-eslint-rules do not set any default rules, packages like tslint-react for example does. Making it super confusing for newcomers (like myself) to figure out what is going on. |
rulesDirectory doesn't work for tslint-eslint-rules. See * palantir/tslint#3436 * buzinas/tslint-eslint-rules#214
I'm currently writing a set of rules to share across my company and be able to use |
You guys need to remove the use of |
[docs] improved README.md file (discussed in #214)
Given palantir/tslint#2163 it would be nice, if the
rules/
directory would contain an emptyindex.js
. Then we could resolve the rules directory with Nodes module resolution which makes it easy to use custom rules in certain situations (symlinked configs, flat vs. non-flat installations...).(Update)
Motivation:
extends
: Allows me to use custom rules from other packages. I get all rules with default configs and can opt-out from rules. If new rules are added in a new version I get them automatically.rulesDirectory
: Allows me to use custom rules from other packages. I opt-in to use certain rules with my specific configs. If new rules are added in a new version I don't get them automatically.The text was updated successfully, but these errors were encountered: