Maintainers are the core developers of the project. Their main role is to review, merge or reject pull-requests and fix critical bugs. Some maintainers can have areas of responsibility:
- @mdevils: general architecture, common rules.
- @markelog: CLI, integration, common rules.
- @mikesherov: ex-jshint rules, common rules.
Each rule should have:
- Implementation in
lib/rules/rule-name.js
. - Registration in
registerDefaultRules
method ofStringChecker
(lib/string-checker.js
). - Documentation in
README.md
. - Tests in
lib/test.rule-name.js
Rule interface:
interface Rule {
/**
* Configures rule before being used in validations.
*
* @param {*} ruleConfigutationValue configuration value.
* @returns {undefined}
* @throws Error on invalid configuration value.
*/
configure(ruleConfigutationValue);
/**
* Returns option name for this rule to be used in jscs config.
*
* @returns {String}
*/
getOptionName();
/**
* Validates file.
*
* @param {JsFile} file - file representation. See lib/js-file.js.
* @param {Errors} errors - object for validation errors to write to. See lib/errors.js.
* @returns {undefined}
*/
check(file, errors);
}
File lib/string-checker.js
is used in browserify process, exporting JscsStringChecker
class.
string-checker.js
(and its dependencies) should not depend on nodejs
specifics like fs
,
process
and so on.
- Make sure they follow the rules listed in CONTRIBUTING.md
- Discuss the preset on the mailing list: [email protected]
- Once discussed and agreed upon, land the PR!
- Determine which part of the version you are about to increase.
We are using
semver
(http://semver.org/). For just fixing bugs, increment the patch version. For new features, increment the minor version and reset patch version to zero. For backwards incompatible features, increment the major version, and reset minor and patch versions, but be sure to discuss these changes with the other maintainers first. - Write changes to
CHANGELOG.md
:npm run changelog
. Clean up the changelog by manually clarifying and reordering the messages. Ensure the changes are listed in following order:- breaking changes.
- preset updates.
- new rules.
- new options.
- bug fixes.
- infrastructure or docs changes.
- Commit the changelog update with the message:
Prepare for version x.x.x
. - Set a new version and tag:
npm version x.x.x
. - Push changes and tags:
git push && git push --tags
. - Use
npm run release
to publish the new version to npm. DO NOT USEnpm publish
, as this will not perform the necessary prepublish tasks. If you don't have publish privileges, ask @mdevils to publish for you. - Copy the changelog notes into the Github releases section located here: https://github.com/mdevils/node-jscs/releases
- Tweet or otherwise promote the fact that a new version has been released with a link to the changelog and npm download page.
- Done!