{"id":20476750,"url":"https://github.com/tresjs/eslint-config","last_synced_at":"2025-04-13T12:50:25.853Z","repository":{"id":228168941,"uuid":"773343503","full_name":"Tresjs/eslint-config","owner":"Tresjs","description":"Opinionated ESLint configuration for Tres.js ecosystem","archived":false,"fork":false,"pushed_at":"2025-03-12T23:58:45.000Z","size":195,"stargazers_count":20,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T03:51:18.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Tresjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["tresjs","alvarosabu"]}},"created_at":"2024-03-17T12:15:31.000Z","updated_at":"2024-10-01T15:09:42.000Z","dependencies_parsed_at":"2024-03-17T12:26:20.389Z","dependency_job_id":"22518390-8b08-477d-9823-7bc041c5311b","html_url":"https://github.com/Tresjs/eslint-config","commit_stats":null,"previous_names":["tresjs/eslint-config"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tresjs%2Feslint-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tresjs%2Feslint-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tresjs%2Feslint-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tresjs%2Feslint-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tresjs","download_url":"https://codeload.github.com/Tresjs/eslint-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717252,"owners_count":21150388,"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-15T15:22:50.654Z","updated_at":"2025-04-13T12:50:25.826Z","avatar_url":"https://github.com/Tresjs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/tresjs","https://github.com/sponsors/alvarosabu"],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\u003cimg src=\".github/repo-banner.png\" /\u003e\u003c/picture\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![npm version][npm-version-src]][npm-version-href]\n[![License][license-src]][license-href]\n[![code style][antfu-src]][antfu-href]\n\n---\n\n\u003c/div\u003e\n\n\u003e Opinionated but flexible ESlint config, based on `@antfu/eslint-config` with TresJS preferences. Also includes optional rulesets for Nuxt.\n\n[Release Notes](/CHANGELOG.md)\n\n## Features\n\nThis is my personal ESlint configuration, based on the excellent [`@antfu/eslint-config`](https://github.com/antfu/eslint-config). It only deviates for some minor tweaks and personal preferences, since I agree almost completely with Anthony's style choices.\n\nMy config also adds some additional and optional rulesets for Nuxt.\n\nSome of the main features, inherited directly from `@antfu/eslint-config`:\n\n- Single quotes, no semi\n- Auto fix for formatting (aimed to be used standalone **without** Prettier)\n- Sorted imports, dangling commas\n- Reasonable defaults, best practices, only one line of config\n- Designed to work with TypeScript, JSX, Vue out-of-box\n- Lints also for json, yaml, toml, markdown\n- Opinionated, but [very customizable](#customization)\n- [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), compose easily!\n- Using [ESLint Stylistic](https://github.com/eslint-stylistic/eslint-stylistic)\n- Respects `.gitignore` by default\n- Optional [React](#react), [Svelte](#svelte), [UnoCSS](#unocss), [Astro](#astro) support\n- Optional [formatters](#formatters) support for CSS, HTML, etc.\n- **Style principle**: Minimal for reading, stable for diff, consistent\n\nMy own customizations and preferences:\n\n- (Vue) Set maximum allowed attributes per line on HTML elements (`10` for singleline, `1` for multiline)\n- (General) Force use of curly braces on control statements\n- (General) Disable `antfu/top-level-function` to allow arrow syntax on top level functions\n- (Nuxt - *Optional*) Set some specific Nuxt rules if not already covered by Antfu's config (sourced from `@nuxt/eslint-config`)\n- ... and some other minor tweaks\n\n## 🛠️ Setup\n\n### Installation\n\n```bash\npnpm i -D eslint @tresjs/eslint-config\n```\n\n### Configuration\n\nWith [`\"type\": \"module\"`](https://nodejs.org/api/packages.html#type) in `package.json` (recommended):\n\n#### Basic use\n\nUsing the default config without arguments uses the following `@antfu/eslint-config` options as defaults:\n\n- autodetects Vue\n- autodetects Typescript\n- enables ESlint Stylistic\n\n```js\n// eslint.config.js\nimport { tresLintConfig } from '@tresjs/eslint-config'\n\nexport default tresLintConfig()\n```\n\n#### Setting options and using custom rules\n\nIt is possible to add custom rules with the following configuration.\n\n- The first item must contain options to be passed to `@antfu/eslint-config` (read more on [its docs](https://github.com/antfu/eslint-config) for possible options). **It must always be present even if left empty.**\n- From the second item going on, you can add as many custom ESlint flat config objects as you need.\n\n```js\n// eslint.config.js\nimport { tresLintConfig } from '@tresjs/eslint-config'\n\nexport default tresLintConfig(\n  // @antfu/eslint-config options, must be the first argument\n  {\n    stylistic: false,\n  },\n  // Addtionals flat configs start from here\n  {\n    rules: {\n      curly: 'off',\n    },\n  },\n)\n```\n\n##### Using optional Nuxt\n\nThis package also provides optional configuration for Nuxt. To use it, simply add the `nuxt` config to the list of configs.\n\n```js\n// eslint.config.js\nimport { nuxt, tresLintConfig } from '@tresjs/eslint-config'\n\nexport default tresLintConfig(\n  {}, // @antfu/eslint-config options, must always be present as first item even if empty\n  nuxt,\n  {\n    // ESlint Flat config rule object\n  },\n)\n```\n\n## 📝 VS Code Support\n\nIf you use VS Code, you should manually enable support for ESLint flat config.\n\nInstall [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint).\n\nAdd the following settings to your `.vscode/settings.json`:\n\n```jsonc\n{\n  // Enable the ESLint flat config support\n  \"eslint.experimental.useFlatConfig\": true\n}\n```\n\nFor more settings, check the \"VS Code support\" section in [antfu/eslint-config](https://github.com/antfu/eslint-config#vs-code-support-auto-fix)\n\n## 📝 License\n\n[MIT](https://github.com/tresjs/eslint-config/blob/main/LICENSE)\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/@tresjs/eslint-config/latest.svg?style=flat\u0026colorA=18181B\u0026colorB=88E5C3\n[npm-version-href]: https://npmjs.com/package/@tresjs/eslint-config\n\n[npm-downloads-src]: https://img.shields.io/npm/dm/@tresjs/eslint-config.svg?style=flat\u0026colorA=18181B\u0026colorB=88E5C3\n[npm-downloads-href]: https://npmjs.com/package/@tresjs/eslint-config\n\n[code-quality-src]: https://img.shields.io/codacy/grade/2089b728f6904916aff7a595c4197b09.svg?style=flat\u0026colorA=18181B\u0026colorB=88E5C3\n[code-quality-href]: https://app.codacy.com/gh/tresjs/eslint-config\n\n[bundle-size-src]: https://img.shields.io/bundlephobia/minzip/@tresjs/eslint-config.svg?style=flat\u0026colorA=18181B\u0026colorB=88E5C3\n[bundle-size-href]: https://bundlephobia.com/result?p=@tresjs/eslint-config\n\n[license-src]: https://img.shields.io/npm/l/@tresjs/eslint-config.svg?style=flat\u0026colorA=18181B\u0026colorB=88E5C3\n[license-href]: https://npmjs.com/package/@tresjs/eslint-config\n\n[antfu-src]: https://antfu.me/badge-code-style.svg\n[antfu-href]: https://github.com/antfu/eslint-config\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftresjs%2Feslint-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftresjs%2Feslint-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftresjs%2Feslint-config/lists"}