Contributing to bluebird

  1. Directory structure
  2. Style guide
  3. Scripts and macros
  4. JSHint
  5. Testing

Directory structure

Scripts and macros

Scripts and macros are necessary for the code the code to remain readable and performant. For example, there is no way to turn the arguments object into an array without using a build step macro unless you want to compromise readability or performance.

/ast_passes.js contains functions called ast passes that will parse input source code into an AST, modify it in some way and spit out new source code with the changes reflected.

/src/constants.js contains declarations for constants that will be inlined in the resulting code during in the build step. JavaScript lacks a way to express constants, particularly if you are expecting the performance implications.

/Gruntfile.js contains task definitions to be used with the Grunt build framework. It for example sets up source code transformations.

/bench a bash script to run benchmarks.

/mocharun.js a hack script to make mocha work when running multiple tests in parallel processes

JSHint

Due to JSHint globals being dynamic, the JSHint rules are declared in /Gruntfile.js.

Style guide

Use the same style as is used in the surrounding code.

###Whitespace

###Variables

###Equality and type checks

Testing

Fork me on GitHub