{"id":17820564,"url":"https://github.com/deftomat/opinionated","last_synced_at":"2025-03-18T07:31:24.532Z","repository":{"id":33153807,"uuid":"152854337","full_name":"deftomat/opinionated","owner":"deftomat","description":"Opinionated tooling for JavaScript \u0026 TypeScript projects.","archived":false,"fork":false,"pushed_at":"2024-09-06T10:43:46.000Z","size":950,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T08:16:35.922Z","etag":null,"topics":["eslint","opinionated","pre-commit","prettier","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@deftomat/opinionated","language":"TypeScript","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/deftomat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2018-10-13T09:05:03.000Z","updated_at":"2024-07-09T19:14:44.000Z","dependencies_parsed_at":"2023-01-14T23:41:58.671Z","dependency_job_id":"ac5e61f1-0b6b-4639-ae8f-149065c752d5","html_url":"https://github.com/deftomat/opinionated","commit_stats":{"total_commits":115,"total_committers":2,"mean_commits":57.5,"dds":0.04347826086956519,"last_synced_commit":"3684c67c5f4a565ce13c3f2b6484273c6abaae40"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftomat%2Fopinionated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftomat%2Fopinionated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftomat%2Fopinionated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftomat%2Fopinionated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deftomat","download_url":"https://codeload.github.com/deftomat/opinionated/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910814,"owners_count":20367545,"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":["eslint","opinionated","pre-commit","prettier","typescript"],"created_at":"2024-10-27T17:06:24.606Z","updated_at":"2025-03-18T07:31:23.344Z","avatar_url":"https://github.com/deftomat.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eOpinionated 🙏\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003eOpinionated tooling for JavaScript \u0026 TypeScript projects.\u003c/h3\u003e\n\n## Why?\n\nBecause orchestrating all the tools, linters, formatters, etc. in each project can took a long time\nand their configuration will differ more and more as you will copy it between multiple projects.\n\n**Opinionated** provides everything in one place and upgrading your tool chain is as easy as upgrading the dependency version.\n\n## Installation\n\n```\n$ yarn add @deftomat/opinionated --dev\n```\n\nor\n\n```\n$ npm install @deftomat/opinionated --include=dev\n```\n\n## Usage\n\nTool provides the following commands:\n\n### \u003e Pre-commit\n\n```\n$ opinionated pre-commit\n```\n\nPre-commit command will try to run simple, auto-fixable operations on staged files.\nOperations includes common ESLint rules, Prettier, etc.\n\nCommand is designed to be opaque and hassle free, so theoretically, pre-commit check should pass for 99% of commits without any error or warning.\n\n### \u003e Checkup\n\n```\n$ opinionated checkup\n```\n\nCheckup command allows you to keep your project in top shape.\n\nCommand includes:\n\n- **Engine check** - Ensures that you are using the right NodeJS version.\n- **Integrity** - (yarn only) Ensures that dependencies are installed properly.\n- **Dependency duplicates check** - (yarn only) Ensures no unnecessary dependency duplicates. Especially useful for monorepos.\n- **Linter** - Strict ESLint rules.\n- **TypeScript check** - Detects type errors and unused code.\n- **Formatting** - Runs Prettier.\n\nCommand is aware of _yarn workspaces_ and is able to run checks on whole monorepo or just in one package.\nTo run checks in all packages, just run it in project's root. To run checks in one package, you need to run it in package's directory.\n\n\u003e 💡 We recommend to run this command before pull requests and deployments.\n\n### \u003e Ensure configs\n\n```\n$ opinionated ensure-configs\n```\n\nCommand will add the following configs if necessary:\n\n- [EditorConfig](https://editorconfig.org/) - Makes sure that every developer use the same indentation, charset, EOF, etc.\n- [Prettier](https://prettier.io/) - Makes sure that every supported editor use the same auto-formatting rules.\n\n\u003e 💡 This command is usually not necessary as every other command runs it by default.\n\n## Integration into project\n\nTo integrate the tool into your project, we recommend the following `packages.json`:\n\n```\n{\n  ...\n  \"scripts\": {\n    \"checkup\": \"opinionated checkup\",\n    \"prepare\": \"husky install\"\n  },\n  \"devDependencies\": {\n    \"@deftomat/opinionated\": \"^1.0.0\",\n    \"husky\": \"^8.0.0\"\n  }\n  ...\n}\n```\n\nThis configuration allows you to automatically run _pre-commit_ check before each commit (via [Husky](https://github.com/typicode/husky) git hook) and provides `yarn checkup` to easily run _checkup_ command.\n\n## Custom ESLint rules\n\nIf you need to alter the predefined ESLint rules, just follow the [ESLint configuration guide](https://eslint.org/docs/user-guide/configuring).\n\nAny rule specified in your configuration file will be merged over build-in configuration. This allows you to add/edit/remove any rule you want.\n\n## Ignoring files and directories\n\nAs tool is using ESLint and Prettier, you can follow their guidelines to ignore any file or directory.\n\nHowever, when tool detects, that there are no _.ignore_ file for these tools, then it tries to use `.opinionatedignore`\nfile which will be applied to both ESLint and Prettier. If there is no `.opinionatedignore`, then `.gitignore` will be used.\n\n**Resolution order for ESLint:**\n\n- `.eslintignore`\n- `eslintIgnore` property in `package.json`\n- `.opinionatedignore`\n- `.gitignore`\n\n**Resolution order for Prettier:**\n\n- `.prettierignore`\n- `.opinionatedignore`\n- `.gitignore`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeftomat%2Fopinionated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeftomat%2Fopinionated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeftomat%2Fopinionated/lists"}