Skip to content

Commit

Permalink
Add joaquin-wakin.js (#451)
Browse files Browse the repository at this point in the history
* Create .editorconfig file

* Update index.js

* Update .eslintrc

* Update dependencies and reorder keys

* Update yarn.lock

* Fix indention

* Create prettier.config.js

* Run `yarn lint`

* Create ignore files

* Reinitialize eslint's configuration file

* Revert "Create .editorconfig file"

This reverts commit af07abb.

* Recreate .editorconfig

* Create joaquin-wakin.js

* Add `space-before-function-paren` rule

* Remove excess space

* Optimize package.json
  • Loading branch information
joaquinvaldezzz authored Oct 27, 2021
1 parent ebfd906 commit 49281a8
Show file tree
Hide file tree
Showing 18 changed files with 1,293 additions and 1,120 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = w
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true
},
extends: ['standard'],
parserOptions: {
ecmaVersion: 8
},
rules: {
'space-before-function-paren': ['error', 'never']
}
}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
31 changes: 15 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
const argv = process.argv[2]

const print = console.log

function retrieveData (name) {
try {
const file = require(`./people/${name}.js`)
return file
} catch(e) {
console.error(e)
return 'EMPTY'
}

}

print(retrieveData(argv))
const argv = process.argv[2]

const print = console.log

function retrieveData(name) {
try {
const file = require(`./people/${name}.js`)
return file
} catch (e) {
console.error(e)
return 'EMPTY'
}
}

print(retrieveData(argv))
73 changes: 37 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
{
"name": "hello-open-source",
"version": "1.0.0",
"description": "Repository for beginners that learn to contribute to open source project",
"main": "mazipan.js",
"scripts": {
"lint": "eslint \"./people/*.js\" --ignore-pattern node_modules/",
"lint:fix": "eslint \"./people/*.js\" --ignore-pattern node_modules/ --fix",
"test": "echo \"not implement yet\"",
"purge": "node ./purge"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mazipan/hello-open-source.git"
},
"keywords": [
"open-source",
"beginners",
"contribute"
],
"author": "mazipan",
"license": "MIT",
"bugs": {
"url": "https://github.com/mazipan/hello-open-source/issues"
},
"homepage": "https://github.com/mazipan/hello-open-source#readme",
"devDependencies": {
"eslint": "^5.6.1",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"standard": "^12.0.1"
}
}
{
"name": "hello-open-source",
"version": "1.0.0",
"description": "Repository for beginners that learn to contribute to open source project.",
"keywords": [
"beginners",
"contribute",
"open-source"
],
"homepage": "https://github.com/mazipan/hello-open-source#readme",
"bugs": {
"url": "https://github.com/mazipan/hello-open-source/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mazipan/hello-open-source.git"
},
"license": "MIT",
"author": "mazipan",
"main": "index.js",
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"purge": "node ./purge",
"test": "echo \"not implement yet\"",
"style": "prettier --write ."
},
"devDependencies": {
"eslint": "^7.32.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.1",
"prettier": "^2.4.1",
"standard": "^16.0.4"
}
}
14 changes: 7 additions & 7 deletions people/VasireddyGanesh.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
name: 'Ganesh',
github: 'VasireddyGanesh',
email: '[email protected]',
twitter: '@vasireddyganesh5',
facebook: 'Vasireddy Ganesh',
linkedin: 'in/xxx'
};
name: 'Ganesh',
github: 'VasireddyGanesh',
email: '[email protected]',
twitter: '@vasireddyganesh5',
facebook: 'Vasireddy Ganesh',
linkedin: 'in/xxx'
}
2 changes: 1 addition & 1 deletion people/ZawwarAhmed.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ module.exports = {
twitter: '@SyedZawwarAhmed',
facebook: 'https://www.facebook.com/zawwar.ahmed.3/',
linkedin: 'in/syed-zawwar-ahmed-b7345a1b8/'
};
}
12 changes: 6 additions & 6 deletions people/github_jcmurciap.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
name: 'Camilo',
github: 'jcmurciap',
email: '[email protected]',
twitter: '@xxx',
facebook: 'xxx',
linkedin: 'in/xxx'
name: 'Camilo',
github: 'jcmurciap',
email: '[email protected]',
twitter: '@xxx',
facebook: 'xxx',
linkedin: 'in/xxx'
}
12 changes: 6 additions & 6 deletions people/jcmurciap.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
name: 'Camilo',
github: 'jcmurciap',
email: '[email protected]',
twitter: '@idonothave',
facebook: 'idonthave',
linkedin: 'in/idonthave'
name: 'Camilo',
github: 'jcmurciap',
email: '[email protected]',
twitter: '@idonothave',
facebook: 'idonthave',
linkedin: 'in/idonthave'
}
8 changes: 8 additions & 0 deletions people/joaquin-wakin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
name: 'Joaquin',
github: 'joaquin-wakin',
email: '[email protected]',
twitter: '@wakin_joaquin',
facebook: 'Joaquin Valdez',
linkedin: 'in/joaquin-valdez'
}
14 changes: 7 additions & 7 deletions people/mdatif796.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
name: 'xyz',
github: 'xyz796',
email: '[email protected]',
twitter: '@xxx',
facebook: 'xxx',
linkedin: 'in/xxx'
};
name: 'xyz',
github: 'xyz796',
email: '[email protected]',
twitter: '@xxx',
facebook: 'xxx',
linkedin: 'in/xxx'
}
14 changes: 7 additions & 7 deletions people/pablo-clueless.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
name: 'Samson Okunola',
github: 'pablo-clueless',
email: '[email protected]',
twitter: '@pablo_clueless',
facebook: 'Samson Olawale Okunola',
linkedin: 'in/xxx'
}
name: 'Samson Okunola',
github: 'pablo-clueless',
email: '[email protected]',
twitter: '@pablo_clueless',
facebook: 'Samson Olawale Okunola',
linkedin: 'in/xxx'
}
14 changes: 7 additions & 7 deletions people/rezafikkri.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
name: 'Reza Sariful Fikri',
github: '@rezafikkri',
email: '[email protected]',
twitter: '@FikkriReza',
facebook: 'reza.sariful.fikri',
linkedin: 'in/reza-sariful-fikri-9356ab16a'
};
name: 'Reza Sariful Fikri',
github: '@rezafikkri',
email: '[email protected]',
twitter: '@FikkriReza',
facebook: 'reza.sariful.fikri',
linkedin: 'in/reza-sariful-fikri-9356ab16a'
}
21 changes: 21 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
printWidth: 100,
tabWidth: 2,
useTabs: false,
semi: false,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'none',
bracketSpacing: true,
arrowParens: 'always',
rangeStart: 0,
rangeEnd: Infinity,
requirePragma: false,
insertPragma: false,
proseWrap: 'preserve',
htmlWhitespaceSensitivity: 'css',
vueIndentScriptAndStyle: false,
embeddedLanguageFormatting: 'auto',
endOfLine: 'lf'
}
70 changes: 35 additions & 35 deletions purge.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
const path = require("path");
const fs = require("fs");

const namesToRemove = process.argv.slice(2);

const peoplesPath = path.join(__dirname, "people");

if (!namesToRemove.length) {
fs.readdirSync(peoplesPath).forEach(file => {
if (file.indexOf('mazipan.js') < 0) {
try{
fs.unlinkSync(path.join(peoplesPath, file));
console.log(`Success deleting file: ${file}`);
}catch (e) {
console.error(`Error deleting file: ${file}`);
}
}
});
fs.writeFile(`${peoplesPath}/LAST_UPDATE`, `${new Date().toISOString()}`, function (err) {
if (err) {
console.error(err);
} else {
console.log('File "LAST_UPDATE" is updated successfully.');
}
});
} else {
namesToRemove.forEach(name => {
try {
fs.unlinkSync(path.join(peoplesPath, `${name}.js`));
} catch (e) {
console.error(`Error deleting file for name: ${name}`);
}
});
}
const path = require('path')
const fs = require('fs')

const namesToRemove = process.argv.slice(2)

const peoplesPath = path.join(__dirname, 'people')

if (!namesToRemove.length) {
fs.readdirSync(peoplesPath).forEach((file) => {
if (file.indexOf('mazipan.js') < 0) {
try {
fs.unlinkSync(path.join(peoplesPath, file))
console.log(`Success deleting file: ${file}`)
} catch (e) {
console.error(`Error deleting file: ${file}`)
}
}
})

fs.writeFile(`${peoplesPath}/LAST_UPDATE`, `${new Date().toISOString()}`, function(err) {
if (err) {
console.error(err)
} else {
console.log('File "LAST_UPDATE" is updated successfully.')
}
})
} else {
namesToRemove.forEach((name) => {
try {
fs.unlinkSync(path.join(peoplesPath, `${name}.js`))
} catch (e) {
console.error(`Error deleting file for name: ${name}`)
}
})
}
Loading

0 comments on commit 49281a8

Please sign in to comment.