Skip to content

Commit 1bd04c8

Browse files
author
Jaime Ramírez
committed
chore(tools): Added prettier combined with eslint
1 parent b82dcb0 commit 1bd04c8

File tree

10 files changed

+110
-195
lines changed

10 files changed

+110
-195
lines changed

.eslintrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"extends": "airbnb-base",
2+
"extends": ["eslint:recommended", "prettier"],
3+
4+
"plugins": ["prettier"],
35

46
"env": {
57
"browser": true,
@@ -16,6 +18,9 @@
1618
},
1719

1820
"rules": {
21+
"prettier/prettier": [
22+
"error", { "singleQuote": true, "tabWidth": 4 }
23+
],
1924
"no-console": "off",
2025
"max-len": ["error", 120],
2126
"padded-blocks": "off",

bin/create-js-package.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ const yargs = require('yargs');
33
const creator = require('../lib/create-js-package');
44
const { execSync } = require('child_process');
55

6-
76
if (yargs.argv._.length > 0) {
87
const packageName = yargs.argv._[0];
98
console.log('\x1b[36m%s\x1b[0m', '1. Generate files');
109
creator.run(packageName);
1110
console.log('\x1b[33m%s\x1b[0m', '2. Install NPM dependencies');
1211
execSync('npm i', { shell: true, stdio: 'inherit' });
13-
console.log('3. \x1b[32mDONE\x1b[0m', 'Run \x1b[1m npm start \x1b[0m to start your app.');
14-
12+
console.log(
13+
'3. \x1b[32mDONE\x1b[0m',
14+
'Run \x1b[1m npm start \x1b[0m to start your app.'
15+
);
1516
} else {
1617
console.log(`Please specify a name for your application
1718
Example: create-js-package myPackage`);

lib/create-js-package.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
const fs = require('fs-extra');
22
const path = require('path');
33

4-
54
/**
65
* Main functionality
76
*/
87
module.exports = {
9-
108
/**
119
* Runs create-js-package with the given package name
1210
*
@@ -18,13 +16,11 @@ module.exports = {
1816
}
1917
};
2018

21-
2219
function copyTemplateToCurrentDir() {
2320
const originPath = path.join(__dirname, '../template');
2421
fs.copySync(originPath, process.cwd());
2522
}
2623

27-
2824
function setNameInProjectJson(name) {
2925
const packageJsonPath = path.join(process.cwd(), 'package.json');
3026
const packageJsonContents = fs.readJsonSync(packageJsonPath);

0 commit comments

Comments
 (0)