Skip to content

Commit

Permalink
feat: Lint other filetypes with prettier (#152)
Browse files Browse the repository at this point in the history
* feat: Lint other filetypes with prettier

* chore: Autofix files with prettier

* feat: Ignore autogenerated files from linting
  • Loading branch information
vikr01 authored and jasonmit committed Jan 8, 2019
1 parent 56a9f45 commit 78d1af8
Show file tree
Hide file tree
Showing 29 changed files with 686 additions and 650 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/packages/@pollyjs/ember/tests/**/index.html
CHANGELOG.md
package.json
node_modules
tmp
build
Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
language: node_js
node_js:
- "6"
- "8"
- "10"
- '6'
- '8'
- '10'

sudo: false
dist: trusty
Expand Down
4 changes: 2 additions & 2 deletions docs/adapters/fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ polly.disconnectFrom('fetch');
_Type_: `Object`
_Default_: `global|self|window`

The context object which contains the fetch API. Typically this is `window` or `self` in the browser and `global` in node.
The context object which contains the fetch API. Typically this is `window` or `self` in the browser and `global` in node.

__Example__
**Example**

```js
polly.configure({
Expand Down
96 changes: 54 additions & 42 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@

Create a new Polly instance.

| Param | Type | Description |
| --- | --- | --- |
| Param | Type | Description |
| ------------- | -------- | ------------------------------------------------------------------------- |
| recordingName | `String` | Name of the [recording](api#recordingName) to store the recordings under. |
| config | `Object` | [Configuration](configuration) object |
| __Returns__ | `Polly` |   |
| config | `Object` | [Configuration](configuration) object |
| **Returns** | `Polly` |   |

__Example__
**Example**

```js
new Polly('<Recording Name>', { /* ... */ });
new Polly('<Recording Name>', {
/* ... */
});
```

## Events
Expand All @@ -24,28 +26,36 @@ Emitted when a Polly instance gets created.

!> This is a synchronous event.

__Example__
**Example**

```js
const listener = polly => { /* Do Something */ };
const listener = polly => {
/* Do Something */
};

Polly.on('create', listener);
Polly.off('create', listener);
Polly.once('create', polly => { /* Do Something Once */ });
Polly.once('create', polly => {
/* Do Something Once */
});
```

### stop

Emitted when a Polly instance has successfully stopped.

__Example__
**Example**

```js
const listener = polly => { /* Do Something */ };
const listener = polly => {
/* Do Something */
};

Polly.on('stop', listener);
Polly.off('stop', listener);
Polly.once('stop', polly => { /* Do Something Once */ });
Polly.once('stop', polly => {
/* Do Something Once */
});
```

## Properties
Expand All @@ -58,10 +68,12 @@ _Default_: `null`
The recording name the recordings will be stored under. The provided name is
sanitized as well as postfixed with a GUID.

__Example__
**Example**

```js
new Polly('Wants a Cracker', { /* ... */ });
new Polly('Wants a Cracker', {
/* ... */
});
```

Will save recordings to the following file:
Expand All @@ -72,7 +84,7 @@ recordings
└── recording.json
```

__Example__
**Example**

?> A recording can also have slashes to better organize recordings.

Expand All @@ -96,14 +108,14 @@ _Default_: `'replay'`

The current [mode](configuration#mode) polly is in.

__Example__
**Example**

```js
const polly = new Polly();

polly.mode // → 'replay'
polly.mode; // → 'replay'
polly.record();
polly.mode // → 'record'
polly.mode; // → 'record'
```

### persister
Expand Down Expand Up @@ -135,11 +147,11 @@ server.get('/series').intercept((req, res) => res.sendStatus(200));

Configure polly with the given configuration object.

| Param | Type | Description |
| --- | --- | --- |
| Param | Type | Description |
| ------ | -------- | ------------------------------------- |
| config | `Object` | [Configuration](configuration) object |

__Example__
**Example**

```js
polly.configure({ recordIfMissing: false });
Expand All @@ -150,7 +162,7 @@ polly.configure({ recordIfMissing: false });
Puts polly in recording mode. All requests going forward will
be sent to the server and their responses will be recorded.

__Example__
**Example**

```js
polly.record();
Expand All @@ -161,7 +173,7 @@ polly.record();
Puts polly in replay mode. All requests going forward will be
played back from a saved recording.

__Example__
**Example**

```js
polly.replay();
Expand All @@ -173,7 +185,7 @@ Puts polly in a paused mode. All requests going forward will pass through
and will not be recorded or replayed. The previous mode will be saved and can
be restored by calling [play](api#play)

__Example__
**Example**

```js
// polly.mode === 'replay'
Expand All @@ -185,7 +197,7 @@ polly.pause();

Restores the mode to the one before [pause](api#pause) was called.

__Example__
**Example**

```js
// polly.mode === 'replay'
Expand All @@ -202,11 +214,11 @@ Persist all recordings and disconnect from all adapters.
!> This method is `async` and will resolve once all recordings have
persisted and the instance has successfully torn down.

| Param | Type | Description |
| --- | --- | --- |
| Returns | `Promise` | &nbsp; |
| Param | Type | Description |
| ------- | --------- | ----------- |
| Returns | `Promise` | &nbsp; |

__Example__
**Example**

```js
await polly.stop();
Expand All @@ -216,11 +228,11 @@ await polly.stop();

Connect to an adapter.

| Param | Type | Description |
| --- | --- | --- |
| name | `String|Function` | The adapter name of class to connect to |
| Param | Type | Description |
| ----- | ----------------- | --------------------------------------- |
| name | `String|Function` | The adapter name of class to connect to |

__Example__
**Example**

```js
polly.connectTo('xhr');
Expand All @@ -231,11 +243,11 @@ polly.connectTo(XHRAdapter);

Disconnect from an adapter.

| Param | Type | Description |
| --- | --- | --- |
| name | `String|Function` | The adapter name of class to disconnect from |
| Param | Type | Description |
| ----- | ----------------- | -------------------------------------------- |
| name | `String|Function` | The adapter name of class to disconnect from |

__Example__
**Example**

```js
polly.disconnectFrom('xhr');
Expand All @@ -246,7 +258,7 @@ polly.disconnectFrom(XHRAdapter);

Disconnect from all connected adapters.

__Example__
**Example**

```js
polly.disconnect();
Expand All @@ -256,11 +268,11 @@ polly.disconnect();

Returns a Promise that resolves once all requests handled by Polly have resolved.

| Param | Type | Description |
| --- | --- | --- |
| Returns | `Promise` | &nbsp; |
| Param | Type | Description |
| ------- | --------- | ----------- |
| Returns | `Promise` | &nbsp; |

__Example__
**Example**

```js
await polly.flush();
Expand Down
4 changes: 2 additions & 2 deletions docs/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
--theme-color: #e50914;
--theme-color-dark: #b20710;

--text-color-base: #2E2E46;
--text-color-base: #2e2e46;
--text-color-secondary: #646473;
--text-color-tertiary: #81818E;
--text-color-tertiary: #81818e;
}

body {
Expand Down
2 changes: 1 addition & 1 deletion docs/frameworks/ember-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installing the `@pollyjs/ember` addon will import and vendor the necessary
Polly.JS packages as well as register the [Express API](node-server/express-integrations)
required by the [REST Persister](persisters/rest).

?> __NOTE:__ By default, this addon installs and registers the
?> **NOTE:** By default, this addon installs and registers the
[XHR](adapters/xhr) & [Fetch](adapters/fetch) adapters as well as the
[REST](persisters/rest) & [Local Storage](persisters/local-storage) persisters.

Expand Down
Loading

0 comments on commit 78d1af8

Please sign in to comment.