{"id":24156087,"url":"https://github.com/parcellab/eslint-config","last_synced_at":"2026-04-12T18:54:35.847Z","repository":{"id":241673501,"uuid":"141691107","full_name":"parcelLab/eslint-config","owner":"parcelLab","description":"Custom JS/TS lint rules used in parcelLab codebases","archived":false,"fork":false,"pushed_at":"2024-05-06T20:25:20.000Z","size":2705,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-02-26T09:06:59.559Z","etag":null,"topics":["eslint","javascript","team-architecture","typescript"],"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/parcelLab.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-20T09:17:31.000Z","updated_at":"2025-02-11T10:11:43.000Z","dependencies_parsed_at":"2024-05-29T16:17:21.564Z","dependency_job_id":"bbfea9ea-96e8-4316-b727-4ffa922c8fb2","html_url":"https://github.com/parcelLab/eslint-config","commit_stats":{"total_commits":116,"total_committers":11,"mean_commits":"10.545454545454545","dds":"0.47413793103448276","last_synced_commit":"3c617dacf0f6c17aeaa6664cc751580431133c80"},"previous_names":["parcellab/eslint-config-parcellab"],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Feslint-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Feslint-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Feslint-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parcelLab%2Feslint-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parcelLab","download_url":"https://codeload.github.com/parcelLab/eslint-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241439862,"owners_count":19963143,"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","javascript","team-architecture","typescript"],"created_at":"2025-01-12T13:15:43.967Z","updated_at":"2026-04-12T18:54:35.799Z","avatar_url":"https://github.com/parcelLab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @parcellab/eslint-config\n\n[![Publish](https://github.com/parcelLab/eslint-config/actions/workflows/publish.yaml/badge.svg)](https://github.com/parcelLab/eslint-config/actions/workflows/publish.yaml) [![Test](https://github.com/parcelLab/eslint-config/actions/workflows/test.yaml/badge.svg)](https://github.com/parcelLab/eslint-config/actions/workflows/test.yaml)\n\nSpecific parcelLab configuration for JavaScript and TypeScript projects. It also includes React ecosystem and Jest rules.\n\nThe philosophy is to use `prettier` for auto formatting code syntactically, therefore this configuration extensively uses `eslint-config-prettier` as defined in [prettier's documentation](https://prettier.io/docs/en/integrating-with-linters.html), disabling some eslint rules that could collide with prettier's. Anything else that prettier can't auto format will be linted by eslint.\n\n## Features\n\n- **Customizable**: extend the exported configurations and fine-tune them.\n- **Composable**: add only what your project needs. Increase performance and reduce side-effects.\n- **Easy**: explanatory documentation about the plugins you need for every custom rule.\n\n## Install\n\n```sh\n# npm\n$ npm install @parcellab/eslint-config --save-dev\n# yarn\n$ yarn add --dev @parcellab/eslint-config\n```\n\n## Usage\n\nIn your package, create a `.eslintrc.js` file that extends any of the existing configs.\nIf no config is specified, the base `typescript` config will be used.\n\nFor example:\n\n```js\nmodule.exports = {\n  extends: [\n    \"@parcellab\", // This installs the typescript configuration\n  ],\n};\n```\n\n## Configurations\n\nConfigurations are stored in `./src` and their required plugins.\n\n| Config                                                        | Files to be linted                | Required configs/plugins                                                                                                     |\n| :------------------------------------------------------------ | :-------------------------------- | :--------------------------------------------------------------------------------------------------------------------------- |\n| [base](./src/base.js)                                         | all                               | `eslint-plugin-promise`, `eslint-plugin-unicorn`                                                                             |\n| [jest](./src/jest.js)                                         | `*.{test,spec}.{j,t}s?(x)`        | `eslint-plugin-jest`                                                                                                         |\n| [react-testing-library](./src/react-testing-library.js)       | `**/?(*.)+(test).{js,jsx,ts,tsx}` | `eslint-plugin-testing-library`                                                                                              |\n| [react-ts](./src/react.js) (extends `react` and `typescript`) | `*.tsx`                           | `eslint-config-airbnb-typescript`                                                                                            |\n| [react](./src/react.js) (extends `base`)                      | `*.jsx`                           | `eslint-config-airbnb`, `eslint-plugin-import`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react`, `eslint-plugin-react-hooks` |\n| [playwright](./src/playwright.js)                             | `**/e2e/**/*.test.{js,ts}`        | `eslint-plugin-playwright`                                                                                                   |\n| [storybook](./src/storybook.js)                               | `*.stories.{ts,tsx,mdx}`          | `eslint-plugin-storybook`                                                                                                    |\n| [typescript](./src/typescript.js) (extends `base`) DEFAULT    | `*.{ts,tsx}`                      | `eslint-plugin-import`, `eslint-import-resolver-typescript`, `@typescript-eslint/eslint-plugin`, `@typescript-eslint/parser` |\n\nFor instance, to lint TypeScript files (the default), the `@parcellab/typescript` config has to be used\nand all the base plugins (`eslint-plugin-promise`, `eslint-plugin-unicorn`)\nand the typescript plugin (`@typescript-eslint/eslint-plugin`) has to be installed as development dependencies:\n\n```sh\n# npm\nnpm install eslint-plugin-import \\\n            eslint-import-resolver-typescript \\\n            eslint-plugin-promise \\\n            eslint-plugin-unicorn \\\n            @typescript-eslint/eslint-plugin \\\n            @typescript-eslint/parser \\\n            --save-dev\n# yarn\nyarn add eslint-plugin-import \\\n         eslint-import-resolver-typescript \\\n         eslint-plugin-promise \\\n         eslint-plugin-unicorn \\\n         @typescript-eslint/eslint-plugin \\\n         @typescript-eslint/parser \\\n         --dev\n```\n\nTo lint a React codebase that uses TypeScript, you need to install all plugins for\n`typescript` and `react` as it depends on these:\n\n```sh\n# npm\nnpm install eslint-plugin-import \\\n            eslint-plugin-promise \\\n            eslint-plugin-unicorn \\\n            @typescript-eslint/eslint-plugin \\\n            @typescript-eslint/parser \\\n            eslint-config-airbnb \\\n            eslint-plugin-jsx-a11y \\\n            eslint-plugin-react \\\n            eslint-plugin-react-hooks \\\n            eslint-config-airbnb-typescript \\\n            --save-dev\n# yarn\nyarn add eslint-plugin-import \\\n         eslint-plugin-promise \\\n         eslint-plugin-unicorn \\\n         @typescript-eslint/eslint-plugin \\\n         @typescript-eslint/parser \\\n         eslint-config-airbnb \\\n         eslint-plugin-jsx-a11y \\\n         eslint-plugin-react \\\n         eslint-plugin-react-hooks \\\n         eslint-config-airbnb-typescript \\\n         --dev\n```\n\n### Configuration examples\n\n```js\n// minimum configuration, e.g. for .js files\nmodule.exports = {\n  extends: [\"@parcellab/eslint-config/base\"],\n};\n```\n\n```js\n// for .ts and .tsx files (do not forget to add `parseOptions` pointing to the tsconfig file)\nmodule.exports = {\n  extends: [\"@parcellab/eslint-config/typescript\"], // or just \"@parcellab\"\n  parserOptions: {\n    project: \"./tsconfig.json\",\n    // Enable tsconfigRootDir if the tsconfig has to be loaded base on folder (e.g. monorepo)\n    // tsconfigRootDir: __dirname,\n  },\n};\n```\n\n```js\n// for .jsx files\nmodule.exports = {\n  extends: [\"@parcellab/eslint-config/react\"],\n};\n```\n\n```js\n// for .tsx files\nmodule.exports = {\n  extends: [\"@parcellab/eslint-config/react-ts\"],\n};\n```\n\n```js\n// for test files\nmodule.exports = {\n  extends: [\"@parcellab/eslint-config/jest\"],\n};\n```\n\n```js\n// for e2e tests\nmodule.exports = {\n  extends: [\"@parcellab/eslint-config/playwright\"],\n};\n```\n\n```js\n// for react testing library tests\nmodule.exports = {\n  extends: [\"@parcellab/eslint-config/react-testing-library\"],\n};\n```\n\n```js\n// for storybook files\nmodule.exports = {\n  extends: [\"@parcellab/eslint-config/storybook\"],\n};\n```\n\n```js\n// You can combine multiple extends, like this:\n// for typescript files and their tests\nmodule.exports = {\n  extends: [\n    \"@parcellab/eslint-config/typescript\",\n    \"@parcellab/eslint-config/jest\",\n  ],\n  parserOptions: {\n    project: \"./tsconfig.json\",\n  },\n};\n```\n\n## Troubleshooting\n\n### I get this error when running ESLint: \"The file must be included in at least one of the projects provided\"\n\nThis means you are attempting to lint a file that `tsconfig.json` doesn't include, when running\nthe `parcellab/typescript` config.\n\nA common fix is to create a `tsconfig.eslint.json` file, which extends your `tsconfig.json` file and includes all files you are linting.\n\n```json\n{\n  \"extends\": \"./tsconfig.json\",\n  \"include\": [\"src/**/*.ts\", \"src/**/*.js\", \"test/**/*.ts\"]\n}\n```\n\nUpdate your ESLint config file:\n\n```js\n// .eslintrc.js\nparserOptions: {\n-  project: './tsconfig.json',\n+  project: './tsconfig.eslint.json',\n}\n```\n\n### ESLint couldn't find the config \"X\" to extend from. Please check that the name of the config is correct\n\nThis could also happen with plugins. When this error is encountered, it is because\na peer dependency defined by this library is not fulfilled. Check the [Configurations table](#configurations) and make sure that all the configs and plugins are installed. The consumers of this library should be the ones that manage\nany peer dependencies so they are not constrained from the versions defined in this library.\n\n## Development\n\nLint the lint rules\n\n```sh\nnpm run lint\n```\n\nRun the tests\n\n```sh\nnpm t\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcellab%2Feslint-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparcellab%2Feslint-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparcellab%2Feslint-config/lists"}