-
Notifications
You must be signed in to change notification settings - Fork 889
Conversation
awesome! we'll try to merge this this week and bump to 3.0 for the breaking change. |
} | ||
} | ||
}); | ||
|
||
// load NPM tasks | ||
grunt.loadNpmTasks("grunt-contrib-clean"); | ||
grunt.loadNpmTasks("grunt-contrib-concat"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove grunt-contrib-concat from package.json as well
@adidahiya Updated the PR. |
There's an issue with const enums and our next branch related to this as well. Currently, the next branch has a devDependency on `"typescript": "next", and with this modularization update, just a regular old dependency. But we have to be careful, if TSLint gets compiled with a TS nightly from Oct.15th and it gets installed on some later date, TSLint would then be using a newer version of TS to analyze files then it was compiled with, which could lead to enum value conflicts. |
@weswigham Sweet! |
released v3.0.0-dev.1 |
Trying this now, but something has changed with the way the top-level export works. Note the difference is the nesting under the 'default' property:
this causes gulp-tslint to fail:
|
Thanks for the heads-up @alexeagle. The problem is that when you use the This is all fine and dandy when using TS ES6 imports, but it's a little messy when using CommonJS. Luckily there are ways to deal with this. I assume we'll do something like suggested in that previous link so CommonJS users don't have to change their code. What do you think @adidahiya? |
Otherwise, this looks good to me. 👍 Note you may want to document for the next release that custom rules need to use the same typescript version as tslint internally:
|
Yikes, that's a cryptic error. It's a little bit tricky now: when using the I think we ought to fix TS to a specific version for the That still leaves the issue of the version of TS used to compile custom rules. I think recommending that custom rules be compile with the same version of TS as tslint is using in the docs is a good starting point. If compiling the custom rules is integrated into your build, this is fine. It still makes it hard to use prebuilt-custom rules though. We also have the issue of const enums that was mentioned earlier. @weswigham, is it correct that the TS |
Yes. We have an open PR with the change that'll likely be merged in soon. On Tue, Oct 27, 2015, 9:46 PM Jason Killian notifications@github.com
|
There is probably an issue where this discussion belongs. Indeed this is tricky - we have similar problems with ts2dart but have the advantage that we control versions at tool-compile-time, user-compile-time, and runtime. Here's my somewhat-informed input: If the const enum problem is resolved, then I won't have to care what TS you complied tslint with, I only need runtime compatibility with the JS files you distribute. |
@alexeagle - thanks for adding comment about that version mismatch problem... just ran into exactly the same issue. Just so that I'm clear, for people writing custom rules (incidentally we need a
Is that correct? |
I'd avoid this. With |
Too late, it's in angular master already :)! The problem is that 3.0.0-dev.1 is cut from the tslint@next branch so it On Wed, Oct 28, 2015 at 1:02 PM Wesley Wigham notifications@github.com
|
I need to think about the best solution a little bit more - this discussion has been great so far, but I don't see a clear cut road forwards yet. @weswigham Any recommended reading/documentation on previous/upcoming npm changes? I'm not too familiar with npm 3 vs. npm 2 and definitely not familiar with what the changes down the road will look like. |
@jkillian The npm roadmap, and the npm 3 changelog are great references. For the record: npm 3+ is the latest stable version of npm - anyone doing an |
Thanks @weswigham, reading over the changelog and some related issues since npm v3.0.0 was helpful. I had initially thought you meant "with possible future changes to npm3" the dependency might get flattened, but in reality I see that npm3 can "choose" to install typescript as a sibling of tslint or it might install it as a child of tslint. Having a non-deterministic location for typescript seems problematic; I like the idea of making it a peer dependency and thus always having it installed as a sibling. If we went down this road, I wonder what versioning requirement would be appropriate. Maybe
Why would this be though? It seems to me they could stay as one package with a peer dependency on typescript. Yes, it would force people to install typescript besides tslint just in order to use the CLI, but this probably happens in almost all cases anyways. |
@alexeagle I'm going to change the behavior of the |
Any idea when a 3.0.0 will be cut from master (so it depends on TS 1.6.2?) On Thu, Oct 29, 2015 at 1:54 PM Jason Killian notifications@github.com
|
👍 Just been bitten by this... right now I've had to switch our dependency to be on |
@jkillian looking forward to The good news is that as of TypeScript |
@myitcv Should be pretty soon: #768 :) |
published 3.0.0-dev.2 |
@adidahiya @jkillian - thanks very much, works like a charm. |
FYI, the const enum problem is worse than I actually thought (but maybe y'all were aware). See #832. Glad to see that microsoft/TypeScript#5422 got merged :) |
Implements #465, #280.
This PR rearchitects tslint to be a series of modules rather than a bunch of merged namespaces meant to be concatenated together. What this has enabled is a handful of cool TS 1.6 things - for one, tslint now has typescript 1.6 compatible
typings
built alongside itself - meaningimport * as Linter from "tslint";
(andimport * as Lint from "tslint/lib/lint";
) can now pull associated typings from the node package.It does, however, retain the namespace structure tslint used before - it just creates it via modules now, rather than TS's namespace keyword. This means that, given the right entrypoint (namely
tslint/lib/lint
), the API surface should look identical to before this change.This does contain a fairly large breaking change, however, but in doing so it fixes some odd things with the tslint build and makes it a bit less of a chore to integrate into your builds. For one, it no longer concatenates all of typescript into its built js, and for two, it no longer creates a global
ts
orLint
object (thereby mucking with people's build environments like so). Combined with the typings field support, this means external rules and formatters must replace their lines like this:with this:
Additionally, this fixes #549, allows #532 to be done more easily.