bdkjones / CodeKit

CodeKit 3 Issue Tracker
https://codekitapp.com
82 stars 5 forks source link

.js files imported via .ts aren't checked via eslint #89

Closed subhaze closed 7 years ago

subhaze commented 8 years ago

Quick, short summary: Currently I'm using TS as my ES6 transpiler/bundler and since the .js files aren't "processed" to another file, but imported, when saving a JS file it is not ran through eslint, I have to manually "check syntax" on it.

This may be the case with .js importing other .js files as well. .js files imported via a .js appears to work as expected.

Expected results: When saving a JS file that's set to be checked via eslint, eslint ran on that file.

Actual results: No syntax checking happens.

Exact steps to reproduce: CK3-Beta-issue-89.zip

save one.js or two.js in example project.

A link to download a simplified project or file that shows the issue:

Your configuration (any details about your system that you think might be relevant)

bdkjones commented 8 years ago

Well... the trouble here is that ESLint does not support TypeScript (although I think someone's working on that). So I can't hand the full chain of source code to ESLint as I do with JS files. If you're importing JS into TS files, the JS files are likely third-party code that's out of your control, right? I mean, your stuff you're going to write in TS. So it doesn't seem super high priority to check imported JS in TS---are you going to try to fix the 1,450 issues in jQuery?

subhaze commented 8 years ago

I'm actually doing the opposite of that. Any third-part js stuff is just in a vendor.js file that I use codekit-append to concat.

I don't really use TS either :P I'm just using it to write ES 6 code and bundle it up as it's currently the only way to do that with CK with no extra dependencies (hooks to some bin/node_module). I have a main.ts file that just imports any ES Modules I write and since TS has baked in bundling and ES 6 support I can just write pure ES 6 with just the one .ts file as the bundler.

subhaze commented 7 years ago

I'm thinking this can be closed. When setting a JS file to check syntax and setting the output to the same path, eslint works on it. Really the only issue with this work flow is logged at https://github.com/bdkjones/CodeKit/issues/213