Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

How to check original JS files rather than module-transpiler processed files? #10

Closed
voltidev opened this issue Jan 23, 2015 · 9 comments

Comments

@voltidev
Copy link

@rwjblue I get irrelevant JSCS reports about code style issues in module-transpiler processed files. I'd like JSCS to check code style in original source files only. How can I do that?

Example of JSCS noise:

Use dot notation instead of brackets for member expressions at webclient/initializers/wallets.js :
    14 |  }, function() {
    15 |    walletManager = false;
    16 |  })["finally"](function() {
-------------^

But in the original file I don't have any code style problems:

  }, function() {
    walletManager = false;
  }).finally(function() {
@rwjblue
Copy link
Contributor

rwjblue commented Jan 23, 2015

you only pass pre-transpiled source to the main filter

@voltidev
Copy link
Author

@rwjblue can you give me an example please? It's still very hard for me to understand broccoli and ember-cli plugins system.

I tried to do it like this in Brocfile.js but it doesn't give me JSCS tests:

var jscs = require('broccoli-jscs');
var trees = [];
var appJsTree = pickFiles('app', {
    srcDir: '/',
    files: ['**/*.js'],
    destDir: 'app'
});
var jscsTree = jscs(appJsTree);
trees.push(jscsTree);
trees.unshift(app.toTree());
module.exports = mergeTrees(trees);

@rwjblue
Copy link
Contributor

rwjblue commented Jan 25, 2015

Should be fixable once ember-cli/ember-cli#3094 lands (and once we update to use the postprocessTree hook like ember-cli/ember-cli-qunit#28).

@knownasilya
Copy link

👍 Looks like this will be in soon, sweet.

@rwjblue
Copy link
Contributor

rwjblue commented Jan 29, 2015

@knownasilya - Ya, I should get a PR together tonight/tomorrow morning.

@voltidev
Copy link
Author

@rwjblue - Is it already possible to fix the issue?

@rwjblue
Copy link
Contributor

rwjblue commented Aug 28, 2015

Yes, this should already be resolved.

@kellyselden
Copy link
Owner

@ivanvotti Can you confirm this is fixed?

@voltidev
Copy link
Author

@rwjblue @kellyselden I've just tried broccoli-jscs v.1.1.0 and can confirm it's fixed. Thank you.

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

No branches or pull requests

4 participants