{"id":21469062,"url":"https://github.com/sprylab/eslint-config-sprylab","last_synced_at":"2025-07-15T06:31:57.486Z","repository":{"id":36973112,"uuid":"317227865","full_name":"sprylab/eslint-config-sprylab","owner":"sprylab","description":"Eslint config for typescript based projects","archived":false,"fork":false,"pushed_at":"2023-03-07T05:59:49.000Z","size":334,"stargazers_count":4,"open_issues_count":5,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-27T05:04:10.781Z","etag":null,"topics":["eslint","jest","react","react-native","reactjs","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sprylab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-30T13:11:21.000Z","updated_at":"2022-11-08T15:51:26.000Z","dependencies_parsed_at":"2023-02-17T02:16:29.341Z","dependency_job_id":null,"html_url":"https://github.com/sprylab/eslint-config-sprylab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sprylab%2Feslint-config-sprylab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sprylab%2Feslint-config-sprylab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sprylab%2Feslint-config-sprylab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sprylab%2Feslint-config-sprylab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sprylab","download_url":"https://codeload.github.com/sprylab/eslint-config-sprylab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226022620,"owners_count":17561313,"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","jest","react","react-native","reactjs","typescript"],"created_at":"2024-11-23T09:13:03.884Z","updated_at":"2024-11-23T09:13:04.585Z","avatar_url":"https://github.com/sprylab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eslint Config Sprylab\n\nThis is an eslint config used at Sprylab GmbH for typescript, react and react-native based projects.\n\n## Installation\n\n```bash\nyarn add --dev @sprylab/eslint-config\n```\n\nor\n\n```bash\nnpm i --save-dev @sprylab/eslint-config\n```\n\nAlso make sure to have `prettier` and of course `typescript` and `eslint` installed as well.\nThen add the following config to your extend array in your eslint config file.\n\n```js\nmodule.exports = {\n    extends: [\n        '@sprylab/eslint-config', // this is the base\n        /* \n            for react: '@sprylab/eslint-config/react'\n            for native: '@sprylab/eslint-config/native'\n        */\n    ],\n    parserOptions: {\n        project: './tsconfig.json', // should be the path to the projects tsconfig.json\n    },\n}\n```\n\n**IMPORTANT**:\n\n- For this config to work you need to have a tsconfig.json file at the repo root level, and then you have to set the parserOptions.project to point to your tsconfig file. [see the @typescript-eslint plugin docs](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin).\n- You also need to have @babel/core installed [see the @babel eslint parser docs](https://www.npmjs.com/package/@babel/eslint-parser)\n- for the best experience you should have a prettier config file at the repo root as well, otherwise the eslint-config-prettier will use its builtin defaults.\n- if you use path aliases, (e.g. use \"@\" as a path alias to /src etc.), you will probably need to setup a path resolver for the eslint-plugin-import package or turn off some of its rules. There is a resolver for [node](https://www.npmjs.com/package/eslint-import-resolver-node), [typescript](https://www.npmjs.com/package/eslint-import-resolver-typescript), [babel](https://www.npmjs.com/package/eslint-import-resolver-babel-module), [webpack](https://www.npmjs.com/package/eslint-import-resolver-webpack) etc.\n\n## Configuration\n\nThis package includes three distinct configs:\n\n### base\n\n- @typescript, @babel, es2021, node globals and testing-library.\n\n```js\nextends: [\n    '@sprylab/eslint-config',\n],\n```\n\n### react\n\n- base config, browser globals, react, react-hooks and testing-library/react.\n\n```js\nextends: [\n    '@sprylab/eslint-config/react',\n]\n```\n\n### native\n\n- native -\u003e react config + react native\n\n```js\nextends: [\n    '@sprylab/eslint-config/native',\n]\n```\n\n## Plugins included\n\nThis config includes and configures the following eslint plugins / parsers:\n\n### Parsers\n\nFor javascript files (\\*.js(x)):\n\n- `@babel/eslint-parser`\n- `@babel/eslint-plugin`\n\nFor typescript files only (\\*.ts(x)):\n\n- `@typescript-eslint/eslint-plugin`\n- `@typescript-eslint/parser`\n\n### Plugins\n\n#### Base\n\nplugins shared by all configs / overrides\n\n- `eslint-config-prettier`\n- `eslint-plugin-prettier`\n- `eslint-plugin-import`\n- `eslint-plugin-sonarjs`\n- `eslint-plugin-sort-imports-es6-autofix`\n- `eslint-plugin-comment`\n\n#### Testing\n\nplugins shared across all configs for test files (example.spec.ts) etc.)\n\n- `eslint-plugin-testing-library`\n- `eslint-plugin-jest`\n\n#### React and React Native\n\n- `eslint-plugin-react`\n- `eslint-plugin-react-hooks`\n\n#### React (exclusive)\n\n- `plugin:jsx-a11y/recommended`\n\n#### React Native (exclusive)\n\n- `eslint-plugin-react-native`\n\n## Recommendations\n\n- add a pre-commit eslint check using [husky](https://www.npmjs.com/package/husky) and [lint-staged](https://github.com/okonet/lint-staged) to your `package.json` file, for example:\n\n```json\n\"husky\": {\n    \"hooks\": {\n        \"pre-commit\": \"lint-staged\"\n    }\n},\n\"lint-staged\": {\n    \"*.{md,json,yml,yaml}\": [\n        \"prettier --write\"\n    ],\n    \"*.{js,jsx,ts,tsx}\": [\n        \"eslint --fix\"\n    ]\n}\n```\n\n- add `package.json` eslint scripts:\n\n```json\n\"scripts\": {\n    \"check:script\": \"eslint --fix-dry-run './{src,__tests__}/**/*.{js,ts,tsx}'\",\n    \"lint:script\": \"eslint --fix './{src,__tests__}/**/*.{js,ts,tsx}'\",\n}\n```\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Goldziher\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/30733348?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNa'aman Hirschfeld\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Sprylab GmbH/@sprylab/eslint-config/commits?author=Goldziher\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/Sprylab GmbH/@sprylab/eslint-config/commits?author=Goldziher\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#design-Goldziher\" title=\"Design\"\u003e🎨\u003c/a\u003e \u003ca href=\"#tool-Goldziher\" title=\"Tools\"\u003e🔧\u003c/a\u003e \u003ca href=\"#maintenance-Goldziher\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/schwarzkopfb\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/1900242?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSchwarzkopf Balázs\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Sprylab GmbH/@sprylab/eslint-config/commits?author=schwarzkopfb\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! See our [contribution guidelines](CONTRIBUTING.md)!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsprylab%2Feslint-config-sprylab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsprylab%2Feslint-config-sprylab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsprylab%2Feslint-config-sprylab/lists"}