{"id":16355964,"url":"https://github.com/timobechtel/style","last_synced_at":"2025-04-29T19:41:10.536Z","repository":{"id":206843117,"uuid":"716660091","full_name":"TimoBechtel/style","owner":"TimoBechtel","description":"Highly opinionated config files (Prettier, ESLint, TSConfig)","archived":false,"fork":false,"pushed_at":"2025-01-08T16:05:09.000Z","size":424,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-11T07:34:48.152Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimoBechtel.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":"2023-11-09T15:48:01.000Z","updated_at":"2025-01-23T21:45:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"9050fcb0-0ec6-4114-95fd-ced8ab0998b1","html_url":"https://github.com/TimoBechtel/style","commit_stats":null,"previous_names":["timobechtel/style"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimoBechtel%2Fstyle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimoBechtel%2Fstyle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimoBechtel%2Fstyle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimoBechtel%2Fstyle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimoBechtel","download_url":"https://codeload.github.com/TimoBechtel/style/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251371067,"owners_count":21578946,"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-10-11T01:42:15.935Z","updated_at":"2025-04-29T19:41:10.484Z","avatar_url":"https://github.com/TimoBechtel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Style 🛼\n\n\u003e Roll in style.\n\nHighly opinionated configuration files for typescript projects. Inspired by [@vercel/style-guide](https://github.com/vercel/style-guide)\n\n\u003e [!WARNING]  \n\u003e Make sure to first commit your code before running the following commands. To allow you to easily revert the changes.\n\n## Usage\n\n```bash\nnpm i -D @timobechtel/style prettier \"eslint@^8.57.1\" typescript\n```\n\n### Prettier\n\n```bash\ncurl -O https://raw.githubusercontent.com/TimoBechtel/style/refs/heads/main/templates/.prettierrc\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eExtend / customize config\u003c/summary\u003e\n\n  Need to extend the config, e.g. adding plugins?\n\n  ```bash\n  curl -O https://raw.githubusercontent.com/TimoBechtel/style/refs/heads/main/templates/.prettierrc.mjs\n  ```\n\n  Create a .prettierrc.mjs file and import the config, like this:\n  \n  ```js\n  import config from '@timobechtel/style/prettier/index.mjs';\n\n  /**\n   * @type {import(\"prettier\").Config}\n   */\n  export default {\n    ...config,\n    // your config\n  }\n  ```\n  \n\u003c/details\u003e\n\n### Typescript\n\n```bash\ncurl -O https://raw.githubusercontent.com/TimoBechtel/style/refs/heads/main/templates/tsconfig/core/tsconfig.json\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eOr manually\u003c/summary\u003e\n\n  Copy to `tsconfig.json`:\n\n  ```json\n  { \n    \"extends\": \"@timobechtel/style/tsconfig/core\"\n  }\n  ```\n\n  \u003c/details\u003e\n\n#### Or with React\n\n```bash\ncurl -O https://raw.githubusercontent.com/TimoBechtel/style/refs/heads/main/templates/tsconfig/react/tsconfig.json\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eOr manually\u003c/summary\u003e\n\n  Copy to `tsconfig.json`:\n\n  ```json\n  { \n    \"extends\": \"@timobechtel/style/tsconfig/react\"\n  }\n  ```\n\n  \u003c/details\u003e\n\n### Eslint\n\n```bash\ncurl -O https://raw.githubusercontent.com/TimoBechtel/style/refs/heads/main/templates/eslint/core/.eslintrc.cjs\n```\n\n#### Fix Parsing errors for config files\n\nYou may get a `Parsing error: \u003cFILE\u003e was not found by the project service.` for config files like .eslintrc.cjs when not included in the tsconfig.\n\nTo fix, either add to tsconfig or add them to the eslint config:\n\n```diff\n  //...\n  parserOptions: {\n+    projectService: {\n+      allowDefaultProject: ['.eslintrc.cjs'],\n+    },\n    //...\n  },\n  //...\n```\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eOr manually\u003c/summary\u003e\n\n  Copy the following to a `.eslintrc.cjs`:\n\n  ```js\n  const { resolve } = require('node:path');\n\n  const project = resolve(process.cwd(), 'tsconfig.json');\n\n  module.exports = {\n    root: true,\n    extends: [require.resolve('@timobechtel/style/eslint/core.cjs')],\n    parserOptions: {\n      tsconfigRootDir: process.cwd(),\n    },\n    settings: {\n      'import/resolver': {\n        typescript: {\n          project,\n        },\n      },\n    },\n  };\n  ```\n\n\u003c/details\u003e\n\n#### React\n\n```bash\ncurl -O https://raw.githubusercontent.com/TimoBechtel/style/refs/heads/main/templates/eslint/react/.eslintrc.cjs\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eOr manually\u003c/summary\u003e\n  \n  Also add `require.resolve('@timobechtel/style/eslint/react.cjs')` to the `extends` array.\n\n  Example config:\n  \u003chttps://raw.githubusercontent.com/TimoBechtel/style/refs/heads/main/templates/eslint/react/.eslintrc.cjs\u003e\n\u003c/details\u003e\n\n#### VSCode\n\nNote: You should disable `source.organizeImports` in your VSCode config, as this collides with the `import/order` rule.\n\nAdd the following to your VSCode config, e.g. `.vscode/settings.json`\n\n```json\n{\n  \"editor.codeActionsOnSave\": {\n    // use eslint import/order instead\n    \"source.sortImports\": \"never\"\n  }\n}\n```\n\n### semantic-release\n\nThis repo also contains a [semantic-release](https://github.com/semantic-release/semantic-release) configuration.\n\n```bash\nnpm i -D semantic-release\n```\n\n```bash\necho '{ \"extends\": \"@timobechtel/style/semantic-release/index.cjs\" }' \u003e .releaserc.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimobechtel%2Fstyle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimobechtel%2Fstyle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimobechtel%2Fstyle/lists"}