{"id":29926624,"url":"https://github.com/ecomfe/eslint-config","last_synced_at":"2025-08-02T12:42:51.336Z","repository":{"id":33826286,"uuid":"130322949","full_name":"ecomfe/eslint-config","owner":"ecomfe","description":"eslint shareable config for efe","archived":false,"fork":false,"pushed_at":"2023-09-15T03:00:12.000Z","size":619,"stargazers_count":119,"open_issues_count":21,"forks_count":31,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-07-07T15:59:59.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ecomfe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-04-20T07:04:22.000Z","updated_at":"2025-03-03T03:08:24.000Z","dependencies_parsed_at":"2024-06-18T15:20:06.121Z","dependency_job_id":"54c853f7-9bfb-45d5-b576-218c5531003b","html_url":"https://github.com/ecomfe/eslint-config","commit_stats":{"total_commits":120,"total_committers":15,"mean_commits":8.0,"dds":0.4083333333333333,"last_synced_commit":"aadeafe6a0396a3e13a912c4e1f4366bc151d8c2"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/ecomfe/eslint-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Feslint-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Feslint-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Feslint-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Feslint-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecomfe","download_url":"https://codeload.github.com/ecomfe/eslint-config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Feslint-config/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268392180,"owners_count":24243297,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-08-02T12:42:20.326Z","updated_at":"2025-08-02T12:42:51.303Z","avatar_url":"https://github.com/ecomfe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @ecomfe/eslint-config\n\nEFE 团队使用的 ESLint 配置。\n\n## 安装\n\n```shell\nnpm i -D eslint @babel/eslint-parser @babel/eslint-plugin @ecomfe/eslint-config\n```\n\n## 使用\n\n在 `.eslintrc.js` 中使用：\n\n```js\nmodule.exports = {\n    extends: [\n        '@ecomfe/eslint-config',\n    ],\n};\n```\n\n也可开启严格模式：\n\n```js\nmodule.exports = {\n    extends: [\n        '@ecomfe/eslint-config/strict',\n    ],\n};\n```\n\n## 扩展\n\n### `import`\n\n如果需要检测与 `import` 相关的规则，需要安装这个插件：\n\n```shell\nnpm i -D eslint-plugin-import\n```\n\n并在 `.eslintrc.js` 中引用：\n\n```js\nmodule.exports = {\n    extends: [\n        '@ecomfe/eslint-config',\n        '@ecomfe/eslint-config/import',\n        // 或者选择严格模式\n        // '@ecomfe/eslint-config/import/strict',\n    ],\n};\n```\n\n注意这些规则会要求使用 ES6 的 `import` 来引入依赖，如果使用的是 `require` 则会出现检查错误，可禁用 `import/no-commonjs` 和 `import/unambiguous` 来解决。\n\n### React\n\n如果需要检测 React 相关的代码，需要安装相关插件：\n\n```shell\nnpm i -D eslint-plugin-react eslint-plugin-react-hooks\n```\n\n并在 `.eslintrc.js` 中引用：\n\n```js\nmodule.exports = {\n    extends: [\n        '@ecomfe/eslint-config',\n        '@ecomfe/eslint-config/react',\n        // 或者选择严格模式\n        // '@ecomfe/eslint-config/react/strict',\n    ],\n};\n```\n\n会自动检测本地 React 的版本，默认情况下无需其它配置。\n\n### Vue\n\n如果需要检测 Vue 相关的代码，需要安装相关插件：\n\n```shell\nnpm i -D eslint-plugin-vue\n```\n\n并在 `.eslintrc.js` 中引用：\n\n```js\nmodule.exports = {\n    extends: [\n        '@ecomfe/eslint-config',\n        '@ecomfe/eslint-config/vue', // 注意顺序\n        // 或者选择严格模式\n        // '@ecomfe/eslint-config/vue/strict',\n    ],\n};\n```\n\n### San\n\n如果需要检测 San 相关的代码，需要安装相关插件：\n\n```shell\nnpm i -D eslint-plugin-san\n```\n\n并在 `.eslintrc.js` 中引用：\n\n```js\nmodule.exports = {\n    extends: [\n        '@ecomfe/eslint-config',\n        '@ecomfe/eslint-config/san', // 注意顺序\n        // 或者选择严格模式\n        // '@ecomfe/eslint-config/san/strict',\n    ],\n};\n```\n\n### TypeScript\n\n如果需要检测 TypeScript 代码，需要安装相关插件：\n\n```shell\nnpm i -D @typescript-eslint/parser @typescript-eslint/eslint-plugin\n```\n\n**除此之外，需要先安装`typescript`包，并在项目根目录有`tsconfig.json`文件**。\n\n并在`.eslintrc.js`中引用：\n\n```js\nmodule.exports = {\n    extends: [\n        '@ecomfe/eslint-config',\n        '@ecomfe/eslint-config/typescript',\n        // 或者选择严格模式\n        // '@ecomfe/eslint-config/typescript/strict',\n    ],\n};\n```\n\n## 细节\n\n默认配置 `@ecomfe/eslint-config` 与 [FECS](https://github.com/ecomfe/fecs) 相同，但临时移除了 `fecs-*` 的规则。\n\n严格版配置 `*/strict` 开启了更严格的规则。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Feslint-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecomfe%2Feslint-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Feslint-config/lists"}