Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

additionalRules not found since 1.8 #829

Closed
danez opened this issue Dec 11, 2014 · 3 comments
Closed

additionalRules not found since 1.8 #829

danez opened this issue Dec 11, 2014 · 3 comments

Comments

@danez
Copy link

danez commented Dec 11, 2014

We have the problem, that since we updated to version 1.8 of jscs, our additional rules can not be found. Let me show an example.

We have this config in the root path of our project /project/.jscsrc:

{
    ...
    "additionalRules": ["projectRules/*.js"],
    "ourRule": true
}

Now when we do this everything works:

cd /project/
jscs src/path/something.js

But when we do this it fails with "Unsupported rule: ourRule":

cd /project/src
jscs path/something.js

If I change the config to "additionalRules": ["../projectRules/*.js"], it works again, so it seems to be an issue that the files specified in the config resolve with the cwd and not the path of the config file.

When going back to 1.7.x it works in both cases.

This also breaks it from being used in WebStorm/PHPStorm, as the IDE seems to call them always with the cwd set to the path of the file being checked.

@mikesherov
Copy link
Contributor

Thanks for reporting! We'll look at this very soon! /cc @mdevils

@mdevils
Copy link
Member

mdevils commented Dec 15, 2014

Going to work on this soon, thank you.

@lahmatiy
Copy link
Contributor

Yep, after refactoring additionalRules doesn't accept file mask anymore, but expects Rule instances instead.
Before 1.8 adittionalRules processing by this code: https://github.com/jscs-dev/node-jscs/blob/v1.7.3/lib/options/additional-rules.js#L6-L9
And also test by this test suite https://github.com/jscs-dev/node-jscs/blob/v1.7.3/test/options/additional-rules.js

mdevils added a commit that referenced this issue Dec 18, 2014
mdevils added a commit that referenced this issue Dec 18, 2014
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