Skip to content

Commit

Permalink
added section for module names/paths
Browse files Browse the repository at this point in the history
  • Loading branch information
w33ble committed Sep 17, 2014
1 parent c41359b commit eee468d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions STYLEGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,24 @@ Kibana uses AMD modules to organize code, and require.js to load those modules.

Even Angular code is loaded this way.

### Module paths

Paths to modules should not be relative (ie. no dot notation). Instead, they should be loaded from one of the defined paths in the require config.

*Right:*

```js
require('some/base/path/my_module');
require('another/path/another_module');
```

*Wrong:*

```js
require('../my_module');
require('./path/another_module');
```

### CommonJS Syntax

Module dependencies should be loaded via the CommonJS syntax:
Expand Down

0 comments on commit eee468d

Please sign in to comment.