{"id":13717347,"url":"https://github.com/ecomfe/fecs","last_synced_at":"2025-08-02T12:41:59.742Z","repository":{"id":21247970,"uuid":"24563457","full_name":"ecomfe/fecs","owner":"ecomfe","description":"Front End Code Style Suite","archived":false,"fork":false,"pushed_at":"2020-12-24T13:30:24.000Z","size":3813,"stargazers_count":640,"open_issues_count":56,"forks_count":111,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-06-26T02:09:03.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://fecs.baidu.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"reborndb/reborn","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ecomfe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-28T15:57:39.000Z","updated_at":"2025-03-25T14:05:05.000Z","dependencies_parsed_at":"2022-09-11T18:50:28.478Z","dependency_job_id":null,"html_url":"https://github.com/ecomfe/fecs","commit_stats":null,"previous_names":[],"tags_count":142,"template":false,"template_full_name":null,"purl":"pkg:github/ecomfe/fecs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Ffecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Ffecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Ffecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Ffecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecomfe","download_url":"https://codeload.github.com/ecomfe/fecs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Ffecs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267262560,"owners_count":24061323,"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-07-26T02:00:08.937Z","response_time":62,"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":"2024-08-03T00:01:21.038Z","updated_at":"2025-08-02T12:41:59.683Z","avatar_url":"https://github.com/ecomfe.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"FECS\n==========\n\nFECS 是基于 Node.js 的前端代码风格工具。\n\n[![Build Status](https://img.shields.io/travis/ecomfe/fecs.svg?style=flat)](http://travis-ci.org/ecomfe/fecs)\n[![Build Status](https://img.shields.io/appveyor/ci/chriswong/fecs.svg?style=flat)](https://ci.appveyor.com/project/chriswong/fecs)\n[![NPM version](https://img.shields.io/npm/v/fecs.svg?style=flat)](https://www.npmjs.com/package/fecs)\n[![Coverage Status](https://img.shields.io/coveralls/ecomfe/fecs.svg?style=flat)](https://coveralls.io/r/ecomfe/fecs)\n[![Dependencies](https://img.shields.io/david/ecomfe/fecs.svg?style=flat)](https://david-dm.org/ecomfe/fecs)\n[![DevDependencies](https://img.shields.io/david/dev/ecomfe/fecs.svg?style=flat)](https://david-dm.org/ecomfe/fecs) [![Greenkeeper badge](https://badges.greenkeeper.io/ecomfe/fecs.svg)](https://greenkeeper.io/)\n\n\n### 安装\n\n```\n    $ [sudo] npm install fecs -g\n```\n\n### 使用\n\n```\n    fecs\n    fecs -v\n    fecs check --help\n    fecs format --help\n```\n\n更多参数见 wiki: [CLI](https://github.com/ecomfe/fecs/wiki/CLI)\n\n### API\n\n#### fecs.leadName\n\n设置或获取控制台输出信息前的名称，默认值为 `fecs`。\n\n```javascript\nvar fecs = require('fecs');\nfecs.leadName = 'edp';\n...\n```\n\n#### fecs.getOptions(Array argv)\n\n获取经 `minimist` 解释后的命令行参数对象，可用于 `fecs.check` 和 `fecs.format` 方法。\n\n```javascript\nvar options = fecs.getOptions(process.argv.slice(2));\n\nconsole.log(options.command); // 'check'\n...\n```\n\n#### fecs.check(Object options[, Function done])\n\n检查文件或输入流的代码规范。\n\n```javascript\n// 设置检查的文件路径\noptions._ = ['/path/to/check'];\n\n// 或者设置为 stream\n// options.stream = yourReadableStream;\n\n// 设置文件类型\n// options.type = 'js,css';\n\n\n/**\n * callback after check finish\n *\n * @param {boolean} success true as all files ok, or false.\n * @param {Object[]} errors data for check result.\n */\nfunction done(success, errors) {\n    // blablabla\n}\n\nfecs.check(options, done);\n```\n\n#### fecs.format(Object options)\n\n格式化、修复文件或输入流的代码。\n\n```javascript\nfecs.check(options);\n```\n\n\n### 工具支持\n\n - [x] [VIM](https://github.com/hushicai/fecs.vim)\n - [x] [WebStorm](https://github.com/leeight/Baidu-FE-Code-Style#webstorm)\n - [x] [Eclipse](https://github.com/ecomfe/fecs-eclipse)\n - [x] Sublime Text 2/3 [Baidu FE Code Style](https://github.com/leeight/Baidu-FE-Code-Style) [Sublime Helper](https://github.com/baidu-lbs-opn-fe/Sublime-fecsHelper) [SublimeLinter-contrib-fecs](https://github.com/robbenmu/SublimeLinter-contrib-fecs)\n - [x] Visual Studio Code [fecs-visual-studio-code](https://github.com/21paradox/fecs-visual-studio-code) [vscode-fecs(中文)](https://github.com/MarxJiao/VScode-fecs)\n - [x] [Atom](https://github.com/8427003/atom-fecs)\n - [x] [Emacs](https://github.com/Niandalu/flycheck-fecs)\n\n - [x] [Grunt](https://github.com/ecomfe/fecs-grunt)\n - [x] [Gulp](https://github.com/ecomfe/fecs-gulp)\n\n - [x] [Git Hook](https://github.com/cxtom/fecs-git-hooks)\n\n\n### 常见问题\n\n- \u003chttps://github.com/ecomfe/fecs/wiki/FAQ\u003e\n- \u003chttps://github.com/ecomfe/fecs/wiki/HowToFix\u003e\n\n更多信息请访问 \u003chttps://github.com/ecomfe/fecs/wiki\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Ffecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecomfe%2Ffecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Ffecs/lists"}