{"id":19123026,"url":"https://github.com/digitalbazaar/eslint-config-digitalbazaar","last_synced_at":"2025-05-05T18:33:28.907Z","repository":{"id":37933969,"uuid":"168357804","full_name":"digitalbazaar/eslint-config-digitalbazaar","owner":"digitalbazaar","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-02T19:56:42.000Z","size":86,"stargazers_count":2,"open_issues_count":16,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-19T11:08:37.379Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalbazaar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2019-01-30T14:37:17.000Z","updated_at":"2024-05-02T19:56:46.000Z","dependencies_parsed_at":"2024-05-02T15:31:29.667Z","dependency_job_id":"99a9492c-2a94-4bae-b930-f42961318bda","html_url":"https://github.com/digitalbazaar/eslint-config-digitalbazaar","commit_stats":{"total_commits":200,"total_committers":8,"mean_commits":25.0,"dds":0.61,"last_synced_commit":"20db0baecaf92e1294b7fe394306622cf911b255"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Feslint-config-digitalbazaar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Feslint-config-digitalbazaar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Feslint-config-digitalbazaar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Feslint-config-digitalbazaar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalbazaar","download_url":"https://codeload.github.com/digitalbazaar/eslint-config-digitalbazaar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252552928,"owners_count":21766798,"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":[],"created_at":"2024-11-09T05:23:58.779Z","updated_at":"2025-05-05T18:33:28.887Z","avatar_url":"https://github.com/digitalbazaar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## eslint-config-digitalbazaar\n\nThis package provides eslint rules used by Digital Bazaar as a set of extendable shared configs.\n\nThere are 6 rule sets:\n1. `eslint-config-digitalbazaar`: Base rules for both node and the browser.\n2. `eslint-config-digitalbazaar/import`: Rules for es6 imports in the browser and node.\n3. `eslint-config-digitalbazaar/jsdoc`: Rules for JSDoc for both node and the browser.\n4. `eslint-config-digitalbazaar/module`: Rules for modules for both node and the browser.\n5. `eslint-config-digitalbazaar/vue`: Rules for Vue 2 projects and browser only.\n6. `eslint-config-digitalbazaar/vue3`: Rules for Vue 3 projects and browser only.\n\n\n## Installation\n\nIf you do not have eslint installed:\n```\nnpm i -D eslint\nnpm i -D eslint-config-digitalbazaar\n```\n\nTo start an eslint config file:\n```\nnpx eslint --init\n```\nor rename a template from the templates dir\n```\ncp node_modules/eslint-config-digitalbazaar/templates/node.js ./.eslintrc.cjs\n```\n\n## Usage\n\nAll rules can be accessed via the shorthand `digitalbazaar`\nor using the full module name `eslint-config-digitalbazaar`.\n\nEslint's documentation on [shareable configs](https://eslint.org/docs/developer-guide/shareable-configs) can be found here.\n\nExample .eslintrc.cjs root setup:\n```js\nmodule.exports = {\n  root: true,\n  // using full module name\n  extends: ['eslint-config-digitalbazaar']\n}\n```\n\n### Imports\n\nTo use the import rules you need to install [`eslint-plugin-import`](https://github.com/import-js/eslint-plugin-import):\n\n```\nnpm i -D eslint-plugin-import\n```\n\nExample .eslintrc.cjs import setup:\n```js\nmodule.exports = {\n  extends: ['digitalbazaar/import']\n}\n```\n\n### JSDoc\n\nTo use the JSDoc rules you will need to install [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc):\n```\nnpm i -D eslint-plugin-jsdoc\n```\n\nExample .eslintrc.cjs JSDoc setup:\n```js\nmodule.exports = {\n  // only the JSDoc rules and any rules in parent dirs\n  extends: ['digitalbazaar/jsdoc']\n}\n```\n\n### Modules\n\nTo use ES module code rather than CommonJS, you will need to install [`eslint-plugin-unicorn`](https://github.com/sindresorhus/eslint-plugin-unicorn):\n```\nnpm i -D eslint-plugin-unicorn\n```\n\nExample .eslintrc.cjs ESM setup:\n```js\nmodule.exports = {\n  // only the module rules and any rules in parent dirs\n  extends: ['digitalbazaar/module']\n}\n```\n\n### Vue 2\n\nTo use the Vue 2 rules you will need to install [`eslint-plugin-vue`](https://eslint.vuejs.org/):\n```\nnpm i -D eslint-plugin-vue\n```\n\nExample .eslintrc.cjs Vue setup:\n```js\nmodule.exports = {\n  // only the vue rules and any rules in parent dirs\n  extends: ['digitalbazaar/vue']\n}\n```\n\nFor command line use you may need to [explicitly enable linting `.vue`\nfiles](https://eslint.vuejs.org/user-guide/#running-eslint-from-the-command-line).\n\n### Vue 3\n\nTo use the Vue 3 rules you will need to install [`eslint-plugin-vue`](https://eslint.vuejs.org/):\n```\nnpm i -D eslint-plugin-vue\n```\n\nExample .eslintrc.cjs Vue setup:\n```js\nmodule.exports = {\n  // only the vue3 rules and any rules in parent dirs\n  extends: ['digitalbazaar/vue3']\n}\n```\n\nFor command line use you may need to [explicitly enable linting `.vue`\nfiles](https://eslint.vuejs.org/user-guide/#running-eslint-from-the-command-line).\n\n### Composition\n\nThe rules do not depend on each other and are composable:\n```js\nmodule.exports = {\n  extends: [\n    'digitalbazaar',\n    'digitalbazaar/jsdoc',\n    'digitalbazaar/module'\n    'digitalbazaar/vue3'\n  ] // 4 rule sets in one file using shorthand.\n}\n```\n\nThe rules can also be used together via [cascade configuration](https://eslint.org/docs/user-guide/configuring).\n\n## Other Rules\n\nOther rules that are not included above but can be useful:\n\n### `unicorn/prefer-node-protocol`\n\nUse `node:module` style for Node.js modules.\n\nSee [`unicorn/prefer-node-protocol`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md).\n\nRequires:\n```\nnpm i -D eslint-plugin-unicorn\n```\n\nRules:\n```js\n  rules: {\n    'unicorn/prefer-node-protocol': 'error'\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Feslint-config-digitalbazaar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalbazaar%2Feslint-config-digitalbazaar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Feslint-config-digitalbazaar/lists"}