{"id":17026459,"url":"https://github.com/daeh/eslint-template","last_synced_at":"2026-02-18T04:33:15.106Z","repository":{"id":207302390,"uuid":"718922192","full_name":"daeh/eslint-template","owner":"daeh","description":"ESLint Flat Config with Stylish Plugin","archived":false,"fork":false,"pushed_at":"2024-10-31T04:26:03.000Z","size":510,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T16:43:42.318Z","etag":null,"topics":["eslint","eslint-config","firebase","prettier","template","typescript","webppl"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/daeh.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":"2023-11-15T04:03:29.000Z","updated_at":"2024-10-31T04:26:07.000Z","dependencies_parsed_at":"2023-11-18T06:23:14.417Z","dependency_job_id":"da8be5cb-02b7-40e8-a719-ff9cd9fd05bf","html_url":"https://github.com/daeh/eslint-template","commit_stats":null,"previous_names":["daeh/eslint-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/daeh/eslint-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daeh%2Feslint-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daeh%2Feslint-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daeh%2Feslint-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daeh%2Feslint-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daeh","download_url":"https://codeload.github.com/daeh/eslint-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daeh%2Feslint-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29568518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T04:18:28.490Z","status":"ssl_error","status_checked_at":"2026-02-18T04:13:49.018Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","eslint-config","firebase","prettier","template","typescript","webppl"],"created_at":"2024-10-14T07:32:48.694Z","updated_at":"2026-02-18T04:33:10.098Z","avatar_url":"https://github.com/daeh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESLint Template\n\nThis is a future-looking configuration that implements the major developments from [ESLint](https://eslint.org).\n\n### ESLint Flat Config System\n\nBeginning in ESLint `v9.0.0`, the default will be the new [flat config system](https://eslint.org/docs/latest/use/configure/configuration-files-new). This will deprecating the `Common.js Module` config system (which uses `.eslintrc.js`), replacing it with the `ES Module` config system (which uses `eslint.config.js`).\n\n### ESLint Stylistic\n\nESLint is [deprecating formatting rules](https://eslint.org/blog/2023/10/deprecating-formatting-rules/), passing over maintenance and development to the community-run plugin [ESLint Stylistic](https://eslint.style/).\n\n## This Example Config\n\nThe main file in this repo is the flat ESLint config, [`eslint.config.mjs`](eslint.config.mjs).\n\nThis project is configured as an `ES Module`, so this config file could be named `eslint.config.js`, but I have given it the `.mjs` extension to make this config work for `Common.js Module` development with minimal reconfiguration.\n\nWhile ESLint has no issue using the `.mjs` config file, at present, IDEs like VS Code and IntelliJ IDEA require the `.js` extension. A simple workaround is to make an alias `eslint.config.js` that points to `eslint.config.mjs`. This is done automatically during install by the `package.json` file.\n\nThis project uses **TypeScript** and **Prettier**, which are configured in `tsconfig.json` and `prettier.config.mjs`. The ESLint config integrates these configurations.\n\n### WebPPL\n\nI have included an example of how to use ESLint to format [WebPPL](https://webppl.readthedocs.io/en/master/) code. All of the WebPPL-specific configuration can be removed if not desired without affecting the linting and formatting of JavaScript and TypeScript.\n\n## Installation\n\n- Fork this repo: `Use this template` \u003e `Create a new repository`\n- Git clone the forked repo\n- Enter the repo folder\n\n- Install the dependencies using [Yarn](https://yarnpkg.com/), e.g.\n\n```shell\n### Clone your forked repo to the current working directory\n### Replace `daeh/eslint-template` with your username and repo name\ngit clone --branch main https://github.com/daeh/eslint-template.git eslint-template\n\n### Enter the new directory\ncd eslint-template || exit\n\n### Install Node packages\nyarn install\n```\n\n### VS Code Settings\n\nFor [VS Code](https://code.visualstudio.com/) to respect the configuration, you need to specify the formatter for the relevant files. This is done for you in [`VSCodeProject.code-workspace`](VSCodeProject.code-workspace) and in [`.vscode/settings.json`](.vscode/settings.json) (these are redundant, you only need one). This configures the [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension to use the flat config system, makes VS Code use the [Prettier - Code Formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) extensions for formatting Javascript, HTML, JSON, and CSS files, and lets ESLint format WebPPL files. This obviously requires the [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) extensions to be enabled for the workspace. Activate the `VSCodeProject.code-workspace` via `File \u003e Open Workspace from File...` (or by double clicking it), activate `.vscode` via `File \u003e Open Folder...` in VS Code.\n\nThe relevant settings are:\n\n```json\n{\n    \"editor.codeActionsOnSave\": {\n      \"source.fixAll.eslint\": \"explicit\"\n    },\n    \"files.associations\": {\n      \"*.wppl\": \"javascript\"\n    },\n    \"[javascript][javascriptreact][typescript]\": {\n      \"editor.defaultFormatter\": \"dbaeumer.vscode-eslint\"\n    },\n    \"[wppl]\": {\n      \"editor.defaultFormatter\": \"dbaeumer.vscode-eslint\"\n    },\n    \"[html]\": {\n      \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n    },\n    \"[json][jsonc]\": {\n      \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n    },\n    \"[css][scss][less]\": {\n      \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n    },\n    \"eslint.useFlatConfig\": true,\n    \"typescript.enablePromptUseWorkspaceTsdk\": true,\n}\n```\n\n### IntelliJ IDEA Settings\n\nFor [IntelliJ IDEA](https://www.jetbrains.com/idea/) / [WebStorm](https://www.jetbrains.com/webstorm/) to respect the configuration, you need to enable ESLint and Prettier for the relevant filetypes. There is an example config in `.idea`. To enable ESLing and Prettier manually:\n\n- `Settings... \u003e Languages \u0026 Frameworks \u003e JavaScript \u003e Code Quality Tools \u003e ESLint`\n  - Enable `Automatic ESLint configuration`\n  - Enable `Run eslint --fix on save`\n  - Add the additional filetypes to the `Run for files` field:\n    - `{**/*,*}.{ts,mts,cts,tsx,mtsx,js,mjs,cjs,jsx,mjsx,html,wppl}`\n- `Settings... \u003e Languages \u0026 Frameworks \u003e JavaScript \u003e Prettier`\n  - Enable `Automatic Prettier configuration`\n  - Enable `Run on save`\n  - Add the additional filetypes to the `Run for files` field:\n    - `{**/*,*}.{ts,mts,cts,tsx,mtsx,js,mjs,cjs,jsx,mjsx,json,html,css,scss,vue,astro}`\n\nIf you change the project from an `ES Module` to a `Common.js Module`, or if ESLint isn't working, try [this fix from Ditlef Diseth](https://youtrack.jetbrains.com/issue/WEB-61117/ESLint-flat-config-doesnt-work-with-non-default-custom-path-to-the-config-file#focus=Comments-27-8196242.0-0):\n\n- `Settings... \u003e Languages \u0026 Frameworks \u003e JavaScript \u003e Code Quality Tools \u003e ESLint`\n  - Switch to `Manual ESLint configuration`\n  - Add this string to the `Extra ESLint options` field:\n    ```shell\n    ESLINT_USE_FLAT_CONFIG=true yarn eslint --config eslint.config.mjs\n    ```\n\n## Usage\n\nOnce your IDE settings are configured, you should see unused variable warnings in the three test files provided in `src/`.\n\nYou can format, lint and build the project from the command line by calling the commands in `package.json`,\n\n```json\n{\n  \"scripts\": {\n    \"lint\": \"export ESLINT_USE_FLAT_CONFIG=true \u0026\u0026 prettier --config prettier.config.mjs --write . \u0026\u0026 eslint --config eslint.config.mjs --fix . \u0026\u0026 tsc --project tsconfig.json --noEmit\"\n  }\n}\n```\n\nby running `yarn lint`, etc.\n\n## Author\n\n[![Personal Website](https://img.shields.io/badge/personal%20website-daeh.info-orange?style=for-the-badge)](https://daeh.info) [![BlueSky](https://img.shields.io/badge/bsky-@dae.bsky.social-blue?style=for-the-badge)](https://bsky.app/profile/dae.bsky.social) [![Twitter](https://img.shields.io/badge/twitter-@DaeHoulihan-white?style=for-the-badge\u0026logo=twitter)](https://twitter.com/DaeHoulihan)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaeh%2Feslint-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaeh%2Feslint-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaeh%2Feslint-template/lists"}