{"id":22199239,"url":"https://github.com/babbel/eslint-config","last_synced_at":"2025-07-27T02:31:57.063Z","repository":{"id":211159546,"uuid":"721215980","full_name":"babbel/eslint-config","owner":"babbel","description":"Hierarchical ESLint configuration collection that intends to be simple to use, layered, and shared with others","archived":false,"fork":false,"pushed_at":"2024-11-15T16:21:59.000Z","size":343,"stargazers_count":0,"open_issues_count":1,"forks_count":3,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-11-15T17:25:57.180Z","etag":null,"topics":["eslint","eslintconfig","npm"],"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/babbel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"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}},"created_at":"2023-11-20T15:39:09.000Z","updated_at":"2024-11-15T16:20:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9fa683a-ea39-46cf-b750-b9f843fa8b31","html_url":"https://github.com/babbel/eslint-config","commit_stats":null,"previous_names":["babbel/eslint-config"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Feslint-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Feslint-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Feslint-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Feslint-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babbel","download_url":"https://codeload.github.com/babbel/eslint-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227750219,"owners_count":17814129,"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":["eslint","eslintconfig","npm"],"created_at":"2024-12-02T15:13:43.951Z","updated_at":"2024-12-02T15:13:44.834Z","avatar_url":"https://github.com/babbel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NPM module `@babbel/eslint-config`\n\nHierarchical ESLint configuration collection that intends to be simple to use, layered, and shared with others. [(project maintainers)](./MAINTAINERS.md)\n\n## Table of Contents\n\n- [ESLint Configurations](#eslint-configurations)\n- [Base Configuration Assumptions](#base-configuration-assumptions)\n- [Example Usage](#example-usage)\n  - [Browser Environment](#browser-environment)\n  - [Node.js Environment](#nodejs-environment)\n  - [Browser Environment That Uses React, TypeScript, Jest, and a Custom Rule](#browser-environment-that-uses-react-typescript-jest-and-a-custom-rule)\n- [Making Your Own Config From the Base Config 🎓](#making-your-own-config-from-the-base-config-)\n- [Changing This Library](#changing-this-library)\n\n## ESLint Configurations\n\nThere are multiple configurations you can use in your projects listed below. These are meant to be used in combination with one another. Please note that the base configuration is used by all the others, so there's no need to include that in your configuration unless it's the only one you're using.\n\nThe configuration names specified below should be used as items in the `extends` array in your ESLint configuration file. Each configuration string is clickable to bring you to the configuration details.\n\n**It is recommended to not use the `browser`, `isomorphic`, and/or `node` configs simultaneously**\n\n- [`@babbel/eslint-config`](./lib/eslintBaseConfig.json): base configuration that all configurations inherit from\n- [`@babbel/eslint-config/browser`](./lib/eslintBrowserConfig.json): for browser environments (**should always be last in your \"extends\" array**)\n- [`@babbel/eslint-config/bun`](./lib/eslintBunConfig.json): for [Bun](https://bun.sh/) environments (**should always be last in your \"extends\" array**)\n- [`@babbel/eslint-config/isomorphic`](./lib/eslintIsomorphicConfig.json): for isomorphic environments; in other words, using the browser and Node.js simultaneously on the same code (**should always be last in your \"extends\" array**)\n- [`@babbel/eslint-config/jest`](./lib/eslintJestConfig.json): for testing environments using [Jest](https://jestjs.io/)\n- [`@babbel/eslint-config/jsdoc`](./lib/eslintJsdocConfig.json): for documentation enforcement using [JSDoc](https://jsdoc.app/)\n- [`@babbel/eslint-config/jsdoc-typescript`](./lib/eslintJsdocTypescriptConfig.json): for documentation enforcement using [JSDoc](https://jsdoc.app/) and [TypeScript](https://www.typescriptlang.org/)\n- [`@babbel/eslint-config/node`](./lib/eslintNodeConfig.json): for [Node.js](https://nodejs.org/) environments (**should always be last in your \"extends\" array**)\n- [`@babbel/eslint-config/playwright`](./lib/eslintPlaywrightConfig.json): for testing environments using the [Playwright](https://playwright.dev/) test runner (not `jest-playwright`)\n- [`@babbel/eslint-config/preact`](./lib/eslintPreactConfig.json): for [Preact](https://preactjs.com/) environments\n- [`@babbel/eslint-config/preact-typescript`](./lib/eslintPreactTypescriptConfig.json): for [Preact](https://preactjs.com/) environments using [TypeScript](https://www.typescriptlang.org/)\n- [`@babbel/eslint-config/react`](./lib/eslintReactConfig.json): for [React](https://react.dev/) environments\n- [`@babbel/eslint-config/react-typescript`](./lib/eslintReactTypescriptConfig.json): for [React](https://react.dev/) environments using [TypeScript](https://www.typescriptlang.org/)\n- [`@babbel/eslint-config/typescript`](./lib/eslintTypescriptConfig.json): for [TypeScript](https://www.typescriptlang.org/) environments\n\n## Base Configuration Assumptions\n\n- Airbnb style guide configurations used as a guide\n- Extends the `recommended` configuration of the following plugins:\n  - `eslint-plugin-eslint-comments` ([documentation](https://mysticatea.github.io/eslint-plugin-eslint-comments/))\n  - `eslint-plugin-import` ([documentation](https://github.com/import-js/eslint-plugin-import#readme))\n  - `eslint-plugin-regexp` ([documentation](https://github.com/ota-meshi/eslint-plugin-regexp#readme))\n  - `eslint-plugin-unicorn` ([documentation](https://github.com/sindresorhus/eslint-plugin-unicorn#readme))\n- Native ES module-style imports and exports\n\n  - Imports\n\n    - File extensions required like in the spec (e.g. `import { some } from './thing.mjs';`)\n    - Imports declared at the top of each file in ordered groups separated by an empty line\n\n      1. External (e.g. NPM packages) and Node.js built-in (e.g. `node:fs`) imports\n      2. Internal imports (e.g. from your `src/` directory)\n      3. Type imports (e.g. `import type ...`)\n\n      ```js\n      // External Imports\n      import { copyFile } from 'node:fs/promises';\n      import React from 'react';\n\n      // Internal Imports\n      import { logger } from './logger.mjs';\n\n      // Type Imports\n      import type { APIGatewayProxyEvent, APIGatewayProxyStructuredResultV2 } from 'aws-lambda';\n      import type { LoginResponse } from './types.mts';\n      ```\n\n  - Exports\n    - Use named exports not default exports\n    - Exports all in a single declaration at the bottom of each file (e.g. `export { ... }`)\n\n- Prettier for file formatting; ESLint does not check for formatting\n\n## Example Usage\n\nHere are a few common use cases to get you familiar with using this collection. The following examples should be added to your `.eslintrc.json` file at the root of your repository.\n\n### Browser Environment\n\n```json\n{ \"extends\": [\"@babbel/eslint-config/browser\"] }\n```\n\nYep. That's it. 😀\n\nOr if you want to add some custom rules:\n\n```json\n{\n  \"extends\": [\"@babbel/eslint-config/browser\"],\n  \"rules\": {\n    /* add your custom rules here */\n  }\n}\n```\n\n### Node.js Environment\n\n```json\n{ \"extends\": [\"@babbel/eslint-config/node\"] }\n```\n\nI think you're getting the hang of it now...\n\n### Browser Environment That Uses React, TypeScript, Jest, and a Custom Rule\n\n```json\n{\n  \"extends\": [\"@babbel/eslint-config/react-typescript\", \"@babbel/eslint-config/browser\"],\n  \"rules\": {\n    \"no-console\": \"off\"\n  },\n  \"overrides\": [\n    {\n      \"files\": [\"**/*.test.ts\"],\n      \"extends\": \"@babbel/eslint-config/jest\"\n    }\n  ]\n}\n```\n\n## Making Your Own Config From the Base Config 🎓\n\n```json\n{\n  \"extends\": [\"@babbel/eslint-config\"],\n  \"rules\": {\n    /* add all your custom rules here */\n  }\n}\n```\n\nThe config export `@babbel/eslint-config` maps to the base config file `lib/eslintBaseConfig.json`. You can see how this works by looking for the `\".\"` entry in the `exports` section of this project's [`package.json`](./package.json); that section defines all the config exports rather than using proxy files (e.g. `index.js`) at the root of the repository.\n\nFor example, if you want to add an export called `@babbel/eslint-config/example`, you would do the following:\n\n- Create a new ESLint configuration file called `./lib/eslintExampleConfig.json` and set your preferred settings within.\n- For the `/example` package export to work, we have to add a new entry in the `\"exports\"` section in `package.json`. For this example, we'll add\n\n```json\n{\n  \"exports\": {\n    ...\n    \"example\": \"./lib/eslintExampleConfig.json\",\n    ...\n  }\n}\n```\n\n- File a pull request and wait for a project maintainer to review it. As a reminder, be sure that your new configuration extends `eslintBaseConfig.json` or a more specific configuration, otherwise the acceptance of your code contributions may be delayed.\n\n## Changing This Library\n\nMaintenance of this library requires an exact version of [Bun](https://bun.sh/) to be installed, specifically the one listed in the `packageManager` field of `package.json`. Because there are no well-established version managers for Bun (e.g. like `nvm` for Node.js), a `package.json` script was added to overwrite the currently-installed version of Bun with the expected version for this project; Bun's entire install is a single binary, so doing so is a safe operation.\n\nExecute the install script by running\n\n```bash\nbun run --silent install:bun:expected-version\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabbel%2Feslint-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabbel%2Feslint-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabbel%2Feslint-config/lists"}