{"id":15857828,"url":"https://github.com/ptitet/typescript-eslint-bun-setup","last_synced_at":"2026-04-16T12:38:44.042Z","repository":{"id":246503910,"uuid":"821325309","full_name":"Ptitet/typescript-eslint-bun-setup","owner":"Ptitet","description":"How to setup ESLint with TypeScript and Stylistic for Bun.js projects + the rules I use","archived":false,"fork":false,"pushed_at":"2024-07-20T09:10:58.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T12:47:58.452Z","etag":null,"topics":["boilerplate","bun","eslint","guide","typescript"],"latest_commit_sha":null,"homepage":"","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/Ptitet.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-06-28T09:37:03.000Z","updated_at":"2024-07-20T09:11:01.000Z","dependencies_parsed_at":"2024-12-14T12:37:43.642Z","dependency_job_id":null,"html_url":"https://github.com/Ptitet/typescript-eslint-bun-setup","commit_stats":null,"previous_names":["ptitet/typescript-eslint-setup","ptitet/typescript-eslint-bun-setup"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ptitet%2Ftypescript-eslint-bun-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ptitet%2Ftypescript-eslint-bun-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ptitet%2Ftypescript-eslint-bun-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ptitet%2Ftypescript-eslint-bun-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ptitet","download_url":"https://codeload.github.com/Ptitet/typescript-eslint-bun-setup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246703913,"owners_count":20820496,"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":["boilerplate","bun","eslint","guide","typescript"],"created_at":"2024-10-05T20:42:12.063Z","updated_at":"2026-04-16T12:38:43.974Z","avatar_url":"https://github.com/Ptitet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Setting up ESLint with TypeScript and ESLint Stylistic for Bun.js projects in VSCode\n\n1. [Create a Bun project](#creating-a-bun-project)\n2. [Install the VSCode ESLint extension](#installing-vscode-eslint-extension)\n3. [Install the dependencies](#installing-the-dependencies)\n4. [Create an `eslint.config.js` file](#creating-an-eslintconfigjs-file)\n\n## Creating a Bun project\n\nOpen a console inside the directory you want and type:\n```sh\nbun init\n```\nThis will create a `node_modules` folder, a `.gitignore` file, a `bun.lockb` file, an `index.ts` file, a `package.json` file, a `README.md` file and a `tsconfig.json` file.\n\nYou can edit `.gitignore`, `index.ts`, `package.json`, `README.md` and `tsconfig.json` as you want.\n\nRead more about the `bun init` command [here](https://bun.sh/docs/cli/init).\n\n## Installing VSCode ESLint extension\n\nVSCode supports ESLint with [this extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint).\n\nTo install it, open VSCode, go to the extensions tab (`Ctrl+Shift+X`), search for `ESLint` and install the extension.\n\n## Installing the dependencies\n\nThe required dependencies are:\n- [ESLint](https://eslint.org/)\n- [TypeScript-ESLint](https://typescript-eslint.io/)\n- [ESLint Stylistic](https://eslint.style/)\n\nInside your project's directory, open a console and type:\n```sh\nbun i -D @eslint/js @types/eslint__js eslint typescript-eslint @stylistic/eslint-plugin\n```\n\n## Creating an `eslint.config.js` file\n\nAt the root of your project, create a file named `eslint.config.js` with the following content:\n\n```js\nimport eslint from '@eslint/js';\nimport stylistic from '@stylistic/eslint-plugin';\nimport tseslint from 'typescript-eslint';\n\nexport default tseslint.config(\n    eslint.configs.recommended,\n    ...tseslint.configs.strictTypeChecked,\n    ...tseslint.configs.stylisticTypeChecked,\n    {\n        plugins: {\n            '@stylistic': stylistic\n        },\n        languageOptions: {\n            parserOptions: {\n                project: true\n            }\n        },\n        // ESLint\n        rules: {}\n    },\n    // TypeScript\n    {\n        rules: {}\n    },\n    // Stylistic\n    {\n        rules: {}\n    }\n);\n```\n\n\u003e I like to keep things separated between ESLint base rules, TypeScript rules and Stylistic rules, but you can put them all in the first `rules` object if you like.\n\nYou can view the rules I use in the [`eslint.config.js` file](./eslint.config.js).\n\n## Using ESLint\n\nWhen you edit a file, the VSCode extension should automatically add a red wavy underline if you broke a rule.\n\nRemember to restart the ESLint server if you change your config. It should restart automatically, but if it crashes, you can do it manually by hitting `Ctrl+Shift+P` then selecting `ESLint: Restart ESLint Server`.\n\nTo view ESLint logs, hit `Ctrl+Shift+P` then select `ESLint: Show Output Channel`.\n\nTo lint all your files, open a console at your project's root, then type:\n```sh\nbunx eslint\n```\n\nYou can also setup a `package.json`'s script to do this for you:\n```jsonc\n{\n    // other props (name, description...)\n    \"scripts\": {\n        \"lint\": \"eslint\"\n    }\n}\n```\nThen simply use:\n```sh\nbun lint\n```\n\n## Rules references\n\n- ESLint : https://eslint.org/docs/latest/rules/\n- TypeScript-ESLint : https://typescript-eslint.io/rules/#rules\n- ESLint Stylistic : https://eslint.style/packages/default#rules\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fptitet%2Ftypescript-eslint-bun-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fptitet%2Ftypescript-eslint-bun-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fptitet%2Ftypescript-eslint-bun-setup/lists"}