{"id":13517404,"url":"https://github.com/callstack/eslint-config-callstack","last_synced_at":"2025-04-08T04:17:56.967Z","repository":{"id":23245169,"uuid":"98285511","full_name":"callstack/eslint-config-callstack","owner":"callstack","description":"ESLint preset extending Flow, Prettier and Jest","archived":false,"fork":false,"pushed_at":"2024-04-25T13:08:54.000Z","size":1321,"stargazers_count":52,"open_issues_count":11,"forks_count":11,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-05-12T19:21:02.340Z","etag":null,"topics":["eslint","hacktoberfest","prettier","react","react-native","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/callstack.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-25T08:51:47.000Z","updated_at":"2024-06-02T04:44:47.876Z","dependencies_parsed_at":"2023-09-22T19:33:35.146Z","dependency_job_id":"6fc14b6a-b207-4179-aaeb-6bea79543a1f","html_url":"https://github.com/callstack/eslint-config-callstack","commit_stats":{"total_commits":208,"total_committers":22,"mean_commits":9.454545454545455,"dds":0.6298076923076923,"last_synced_commit":"b6bb65d5c52688c0fc9fe86e52b8b27c88b42287"},"previous_names":["callstack/eslint-config-callstack-io"],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callstack%2Feslint-config-callstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callstack%2Feslint-config-callstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callstack%2Feslint-config-callstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callstack%2Feslint-config-callstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/callstack","download_url":"https://codeload.github.com/callstack/eslint-config-callstack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773722,"owners_count":20993639,"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","hacktoberfest","prettier","react","react-native","typescript"],"created_at":"2024-08-01T05:01:33.415Z","updated_at":"2025-04-08T04:17:56.900Z","avatar_url":"https://github.com/callstack.png","language":"JavaScript","readme":"# @callstack/eslint-config\n\nCallstack ESLint config for React Native, React and Node.js projects, utilizing Flow, TypeScript, Prettier and Jest with sensible defaults. Supports both eslintrc and flat config.\n\n## Installation\n\nWith Yarn:\n\n```bash\nyarn add --dev eslint @callstack/eslint-config\n```\n\nOr with npm:\n\n```\nnpm install --save-dev eslint @callstack/eslint-config\n```\n\n## Usage\n\nYou can choose one of the following environments to work with by extending your ESLint config (`eslint.config.mjs` for flat config, or `.eslintrc` / `eslintConfig` field in `package.json` for the eslintrc config style) with `@callstack` config tailored to your project.\n\n### React Native config\n\nUsage:\n\n#### eslintrc format (ESLint \u003c v9)\n\n```json\n{\n  \"extends\": \"@callstack\"\n}\n```\n\n#### flat config format (`eslint.config.mjs`, ESLint 9+)\n\n```js\nimport callstackConfig from '@callstack/eslint-config/react-native.flat.js';\n\nexport default [\n  {\n    ignores: [\n      // ignored files go here\n    ],\n  },\n  ...callstackConfig,\n  {\n    rules: {\n      // your custom rules\n    },\n  },\n];\n```\n\nPlugins used:\n\n- **React config**\n- [eslint-plugin-react-native](https://yarnpkg.com/en/package/eslint-plugin-react-native)\n- [eslint-plugin-react-native-a11y](https://classic.yarnpkg.com/en/package/eslint-plugin-react-native-a11y)\n\nAdditionally, it sets `\"react-native/react-native\"` environment and native platform extensions to resolve.\n\n### React config\n\nUsage:\n\n#### eslintrc format (ESLint \u003c v9)\n\n```json\n{\n  \"extends\": \"@callstack/eslint-config/react\"\n}\n```\n\n#### flat config format (`eslint.config.mjs`, ESLint 9+)\n\n```js\nimport callstackConfigReact from '@callstack/eslint-config/react.flat.js';\n\nexport default [\n  {\n    ignores: [\n      // ignored files go here\n    ],\n  },\n  ...callstackConfigReact,\n  {\n    rules: {\n      // your custom rules\n    },\n  },\n];\n```\n\nPlugins used:\n\n- **Node config**\n- [eslint-plugin-react](https://yarnpkg.com/en/package/eslint-plugin-react)\n- [eslint-plugin-react-hooks](https://yarnpkg.com/en/package/eslint-plugin-react-hooks)\n\n### Node config\n\nUsage:\n\n#### eslintrc format (ESLint \u003c v9)\n\n```json\n{\n  \"extends\": \"@callstack/eslint-config/node\"\n}\n```\n\n#### flat config format (`eslint.config.mjs`, ESLint 9+)\n\n```js\nimport callstackConfigNode from '@callstack/eslint-config/node.flat.js';\n\nexport default [\n  {\n    ignores: [\n      // ignored files go here\n    ],\n  },\n  ...callstackConfigNode,\n  {\n    rules: {\n      // your custom rules\n    },\n  },\n];\n```\n\nPlugins used:\n\n- [eslint-config-prettier](https://yarnpkg.com/en/package/eslint-config-prettier)\n- [eslint-plugin-prettier](https://yarnpkg.com/en/package/eslint-plugin-prettier)\n- [eslint-plugin-jest](https://yarnpkg.com/en/package/eslint-plugin-jest) (applied for tests only, based on Jest's `testMatch` config)\n- [eslint-plugin-import](https://yarnpkg.com/en/package/eslint-plugin-import)\n- [eslint-plugin-promise](https://yarnpkg.com/en/package/eslint-plugin-promise)\n- [eslint-plugin-flowtype](https://yarnpkg.com/en/package/eslint-plugin-flowtype)\n- [@typescript-eslint/eslint-plugin](https://yarnpkg.com/en/package/@typescript-eslint/eslint-plugin) (only for `.tsx?` files)\n- [@typescript-eslint/parser](https://yarnpkg.com/en/package/@typescript-eslint/parser) (only for `.tsx?` files)\n\nAdditionally, it sets `es6` and `node` environments.\n\n### Example of extending the configuration\n\n##### eslintrc format (ESLint \u003c v9)\n\n```json\n{\n  \"extends\": \"@callstack\",\n  \"rules\": {\n    \"global-require\": 0,\n    \"prefer-destructuring\": 0\n  }\n}\n```\n\n##### flat config format (`eslint.config.mjs`, ESLint 9+)\n\n```js\nimport callstackConfig from '@callstack/eslint-config/react-native.flat.js';\n\nexport default [\n  ...callstackConfig,\n  {\n    rules: {\n      'global-require': 0,\n      'prefer-destructuring': 0,\n    },\n  },\n];\n```\n\n### TypeScript\n\nTypeScript is supported out-of-the-box, including importing JS files from TS files and vice-versa. All you need to do is to make sure you have [`typescript`](https://yarnpkg.com/en/package/typescript) module installed.\n\nThen when running ESLint add `--ext '.js,.ts'` (you might need also `.jsx, .tsx`) option, for example:\n\n```bash\nyarn eslint --ext '.js,.ts' ./src\n```\n\n`parserOptions.project` is set to `./tsconfig.json`. You may need to [adjust that](https://typescript-eslint.io/architecture/parser#project).\n\nTo do so, you'll need to override our setup for TS files in your ESLint config:\n\n##### eslintrc format (ESLint \u003c v9)\n\n```json\n{\n  \"overrides\": [\n    {\n      \"files\": [\"*.ts\", \"*.tsx\"],\n      \"parserOptions\": {\n        \"project\": \"./packages/**/tsconfig.json\"\n      }\n    }\n  ]\n}\n```\n\n##### flat config format (`eslint.config.mjs`, ESLint 9+)\n\nIn the flat config, just append another configuration object to the array and be sure to import the `/react-native.flat` file:\n\n```js\nimport callstackConfig from '@callstack/eslint-config/react-native.flat.js';\nimport tsEslintParser from '@typescript-eslint/parser';\n\nexport default [\n  ...callstackConfig,\n  {\n    files: ['**/*.ts', '**/*.tsx'],\n    languageOptions: {\n      parser: tsEslintParser,\n      parserOptions: { project: './packages/**/tsconfig.json' },\n    },\n  },\n];\n```\n\n#### VSCode\n\nIf you're VSCode user, you may find adding this config to your `.vscode/settings.json` helpful:\n\n```json\n{\n  \"eslint.validate\": [\n    \"javascript\",\n    \"javascriptreact\",\n    \"typescript\",\n    \"typescriptreact\"\n  ]\n}\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallstack%2Feslint-config-callstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcallstack%2Feslint-config-callstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallstack%2Feslint-config-callstack/lists"}