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

Creating a Custom Preset or Config

Henry Zhu edited this page Oct 2, 2015 · 8 revisions

Custom Presets

For regular projects, using the built-in preset/config such as the airbnb, google, or jquery preset may be good enough. However, it may be more useful to share your config files across your company's projects or your own ecosystem of projects. You can either create an npm package to share, or just link to a local file.

Creating the Config

The shared config file itself doesn't need to change. It is just a regular .jscs.json or .jscsrc file.

// example .jscsrc using a custom preset
// assuming the preset package name is `jscs-config-awesome`
{
  "preset": "awesome",
  "disallowEmptyBlocks": false // an example of disabling a preset rule with false
  "disallowArrowFunctions": null // an example of disabling a preset rule with null
  "disallowCapitalizedComments": null // you can also just null a rule to label it for later
}
Clone this wiki locally