{"id":13596888,"url":"https://github.com/eslint-types/eslint-define-config","last_synced_at":"2025-05-14T06:13:42.840Z","repository":{"id":37062021,"uuid":"351072958","full_name":"eslint-types/eslint-define-config","owner":"eslint-types","description":"Provide a defineConfig function for .eslintrc.js files","archived":true,"fork":false,"pushed_at":"2025-03-07T22:19:15.000Z","size":3515,"stargazers_count":365,"open_issues_count":17,"forks_count":26,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-09T01:36:37.954Z","etag":null,"topics":["config","configuration","define-config","eslint","eslint-config","eslintconfig","typed","typescript"],"latest_commit_sha":null,"homepage":"","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/eslint-types.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["Shinigami92"],"custom":["https://www.paypal.com/donate?hosted_button_id=L7GY729FBKTZY"]}},"created_at":"2021-03-24T12:33:11.000Z","updated_at":"2025-03-07T22:53:22.000Z","dependencies_parsed_at":"2024-11-06T21:36:19.240Z","dependency_job_id":"78be05a8-1b97-4f76-acdc-ddd5bb069fc1","html_url":"https://github.com/eslint-types/eslint-define-config","commit_stats":{"total_commits":569,"total_committers":21,"mean_commits":"27.095238095238095","dds":"0.18629173989455183","last_synced_commit":"c6ed90b473edbcb28831ed9cc873b0380714e0af"},"previous_names":["eslint-types/eslint-define-config","shinigami92/eslint-define-config"],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint-types%2Feslint-define-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint-types%2Feslint-define-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint-types%2Feslint-define-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint-types%2Feslint-define-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eslint-types","download_url":"https://codeload.github.com/eslint-types/eslint-define-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254083590,"owners_count":22011901,"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":["config","configuration","define-config","eslint","eslint-config","eslintconfig","typed","typescript"],"created_at":"2024-08-01T16:02:54.834Z","updated_at":"2025-05-14T06:13:42.820Z","avatar_url":"https://github.com/eslint-types.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Shinigami92","https://www.paypal.com/donate?hosted_button_id=L7GY729FBKTZY"],"categories":["TypeScript","typescript"],"sub_categories":[],"readme":"\u003cp\u003e\n  \u003ca href=\"https://www.npmjs.com/package/eslint-define-config\" target=\"_blank\"\u003e\n    \u003cimg alt=\"NPM package\" src=\"https://img.shields.io/npm/v/eslint-define-config.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/eslint-define-config\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Downloads\" src=\"https://img.shields.io/npm/dt/eslint-define-config.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/eslint-types/eslint-define-config/actions/workflows/ci.yml\"\u003e\n    \u003cimg alt=\"Build Status\" src=\"https://github.com/eslint-types/eslint-define-config/actions/workflows/ci.yml/badge.svg?branch=main\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/eslint-types/eslint-define-config/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/github/license/eslint-types/eslint-define-config.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://prettier.io\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Code Style: Prettier\" src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.paypal.com/donate?hosted_button_id=L7GY729FBKTZY\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Donate: PayPal\" src=\"https://img.shields.io/badge/Donate-PayPal-blue.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# eslint-define-config\n\nProvide a `defineConfig` function for `.eslintrc.js`, and a `defineFlatConfig` function for `eslint.config.js` files.\n\n# Installation\n\n```bash\n# add eslint and eslint-define-config to project’s dev dependencies\nnpm add --save-dev eslint eslint-define-config\n# or\nyarn add --dev eslint eslint-define-config\n# or\npnpm add --save-dev eslint eslint-define-config\n```\n\n# Usage\n\nBy default only `eslint`'s rules are supported. To activate auto-suggestions for Rules of specific plugins, you need to install the respective types for that plugin.  \nPlugins can either support their own types, or they could be supported by the community in the [`@eslint-types`](https://github.com/eslint-types/define-config-plugin-types) repository.\n\nA list of community supported plugins can be found [here](https://www.npmjs.com/org/eslint-types).\n\n`.eslintrc.js`\n\n```ts\n// @ts-check\nconst { defineConfig } = require('eslint-define-config');\n\n/// \u003creference types=\"@eslint-types/typescript-eslint\" /\u003e\n\nmodule.exports = defineConfig({\n  root: true,\n  rules: {\n    // rules...\n  },\n});\n```\n\n## Flat Config\n\n`eslint.config.js`\n\n```ts\n// @ts-check\nconst { defineFlatConfig } = require('eslint-define-config');\nconst js = require('@eslint/js');\nconst customConfig = require('./custom-config.js');\n\n/// \u003creference types=\"@eslint-types/typescript-eslint\" /\u003e\n\nmodule.exports = defineFlatConfig([\n  js.configs.recommended,\n  customConfig,\n  {\n    plugins: {\n      // plugins...\n    },\n    rules: {\n      // rules...\n    },\n  },\n]);\n```\n\n# Why?\n\nImprove your eslint configuration experience with:\n\n- auto-suggestions\n- type checking (Use `// @ts-check` at the first line in your `.eslintrc.js` or `eslint.config.js`)\n- documentation\n- deprecation warnings\n\n\u003cimg src=\"https://user-images.githubusercontent.com/7195563/112484789-8a416480-8d7a-11eb-9337-d8b5bc16de17.png\" alt=\"Image\" width=\"600px\"/\u003e\n\n## Video\n\n_Click on the thumbnail to play the video_\n\n\u003ca href=\"https://user-images.githubusercontent.com/7195563/112726158-4a19e780-8f1c-11eb-8cc6-4ea6c100137f.mp4\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/7195563/112726343-30c56b00-8f1d-11eb-9b92-260c530caf1b.png\" alt=\"Video\" width=\"600px\"/\u003e\n\u003c/a\u003e\n\n## Want to support your own plugin?\n\n:warning: **This feature is very new and requires the support of the respective plugin owners**\n\nAdd a `declare module` to your plugin package like this:\n\n```ts\ndeclare module 'eslint-define-config' {\n  export interface CustomRuleOptions {\n    /**\n     * Require consistently using either `T[]` or `Array\u003cT\u003e` for arrays.\n     *\n     * @see [array-type](https://typescript-eslint.io/rules/array-type)\n     */\n    '@typescript-eslint/array-type': [\n      {\n        default?: 'array' | 'generic' | 'array-simple';\n        readonly?: 'array' | 'generic' | 'array-simple';\n      },\n    ];\n\n    // ... more Rules\n  }\n}\n```\n\nThere are other interfaces that can be extended.\n\n- `CustomExtends`\n- `CustomParserOptions`\n- `CustomParsers`\n- `CustomPlugins`\n- `CustomSettings`\n\n# Credits\n\n- [Proposal Idea](https://github.com/eslint/eslint/issues/14249)\n- [Vite](https://github.com/vitejs/vite) and [Evan You](https://github.com/yyx990803) for the idea\n- [@antfu](https://github.com/antfu) and his [tweet](https://twitter.com/antfu7/status/1365907188338753536)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feslint-types%2Feslint-define-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feslint-types%2Feslint-define-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feslint-types%2Feslint-define-config/lists"}