{"id":13602770,"url":"https://github.com/taoyage/yg-configs","last_synced_at":"2025-04-06T08:11:40.496Z","repository":{"id":37750671,"uuid":"482820217","full_name":"taoyage/yg-configs","owner":"taoyage","description":"CLI toolbox for common scripts for front-end projects","archived":false,"fork":false,"pushed_at":"2022-11-15T10:39:31.000Z","size":890,"stargazers_count":274,"open_issues_count":0,"forks_count":44,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-03-30T07:11:53.170Z","etag":null,"topics":["babel","commitlint","eslint","lintstaged","postcss","stylelint","swc","swc-loader"],"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/taoyage.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}},"created_at":"2022-04-18T11:22:33.000Z","updated_at":"2025-02-27T22:39:53.000Z","dependencies_parsed_at":"2022-07-09T07:01:00.284Z","dependency_job_id":null,"html_url":"https://github.com/taoyage/yg-configs","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/taoyage%2Fyg-configs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taoyage%2Fyg-configs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taoyage%2Fyg-configs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taoyage%2Fyg-configs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taoyage","download_url":"https://codeload.github.com/taoyage/yg-configs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247440316,"owners_count":20939217,"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":["babel","commitlint","eslint","lintstaged","postcss","stylelint","swc","swc-loader"],"created_at":"2024-08-01T18:01:37.395Z","updated_at":"2025-04-06T08:11:40.475Z","avatar_url":"https://github.com/taoyage.png","language":"JavaScript","funding_links":[],"categories":["babel"],"sub_categories":[],"readme":"# yg-configs 🛠📦\n\n![license](https://img.shields.io/github/license/taoyage/yg-configs) ![npm](https://img.shields.io/badge/npm-v18.0.0-blue)\n\nCLI toolbox for common scripts for my front-end projects\n\n\u003c/div\u003e\n\n---\n\n## Table of Contents\n\n-   [Installation](#installation)\n-   [Usage](#usage)\n    -   [config prettier](#config-prettier)\n    -   [config eslint](#config-eslint)\n    -   [config commitlint](#config-commitlint)\n    -   [config lintstaged](#config-lintstaged)\n    -   [config stylelint](#config-stylelint)\n    -   [config postcss](#config-postcss)\n    -   [config swc](#config-swc)\n    -   [config babel](#config-babel)\n-   [example](https://github.com/taoyage/yg-configs/tree/master/example)\n\n## Installation\n\n```javascript\n$ npm install @taoyage/configs --save-dev\nor\n$ pnpm install @taoyage/configs -D\n```\n\n## Usage\n\nThis can be a very helpful way to make editor integration work for tools like ESLint，babel，prettier，commitlint which require project-based configuration to be present to work.\n\n### config prettier\n\nif we were to do this for prettier, you could create an .prettierrc.js with the contents of\n\n```javascript\nmodule.exports = require('@taoyage/configs/prettier');\n```\n\n### config eslint\n\nif we were to do this for eslint of typescript react project, you could create an .eslintrc.js with the contents of\n\n```javascript\nmodule.exports = require('@taoyage/configs/eslint-ts');\n```\n\ncreate tsconfig.json with the contents of\n\n```json\n{\n    \"extends\": \"@taoyage/configs/shared-tsconfig\",\n    \"compilerOptions\": {},\n    \"exclude\": [],\n    \"include\": []\n}\n```\n\n### config commitlint\n\nif were to do this for commitlint, you could create an .commitlintrc.js with the contents of\n\n```javascript\nmodule.exports = require('@taoyage/configs/commitlint');\n```\n\n### config lintstaged\n\nif were to do this for lintstaged, you could create an .lintstagedrc.js with the contents of\n\n```javascript\nmodule.exports = require('@taoyage/configs/lintstaged');\n```\n\n### config stylelint\n\nif were to do this for stylelint, you could create an .stylelintrc.js with the contents of\n\n```javascript\nmodule.exports = require('@taoyage/configs/stylelint');\n```\n\n### config postcss\n\nif were to do this for postcss, you could create an postcss.config.js with the contents of\n\n```javascript\nmodule.exports = require('@sk/configs/postcss');\n```\n\n### config swc\n\nif were to do swc-loader to webpack configure，you could import this swc configuration，\nthis configuration suport typescript program. example of\n\n```javascript\n  import swcOptions from '@taoyage/configs/swc-ts';\n\n  module: {\n    rules: [\n      {\n        test: /\\.ts?x$/,\n        use: {\n          loader: 'swc-loader',\n          options: swcOptions(rootPath, { isDev: false, override: {} }),\n        },\n      },\n    ],\n  },\n\n```\n\n| params   | description                  | type   |\n| -------- | ---------------------------- | ------ |\n| rootPath | tsconfig.json file path      | string |\n| isDev    | current is dev or production | bool   |\n| override | swc compilation config       | object |\n\n### config babel\n\nif were todo babel-loader to webpack configure to react, you could create an .babelrc.js with content of\n\n```javascript\nmodule.exports = {\n    presets: [['@taoyage/configs/babel']],\n};\n```\n\n### TODO\n\n-   [x] eslint config\n-   [x] tsconfig\n-   [x] prettier\n-   [x] commitlint config\n-   [x] lintstage config\n-   [x] stylelint config\n-   [x] swc config\n-   [x] babel config\n-   [x] browserslist\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaoyage%2Fyg-configs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaoyage%2Fyg-configs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaoyage%2Fyg-configs/lists"}