{"id":18605679,"url":"https://github.com/indec-it/javascript","last_synced_at":"2026-05-19T19:12:42.288Z","repository":{"id":86052964,"uuid":"125392231","full_name":"indec-it/javascript","owner":"indec-it","description":"JavaScript Style Guide","archived":false,"fork":false,"pushed_at":"2019-05-02T16:08:21.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-16T19:47:43.949Z","etag":null,"topics":["arrow-functions","es2015","es6","eslint","javascript","linting","naming-conventions","style-guide","style-linter","styleguide"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indec-it.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-15T16:00:21.000Z","updated_at":"2019-08-13T13:38:39.000Z","dependencies_parsed_at":"2023-03-04T15:15:59.298Z","dependency_job_id":null,"html_url":"https://github.com/indec-it/javascript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/indec-it/javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indec-it%2Fjavascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indec-it%2Fjavascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indec-it%2Fjavascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indec-it%2Fjavascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indec-it","download_url":"https://codeload.github.com/indec-it/javascript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indec-it%2Fjavascript/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265175567,"owners_count":23722661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arrow-functions","es2015","es6","eslint","javascript","linting","naming-conventions","style-guide","style-linter","styleguide"],"created_at":"2024-11-07T02:22:37.649Z","updated_at":"2026-05-19T19:12:42.237Z","avatar_url":"https://github.com/indec-it.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# INDEC JavaScript Style Guide() {\n\n*A mostly reasonable approach to JavaScript*\n\n\u003e **Note**: this guide is base on airbnb guide [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript/blob/master/README.md),\nit reinforces the most important rules and overwrites some of them.\n\n## Table of Contents\n\n  1. [Functions](#functions)\n  1. [Blocks](#blocks)\n  1. [WhiteSpace](#whitespace)\n  1. [ES7](#es7)\n\n## Functions\n \u003ca name=\"methods--naming\"\u003e\u003c/a\u003e\u003ca name=\"1.1\"\u003e\u003c/a\u003e\n  - [1.1](#functions) **Method Naming**: Methods should be named with a verb in infinitive.\n\n```js\n// bad\nfunction validating() {\n    //...\n};\n\n// good\nfunction validate() {\n    // ...\n};\n```\n\n## Blocks\n  \u003ca name=\"blocks--braces\"\u003e\u003c/a\u003e\u003ca name=\"2.1\"\u003e\u003c/a\u003e\n  - [2.1](#blocks--braces) Use braces with all single-line blocks.\n\n```js\n// bad\nif (test) return false;\n\n// good\nif (test) {\n    return false;\n}\n```\n**[⬆ back to top](#table-of-contents)**\n\n## Whitespace\n\n  \u003ca name=\"whitespace--spaces\"\u003e\u003c/a\u003e\u003ca name=\"3.1\"\u003e\u003c/a\u003e\n  - [3.1](#whitespace--spaces) Use soft tabs (space character) set to 4 spaces.\n\n```js\n// bad\nfunction foo() {\n∙let name;\n}\n\n// bad\nfunction bar() {\n∙∙let name;\n}\n\n// good\nfunction baz() {\n∙∙∙∙let name;\n}\n```\n**[⬆ back to top](#table-of-contents)**\n\n## ES7\n   \u003ca name=\"ES7--Async/Await\"\u003e\u003c/a\u003e\u003ca name=\"4.1\"\u003e\u003c/a\u003e\n   - [4.1](#Async/Await) **Async/Await**: use `async/await` instead of `then` (promises)\n\n```js\n// bad\nconst fetchUser = url =\u003e getAuthHeader().then(\n    authorization =\u003e fetch(url, { headers: {authorization} })\n).then(\n    response =\u003e response.json\n).then(\n    data =\u003e new User(data.user)\n)catch(\n    err =\u003e console.log(err);\n);\n\n// good\nconst fetchUser = async url =\u003e {\n    try {\n        const response = await fetch(url, {\n            credentials: 'same-origin',\n            headers: {\n                authorization: await getAuthHeader()\n            }\n        });\n        const data = await response.json();\n        return new User(data.user);\n    } catch (err) {\n        console.log(err);\n        throw err;\n    }\n}\n```\n**[⬆ back to top](#table-of-contents)**\n\n# }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findec-it%2Fjavascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findec-it%2Fjavascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findec-it%2Fjavascript/lists"}