Skip to content

Commit a16f8f1

Browse files
authored
refactor: code style optimizations (#1314)
* chore(beautify): dependency reordering after npm i * refactor: eslint feedback / prefer-const 'matches' is never reassigned. Use 'const' instead * refactor: eslint feedback / prettier * refactor: eslint feedback / no-shadow 'e' is already declared in the upper scope on line 202 column 24 * refactor: eslint feedback / no-shadow 'port' is already declared in the upper scope on line 28 column 9 * chore: typo * test(eslint): error / Unexpected var, use let or const instead / no-var * refactor: eslint feedback / prettier/prettier * refactor(test): equals() is deprecated, replaced by equal() @deprecated — use equal() instead. 'equals' is deprecated.ts(6385) index.d.ts(53, 8): The declaration was marked as deprecated here. * refactor: removed unused variables 'fs' is declared but its value is never read.ts(6133) * refactor: eslint & prettier fixes * refactor: code formatting via prettier * Revert "refactor: removed unused variables" This reverts commit fd3964c.
1 parent 639801a commit a16f8f1

File tree

170 files changed

+2040
-1992
lines changed

Some content is hidden

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

170 files changed

+2040
-1992
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
]
1111
},
1212
"dependencies": {
13+
"@auto-it/released": "^9.40.5",
1314
"@babel/plugin-proposal-decorators": "^7.13.5",
1415
"@babel/plugin-syntax-jsx": "^7.12.13",
16+
"auto": "^9.40.5",
1517
"babel-eslint": "^10.0.2",
1618
"eslint": "^6.1.0",
1719
"eslint-config-airbnb-base": "^14.0.0",
1820
"eslint-config-prettier": "^6.0.0",
1921
"eslint-plugin-import": "^2.18.2",
2022
"eslint-plugin-prettier": "^3.1.0",
2123
"lerna": "3.17.0",
22-
"auto": "^9.40.5",
23-
"@auto-it/released": "^9.40.5",
2424
"prettier": "^2.2.1",
2525
"pretty-quick": "^3.1.0"
2626
},

packages/cli/bin/archive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function exportPatterns(config) {
3131
);
3232
});
3333

34-
archive.on('error', function(err) {
34+
archive.on('error', function (err) {
3535
throw new TypeError(
3636
`export: An error occured during zipping the patterns: ${err}`
3737
);

packages/cli/bin/ask.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const ask = inquirer.prompt;
1212
* @param {object} options - Options passed in from CLI
1313
* @param {boolean} options.force - Flag whether to force install in existing project directory. May overwrite stuff.
1414
*/
15-
const init = options =>
16-
wrapsAsync(function*() {
15+
const init = (options) =>
16+
wrapsAsync(function* () {
1717
/**
1818
* @property {string} project_root="./" - Path to the project root directory
1919
* @property {string|Symbol} edition - The name of the edition npm package or a Symbol for no install

packages/cli/bin/cli-actions/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ const buildPatterns = require('../build');
33
const resolveConfig = require('../resolve-config');
44
const { error, info, wrapAsync } = require('../utils');
55

6-
const build = options =>
7-
wrapAsync(function*() {
6+
const build = (options) =>
7+
wrapAsync(function* () {
88
try {
99
const config = yield resolveConfig(options.parent.config);
1010
yield buildPatterns(config, options);

packages/cli/bin/cli-actions/disable.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const writeJsonAsync = require('../utils').writeJsonAsync;
1010
* @desc Handles deactivation of starterkits/plugins
1111
* @param {object} options
1212
*/
13-
const enable = options =>
14-
wrapAsync(function*() {
13+
const enable = (options) =>
14+
wrapAsync(function* () {
1515
const {
1616
parent: { config: configPath },
1717
plugins,
@@ -24,7 +24,7 @@ const enable = options =>
2424
spinner.succeed(
2525
`⊙ patternlab → Disable following plugins: ${plugins.join(', ')}`
2626
);
27-
plugins.map(plugin => {
27+
plugins.map((plugin) => {
2828
if (_.has(config, `plugins[${plugin}]`)) {
2929
_.set(config, `plugins[${plugin}]['enabled']`, false);
3030
spinner.succeed(

packages/cli/bin/cli-actions/enable.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const writeJsonAsync = require('../utils').writeJsonAsync;
1010
* @desc Handles activation of starterkits/plugins
1111
* @param {object} options
1212
*/
13-
const enable = options =>
14-
wrapAsync(function*() {
13+
const enable = (options) =>
14+
wrapAsync(function* () {
1515
const {
1616
parent: { config: configPath },
1717
plugins,
@@ -24,7 +24,7 @@ const enable = options =>
2424
spinner.succeed(
2525
`⊙ patternlab → Enable following plugins: ${plugins.join(', ')}`
2626
);
27-
plugins.map(plugin => {
27+
plugins.map((plugin) => {
2828
if (_.has(config, `plugins[${plugin}]`)) {
2929
_.set(config, `plugins[${plugin}]['enabled']`, true);
3030
spinner.succeed(`⊙ patternlab → Enabled following plugin: ${plugin}`);

packages/cli/bin/cli-actions/export.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ const archive = require('../archive');
33
const resolveConfig = require('../resolve-config');
44
const wrapAsync = require('../utils').wrapAsync;
55

6-
const _export = options =>
7-
wrapAsync(function*() {
6+
const _export = (options) =>
7+
wrapAsync(function* () {
88
const config = yield resolveConfig(options.parent.config);
99
archive(config);
1010
});

packages/cli/bin/cli-actions/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const defaultPatternlabConfig = patternlab.getDefaultConfig();
1616
// https://github.com/TehShrike/deepmerge#overwrite-array
1717
const overwriteMerge = (destinationArray, sourceArray, options) => sourceArray;
1818

19-
const init = options =>
20-
wrapAsync(function*() {
19+
const init = (options) =>
20+
wrapAsync(function* () {
2121
const sourceDir = 'source';
2222
const publicDir = 'public';
2323
const exportDir = 'pattern_exports';

packages/cli/bin/cli-actions/install.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const writeJsonAsync = require('../utils').writeJsonAsync;
1111
* @desc Handles async install and activation of starterkits/plugins
1212
* @param {object} options
1313
*/
14-
const install = options =>
15-
wrapAsync(function*() {
14+
const install = (options) =>
15+
wrapAsync(function* () {
1616
const config = yield resolveConfig(options.parent.config);
1717

1818
const spinner = ora(
@@ -21,8 +21,8 @@ const install = options =>
2121

2222
if (options.starterkits && Array.isArray(options.starterkits)) {
2323
const starterkits = yield Promise.all(
24-
options.starterkits.map(starterkit =>
25-
wrapAsync(function*() {
24+
options.starterkits.map((starterkit) =>
25+
wrapAsync(function* () {
2626
spinner.text = `⊙ patternlab → Installing starterkit: ${starterkit}`;
2727
return yield installStarterkit(
2828
{
@@ -42,8 +42,8 @@ const install = options =>
4242
}
4343
if (options.plugins && Array.isArray(options.plugins)) {
4444
const plugins = yield Promise.all(
45-
options.plugins.map(plugin =>
46-
wrapAsync(function*() {
45+
options.plugins.map((plugin) =>
46+
wrapAsync(function* () {
4747
return yield installPlugin(
4848
{
4949
name: plugin,

packages/cli/bin/cli-actions/serve.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ const resolveConfig = require('../resolve-config');
33
const servePatterns = require('../serve');
44
const wrapAsync = require('../utils').wrapAsync;
55

6-
const serve = options =>
7-
wrapAsync(function*() {
6+
const serve = (options) =>
7+
wrapAsync(function* () {
88
const config = yield resolveConfig(options.parent.config);
99
servePatterns(config, options);
1010
});

0 commit comments

Comments
 (0)