-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use JSCS preset system instead of generating custom build config. #70
Conversation
@@ -0,0 +1 @@ | |||
{ "preset": "../../lib/jscsrc.json"} |
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.
This lets JSCS find lib/jscsrc.json
(which is exactly what a user would get if they did preset: 'ember-suave'
).
Note: that I used ember-cli-blueprint-test-helpers to make testing the generated file simple. Thanks to @trabus for his hard work on extracting those helpers. |
Just tested this out quickly for my integration with |
aptible/ember-json-schema-document#1 updates a little addon that was previously using a custom |
maybe add preset or jscs-preset to keywords of package.json? Btw we're working on 3.0 soon (going to release a bugfix release today) mainly for https://github.com/cst/cst but also other stuff like |
@hzoo - Great idea, updated! |
How different is ember-suave and the ember |
|
@rwjblue This looks great!! Much cleaner with a preset! Just a few things:
|
Here's an example of a custom {
"excludeFiles": ["fixtures/**"],
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
"requireCommentsToIncludeAccess": null
} This would stop working after upgrading, without some (minimal) changes. |
No problem. Done.
Agreed. Will get that updated shortly.
It really depends on what we want. It is possible for us to detect that no
Same as above, we could bring back the It all comes down to what we want. Do we want to have this addon have a nice upgrade path (following Ember's concept of "no major version breakage without prior deprecation") or do we want to make this addon as simple as possible and revv the major version? |
9128ed2
to
bcb22ca
Compare
} | ||
``` | ||
|
||
`ember-sauve` integrates well with ember-cli, but can also be used as a standalone JSCS preset. This allows custom |
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.
s/sauve/suave/
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.
Good catch! Fixed...
Damn that stupid Ember project setting good examples. I updated this to provide deprecation warnings when used in the following scenarios:
All existing scenarios should fall into one of those two deprecations and the current setup is still supported. I think this is not fully backwards compatible. When we decide to bump major versions (likely for JSCS 3.0) we can remove |
😛 Was hard arguing against not being a good citizen and providing an upgrade path.
You mean "now fully backwards compatible", right? |
} | ||
} | ||
|
||
function getSuaveConfig() { | ||
// avoiding `require` (which would have worked fine) | ||
// to prevent mutating the cached result |
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.
👍
LOL, yes |
448f844
to
87cb441
Compare
Updated to prevent printing deprecation message twice (once for |
Also, add blueprint and blueprint test. Now: ``` ember install ember-suave ``` Will auto-generate a `.jscsrc` with `{ "preset": "ember-suave" }`.
Excellent, thanks!! 💯 |
Use JSCS preset system instead of generating custom build config.
This PR removes the custom config file generation and replaces it with JSCS's built in preset system (thanks to @hzoo for helping push that forward so much!). This removes the need for a custom binary/command (because now
jscs
command will work properly).I believe this is backwards compatible (if folks had created a
.jscsrc
file with our rules in them, they should continue to work just the same). Definitely open to thoughts of how that might be an issue (worst case scenario we can just bump majors, but I'd prefer not to)...Fixes #64.
Fixes #34.