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

Commit 405c1bf

Browse files
committed
style(lint): Adapt style to new prettier version
1 parent 3f9042d commit 405c1bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+274
-274
lines changed

jest.acceptance.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ module.exports = {
1111
collectCoverage: false,
1212

1313
// The test environment that will be used for testing
14-
testEnvironment: "node"
14+
testEnvironment: "node",
1515
};

jest.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ module.exports = {
2020
branches: 100,
2121
functions: 100,
2222
lines: 100,
23-
statements: 100
24-
}
23+
statements: 100,
24+
},
2525
},
2626

2727
// The glob patterns Jest uses to detect test files
2828
testMatch: ["**/test/unit/**/?(*.)+(spec|test).js?(x)"],
2929

3030
// The test environment that will be used for testing
31-
testEnvironment: "node"
31+
testEnvironment: "node",
3232
};

src/About.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AboutApi {
2929
this._tracer.verbose(`${PLUGIN_NAME}: Sending about | ${req.id}`);
3030
res.status(200);
3131
res.send({
32-
version
32+
version,
3333
});
3434
}
3535

src/Behaviors.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class BehaviorsApi {
3030
return {
3131
id: behavior.id,
3232
name: behavior.name, // TODO, deprecate name property
33-
fixtures: behavior.fixtures.map(fixture => fixture.id),
34-
extendedFrom: behavior.extendedFrom
33+
fixtures: behavior.fixtures.map((fixture) => fixture.id),
34+
extendedFrom: behavior.extendedFrom,
3535
};
3636
}
3737

@@ -48,7 +48,7 @@ class BehaviorsApi {
4848
getModel(req, res, next) {
4949
const id = req.params.id;
5050
this._tracer.verbose(`${PLUGIN_NAME}: Sending behavior ${id} | ${req.id}`);
51-
const foundBehavior = this._behaviors.collection.find(behavior => behavior.id === id);
51+
const foundBehavior = this._behaviors.collection.find((behavior) => behavior.id === id);
5252
if (foundBehavior) {
5353
res.status(200);
5454
res.send(this._parseModel(foundBehavior));

src/Fixtures.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class FixturesApi {
3232
requestMatchId: fixture.requestMatchId,
3333
handler: fixture.constructor.displayName,
3434
request: fixture.request,
35-
response: fixture.response
35+
response: fixture.response,
3636
};
3737
}
3838

@@ -49,7 +49,7 @@ class FixturesApi {
4949
getModel(req, res, next) {
5050
const id = req.params.id;
5151
this._tracer.verbose(`${PLUGIN_NAME}: Sending fixture ${id} | ${req.id}`);
52-
const foundFixture = this._fixtures.collection.find(fixture => fixture.id === id);
52+
const foundFixture = this._fixtures.collection.find((fixture) => fixture.id === id);
5353
if (foundFixture) {
5454
res.status(200);
5555
res.send(this._parseModel(foundFixture));

src/Plugin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const {
1515
SETTINGS,
1616
BEHAVIORS,
1717
ABOUT,
18-
FIXTURES
18+
FIXTURES,
1919
} = require("@mocks-server/admin-api-paths");
2020

2121
const packageInfo = require("../package.json");
@@ -30,7 +30,7 @@ const {
3030
ADMIN_API_PATH_OPTION,
3131
ADMIN_API_DEPRECATED_PATHS_OPTION,
3232
PLUGIN_NAME,
33-
DEPRECATED_API_PATH
33+
DEPRECATED_API_PATH,
3434
} = require("./constants");
3535

3636
class Plugin {
@@ -47,14 +47,14 @@ class Plugin {
4747
name: ADMIN_API_PATH_OPTION,
4848
type: "string",
4949
description: `Api path for ${PLUGIN_NAME}`,
50-
default: DEFAULT_BASE_PATH
50+
default: DEFAULT_BASE_PATH,
5151
});
5252

5353
core.addSetting({
5454
name: ADMIN_API_DEPRECATED_PATHS_OPTION,
5555
type: "boolean",
5656
description: `Disable deprecated paths of ${PLUGIN_NAME}`,
57-
default: true
57+
default: true,
5858
});
5959

6060
this._onChangeSettings = this._onChangeSettings.bind(this);

src/Settings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SettingsApi {
2828

2929
_validateNewSettings(newSettings) {
3030
const errors = [];
31-
Object.keys(newSettings).forEach(newSettingKey => {
31+
Object.keys(newSettings).forEach((newSettingKey) => {
3232
if (!this._settings.getValidOptionName(newSettingKey)) {
3333
errors.push(`Invalid option name "${newSettingKey}"`);
3434
}
@@ -42,7 +42,7 @@ class SettingsApi {
4242
if (errors.length) {
4343
next(Boom.badRequest(errors.join(". ")));
4444
} else {
45-
Object.keys(newSettings).forEach(newSettingKey => {
45+
Object.keys(newSettings).forEach((newSettingKey) => {
4646
this._tracer.verbose(
4747
`${PLUGIN_NAME}: Changing setting "${newSettingKey}" to "${newSettings[newSettingKey]}" | ${req.id}`
4848
);

src/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ module.exports = {
1212
ADMIN_API_PATH_OPTION: "adminApiPath",
1313
ADMIN_API_DEPRECATED_PATHS_OPTION: "adminApiDeprecatedPaths",
1414
PLUGIN_NAME: "plugin-admin-api",
15-
DEPRECATED_API_PATH: "/mocks"
15+
DEPRECATED_API_PATH: "/mocks",
1616
};

src/deprecated/Settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SettingsApi {
3535
this._tracer.verbose(`${PLUGIN_NAME}: Sending delay to | ${req.id}`);
3636
res.status(200);
3737
res.send({
38-
delay: this._settings.get("delay")
38+
delay: this._settings.get("delay"),
3939
});
4040
}
4141

test/acceptance/CliRunner.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = class CliRunner {
2424
this._cwd = options.cwd || process.cwd();
2525
this._logs = [];
2626

27-
this._exitPromise = new Promise(resolve => {
27+
this._exitPromise = new Promise((resolve) => {
2828
this._resolveExitPromise = resolve;
2929
});
3030

@@ -36,7 +36,7 @@ module.exports = class CliRunner {
3636
getCommandToExecute(command) {
3737
return {
3838
name: command[0],
39-
params: command.splice(1, command.length - 1)
39+
params: command.splice(1, command.length - 1),
4040
};
4141
}
4242

@@ -52,7 +52,7 @@ module.exports = class CliRunner {
5252
throw new Error("Cli is already running");
5353
} else {
5454
this._cliProcess = childProcess.spawn(this._command.name, this._command.params, {
55-
cwd: this._cwd
55+
cwd: this._cwd,
5656
});
5757
this._cliProcess.stdin.setEncoding(ENCODING_TYPE);
5858

@@ -62,7 +62,7 @@ module.exports = class CliRunner {
6262
this._cliProcess.stdout.on("data", this.logData);
6363
this._cliProcess.stderr.on("data", this.logData);
6464

65-
this._cliProcess.on("close", code => {
65+
this._cliProcess.on("close", (code) => {
6666
this._exitCode = code;
6767
this._resolveExitPromise(true);
6868
});

0 commit comments

Comments
 (0)