├── .changeset ├── README.md └── config.json ├── .commitlintrc.js ├── .czrc ├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── release.yml ├── .gitignore ├── .husky ├── commit-msg └── pre-commit ├── .lintstagedrc.js ├── .prettierignore ├── .prettierrc.js ├── .stylelintignore ├── .stylelintrc.js ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── docs └── play.svg ├── eslint.config.js ├── package.json ├── packages ├── create-lint │ ├── .npmignore │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ ├── package.json │ ├── template │ │ ├── base │ │ │ ├── .prettierignore │ │ │ └── .prettierrc.js │ │ ├── commit-basic │ │ │ ├── .commitlintrc.js │ │ │ ├── .czrc │ │ │ ├── .husky │ │ │ │ ├── commit-msg │ │ │ │ └── pre-commit │ │ │ ├── .lintstagedrc.js │ │ │ └── config.js │ │ ├── eslint-antfu │ │ │ ├── config.js │ │ │ └── eslint.config.js │ │ ├── eslint-basic │ │ │ ├── config.js │ │ │ └── eslint.config.js │ │ ├── eslint-react │ │ │ ├── config.js │ │ │ └── eslint.config.js │ │ ├── eslint-typescript │ │ │ ├── config.js │ │ │ └── eslint.config.js │ │ ├── eslint-vue │ │ │ ├── config.js │ │ │ └── eslint.config.js │ │ ├── file-basic │ │ │ ├── editorconfig │ │ │ │ ├── .editorconfig │ │ │ │ └── config.js │ │ │ ├── gitignore │ │ │ │ ├── .gitignore │ │ │ │ └── config.js │ │ │ └── npmrc │ │ │ │ ├── .npmrc │ │ │ │ └── config.js │ │ ├── release-changesets │ │ │ └── config.js │ │ ├── release-release-it │ │ │ ├── .release-it.json │ │ │ └── config.js │ │ ├── stylelint-basic │ │ │ ├── .stylelintignore │ │ │ ├── .stylelintrc.js │ │ │ └── config.js │ │ ├── test-vitest-react │ │ │ ├── config.js │ │ │ └── vitest.config.ts │ │ └── test-vitest-vue │ │ │ ├── config.js │ │ │ └── vitest.config.ts │ └── utils │ │ └── index.js ├── eslint-config-basic │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ └── package.json ├── eslint-config-react │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ └── package.json ├── eslint-config-typescript │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ └── package.json ├── eslint-config-vue │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ └── package.json └── stylelint-config-basic │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ └── package.json ├── pnpm-lock.yaml ├── pnpm-workspace.yaml └── tests ├── base ├── .prettierrc.mjs ├── .stylelintrc.mjs ├── .vscode │ └── settings.json ├── eslint.config.mjs ├── index.css ├── index.html ├── index.js ├── index.less ├── index.scss └── package.json ├── react ├── .gitignore ├── .prettierrc.js ├── .stylelintrc.js ├── .vscode │ └── settings.json ├── eslint.config.js ├── index.html ├── package.json ├── src │ ├── App.css │ ├── App.tsx │ ├── favicon.svg │ ├── index.css │ ├── logo.svg │ ├── main.tsx │ └── vite-env.d.ts ├── tsconfig.json └── vite.config.ts └── vue ├── .gitignore ├── .prettierrc.js ├── .stylelintrc.js ├── .vscode ├── extensions.json └── settings.json ├── README.md ├── eslint.config.js ├── index.html ├── package.json ├── public └── favicon.ico ├── src ├── App.vue ├── assets │ └── logo.png ├── components │ └── HelloWorld.vue ├── env.d.ts ├── main.css └── main.ts ├── tsconfig.json └── vite.config.ts /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@1.6.3/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": false, 5 | "linked": [], 6 | "access": "public", 7 | "baseBranch": "main", 8 | "updateInternalDependencies": "patch", 9 | "ignore": ["*demo"] 10 | } 11 | -------------------------------------------------------------------------------- /.commitlintrc.js: -------------------------------------------------------------------------------- 1 | export default { 2 | extends: ['@commitlint/config-conventional'], 3 | } 4 | -------------------------------------------------------------------------------- /.czrc: -------------------------------------------------------------------------------- 1 | { 2 | "path": "@commitlint/cz-commitlint" 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.* linguist-language=javascript 2 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/actions/using-workflows/about-workflows 2 | name: Release 3 | 4 | on: 5 | push: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | release: 11 | runs-on: ubuntu-latest 12 | steps: 13 | # https://github.com/actions/checkout 14 | - name: Checkout Repo 15 | uses: actions/checkout@v4 16 | 17 | # https://github.com/actions/setup-node 18 | - name: Setup Node.js 19 | uses: actions/setup-node@v3 20 | with: 21 | node-version: 20.x 22 | 23 | # https://github.com/pnpm/action-setup 24 | - name: Setup Pnpm 25 | uses: pnpm/action-setup@v2 26 | with: 27 | version: 9.x 28 | 29 | # https://pnpm.io/zh/cli/install#--frozen-lockfile 30 | - name: Install Dependencies 31 | run: pnpm install --frozen-lockfile 32 | 33 | # https://github.com/changesets/action 34 | - name: Create Release Pull Request or Publish to npm 35 | uses: changesets/action@v1 36 | with: 37 | version: pnpm run version 38 | publish: pnpm run publish 39 | commit: 'chore: version packages' 40 | createGithubReleases: false 41 | env: 42 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 43 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # System 2 | .DS_Store 3 | 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | yarn-debug.log* 9 | yarn-error.log* 10 | 11 | # Dependency directories 12 | node_modules 13 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | npx --no-install commitlint --edit $1 4 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | npx lint-staged 4 | -------------------------------------------------------------------------------- /.lintstagedrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('lint-staged').Config} */ 2 | export default { 3 | '*.{js?(x),ts?(x)}': ['eslint --fix', 'prettier --write'], 4 | '*.{css,scss,less}': ['stylelint --fix --aei', 'prettier --write'], 5 | '*.vue': ['eslint --fix', 'stylelint --fix --aei', 'prettier --write'], 6 | 'package.json': ['prettier --write'], 7 | } 8 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | tests 2 | node_modules 3 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('prettier').Options} */ 2 | export default { 3 | semi: false, 4 | trailingComma: 'es5', 5 | singleQuote: true, 6 | } 7 | -------------------------------------------------------------------------------- /.stylelintignore: -------------------------------------------------------------------------------- 1 | tests 2 | node_modules 3 | -------------------------------------------------------------------------------- /.stylelintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('stylelint').Config} */ 2 | export default { 3 | extends: '@bfehub/stylelint-config-basic', 4 | } 5 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.codeActionsOnSave": { 3 | "source.fixAll.eslint": "explicit", 4 | "source.fixAll.stylelint": "explicit" 5 | }, 6 | "stylelint.validate": [ 7 | "css", 8 | "less", 9 | "postcss", 10 | "scss", 11 | "html", 12 | "xml", 13 | "vue", 14 | "svelte", 15 | "php" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 haiweilian 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # @bfehub/lint 2 | 3 | 用于快速为项目添加代码规范和提交规范。也作为现代规范的基础范例和自定义需求的基础配置。 4 | 5 | ```sh 6 | # use npm 7 | npm create @bfehub/lint 8 | # use yarn 9 | yarn create @bfehub/lint 10 | # use pnpm 11 | pnpm create @bfehub/lint 12 | # when pnpm workspace 13 | pnpm create @bfehub/lint -w 14 | ``` 15 | 16 | 17 | 18 | ## Packages 19 | 20 | [create-lint](https://github.com/bfehub/lint/tree/main/packages/create-lint/README.md) 21 | 22 | [eslint-config-basic](https://github.com/bfehub/lint/tree/main/packages/eslint-config-basic/README.md) 23 | 24 | [eslint-config-typescript](https://github.com/bfehub/lint/tree/main/packages/eslint-config-typescript/README.md) 25 | 26 | [eslint-config-vue](https://github.com/bfehub/lint/tree/main/packages/eslint-config-vue/README.md) 27 | 28 | [eslint-config-react](https://github.com/bfehub/lint/tree/main/packages/eslint-config-react/README.md) 29 | 30 | [stylelint-config-basic](https://github.com/bfehub/lint/tree/main/packages/stylelint-config-basic/README.md) 31 | 32 | ## Issue 33 | 34 | If you have a better suggestion, please [create an issue](https://github.com/bfehub/lint/issues) 35 | 36 | ## License 37 | 38 | The code is released under [the MIT license](https://github.com/bfehub/lint/blob/master/LICENSE) 39 | -------------------------------------------------------------------------------- /docs/play.svg: -------------------------------------------------------------------------------- 1 | lint-cligit:(master)lint-cligit:(master)npm create @bfehub/lint?Pickaeslintpreset-Usearrow-keys.Returntosubmit.nonebasictypescriptvuereactnonebasicPickaeslintpresetvue?Pickastylelintpreset-Usearrow-keys.Returntosubmit.Pickastylelintpresetbasic?Pickacommitpreset-Usearrow-keys.Returntosubmit.Pickacommitpresetbasic?Pickareleasepreset-Usearrow-keys.Returntosubmit.release-itPickareleasepresetchangesets?Pickfilespreset-Spacetoselect.ReturntosubmitInstructions:↑/↓:Highlightoption←/→/[space]:Toggleselectiona:Toggleallenter/return:Completeanswer.gitignore.editorconfigPickfilespreset.editorconfig,.gitignoreProgress:resolved197,reused197,downloaded0,added0Alreadyup-to-dateProgress:resolved197,reused197,downloaded0,added0,donecreatedsuccess.lint-cligit:(master)lslint-cligit:(master)ls-a..editorconfig.lintstagedrc.jsnode_modules...eslintignore.prettierignorepackage.json.DS_Store.eslintrc.js.prettierrc.jsplay.cast.changeset.git.stylelintignorepnpm-lock.yaml.commitlintrc.js.gitignore.stylelintrc.js.czrc.huskyexamplestypescriptvuechangesetschangesets.editorconfig.editorconfig.gitignore.gitignoreProgress:resolved1,reused0,downloaded0,added0Progress:resolved10,reused10,downloaded0,added0Progress:resolved15,reused15,downloaded0,added0Progress:resolved93,reused93,downloaded0,added0Progress:resolved133,reused133,downloaded0,added0Progress:resolved156,reused156,downloaded0,added0lint-cligit:(master)llint-cligit:(master)ls- -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- 1 | import basic from '@bfehub/eslint-config-basic' 2 | 3 | /** @type {import('eslint').Linter.Config[]} */ 4 | export default basic 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bfehub/root", 3 | "type": "module", 4 | "version": "1.0.0", 5 | "license": "MIT", 6 | "author": "haiweilian ", 7 | "private": true, 8 | "scripts": { 9 | "prepare": "husky", 10 | "preinstall": "npx only-allow pnpm", 11 | "commit": "cz", 12 | "lint:lint-staged": "lint-staged", 13 | "lint:eslint": "eslint --fix --cache \"**/*.{js,jsx,ts,tsx,vue}\"", 14 | "lint:stylelint": "stylelint --fix --cache \"**/*.{css,scss,less,styl,vue}\"", 15 | "lint:prettier": "prettier --write \"**/*.{css,scss,less,styl,js,jsx,ts,tsx,vue}\"", 16 | "version": "changeset version", 17 | "publish": "changeset publish" 18 | }, 19 | "devDependencies": { 20 | "@bfehub/eslint-config-basic": "workspace:*", 21 | "@bfehub/eslint-config-react": "workspace:*", 22 | "@bfehub/eslint-config-typescript": "workspace:*", 23 | "@bfehub/eslint-config-vue": "workspace:*", 24 | "@bfehub/stylelint-config-basic": "workspace:*", 25 | "@changesets/cli": "^2.27.8", 26 | "@commitlint/cli": "^19.5.0", 27 | "@commitlint/config-conventional": "^19.5.0", 28 | "@commitlint/cz-commitlint": "^19.5.0", 29 | "commitizen": "^4.3.0", 30 | "eslint": "^9.10.0", 31 | "husky": "^9.1.6", 32 | "lint-staged": "^15.2.10", 33 | "postcss": "^8.4.45", 34 | "prettier": "^3.3.3", 35 | "stylelint": "^16.9.0", 36 | "typescript": "^5.6.2" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/create-lint/.npmignore: -------------------------------------------------------------------------------- 1 | !.npmrc 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /packages/create-lint/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @bfehub/create-lint 2 | 3 | ## 3.1.0 4 | 5 | ### Minor Changes 6 | 7 | - fdef8aa: updated dependencies 8 | 9 | ## 3.0.0 10 | 11 | ### Major Changes 12 | 13 | - 7970f7b: - Migration of pure ESM 14 | 15 | - Migration of ESLint Flat Config 16 | 17 | ## 2.1.0 18 | 19 | ### Minor Changes 20 | 21 | - add vitest vue/react 22 | 23 | ## 2.0.2 24 | 25 | ### Patch Changes 26 | 27 | - 149c933: config order group 28 | 29 | ## 2.0.1 30 | 31 | ### Patch Changes 32 | 33 | - efe2d17: upgrade dependencies 34 | 35 | ## 2.0.0 36 | 37 | ### Major Changes 38 | 39 | - c9bc4dc: update prettier v3 40 | 41 | ## 1.3.2 42 | 43 | ### Patch Changes 44 | 45 | - 13f6d16: change the configuration file suffix name. 46 | 47 | ## 1.3.1 48 | 49 | ### Patch Changes 50 | 51 | - add vitest config 52 | 53 | ## 1.3.0 54 | 55 | ### Minor Changes 56 | 57 | - update dep 58 | 59 | ## 1.0.7 60 | 61 | ### Patch Changes 62 | 63 | - 修复安装错误 64 | 65 | ## 1.0.6 66 | 67 | ### Patch Changes 68 | 69 | - 修复安装错误 70 | 71 | ## 1.0.5 72 | 73 | ### Patch Changes 74 | 75 | - 优化安装方式 76 | 77 | ## 1.0.4 78 | 79 | ### Patch Changes 80 | 81 | - add jest test 82 | 83 | ## 1.0.3 84 | 85 | ### Patch Changes 86 | 87 | - fix stylelint postcss deps 88 | 89 | ## 1.0.2 90 | 91 | ### Patch Changes 92 | 93 | - add rules 94 | 95 | ## 1.0.1 96 | 97 | ### Patch Changes 98 | 99 | - add stylelint rules 100 | 101 | ## 1.0.0 102 | 103 | ### Major Changes 104 | 105 | - feat: add commit preset 106 | 107 | feat: add release preset 108 | 109 | feat: add files preset 110 | 111 | ## 0.0.2 112 | 113 | ### Patch Changes 114 | 115 | - add commit preset 116 | 117 | ## 0.0.1 118 | 119 | ### Patch Changes 120 | 121 | - Initial Version 122 | -------------------------------------------------------------------------------- /packages/create-lint/README.md: -------------------------------------------------------------------------------- 1 | # @bfehub/create-lint 2 | 3 | ## Usage 4 | 5 | 使用命令行按需选择,将自动创建好配置文件和安装依赖包。 6 | 7 | ```sh 8 | npm create @bfehub/lint 9 | # when pnpm workspace 10 | npm create @bfehub/lint -w 11 | ``` 12 | 13 | 14 | -------------------------------------------------------------------------------- /packages/create-lint/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import path from 'node:path' 4 | import { installPackage } from '@antfu/install-pkg' 5 | import fse from 'fs-extra' 6 | import { blue } from 'kolorist' 7 | import prompts from 'prompts' 8 | import { isModule } from './utils/index.js' 9 | 10 | const __dirname = new URL('.', import.meta.url).pathname 11 | 12 | async function main() { 13 | const options = { 14 | cwd: process.cwd(), 15 | result: {}, 16 | module: false, 17 | } 18 | options.module = await isModule(options.cwd) 19 | 20 | // 获取用户交互配置 21 | options.result = await prompts([ 22 | { 23 | type: 'select', 24 | name: 'eslint', 25 | message: 'Pick a eslint preset', 26 | choices: [ 27 | { title: 'none', value: [] }, 28 | { title: 'basic', value: ['eslint-basic'] }, 29 | { title: 'typescript', value: ['eslint-typescript'] }, 30 | { title: 'vue', value: ['eslint-vue'] }, 31 | { title: 'react', value: ['eslint-react'] }, 32 | { title: 'antfu-config', value: ['eslint-antfu'] }, 33 | ], 34 | }, 35 | { 36 | type: 'select', 37 | name: 'stylelint', 38 | message: 'Pick a stylelint preset', 39 | choices: [ 40 | { title: 'none', value: [] }, 41 | { title: 'basic', value: ['stylelint-basic'] }, 42 | ], 43 | }, 44 | { 45 | type: 'select', 46 | name: 'commit', 47 | message: 'Pick a commit preset', 48 | choices: [ 49 | { title: 'none', value: [] }, 50 | { title: 'basic', value: ['commit-basic'] }, 51 | ], 52 | }, 53 | { 54 | type: 'select', 55 | name: 'release', 56 | message: 'Pick a release preset', 57 | choices: [ 58 | { title: 'none', value: [] }, 59 | { title: 'changesets', value: ['release-changesets'] }, 60 | { title: 'release-it', value: ['release-release-it'] }, 61 | ], 62 | }, 63 | { 64 | type: 'select', 65 | name: 'test', 66 | message: 'Pick a test preset', 67 | choices: [ 68 | { title: 'none', value: [] }, 69 | { title: 'vitest-vue', value: ['test-vitest-vue'] }, 70 | { title: 'vitest-react', value: ['test-vitest-react'] }, 71 | ], 72 | }, 73 | { 74 | type: 'multiselect', 75 | name: 'files', 76 | message: 'Pick files preset', 77 | hint: 'Space to select. Return to submit', 78 | choices: [ 79 | { title: '.editorconfig', value: 'file-basic/editorconfig' }, 80 | { title: '.gitignore', value: 'file-basic/gitignore' }, 81 | { title: '.npmrc', value: 'file-basic/npmrc' }, 82 | ], 83 | }, 84 | ]) 85 | 86 | // 获取配置文件信息 87 | const tplPath = path.resolve(__dirname, 'template') 88 | const results = Object.values(options.result).flat() 89 | const configs = [] 90 | for (const file of results) { 91 | const config = await import(path.resolve(tplPath, file, 'config.js')) 92 | configs.push(config.default(options)) 93 | } 94 | 95 | // 安装依赖包 96 | const pkgNames = Array.from( 97 | new Set(configs.map((config) => config.pkg).flat()) 98 | ) 99 | await installPackage(pkgNames, { 100 | dev: true, 101 | cwd: options.cwd, 102 | additionalArgs: process.argv.slice(2), 103 | }) 104 | 105 | // 安装后执行 106 | for (const { afterInstall } of configs) { 107 | afterInstall && (await afterInstall()) 108 | } 109 | 110 | // 生成配置文件 111 | const configFiles = Array.from( 112 | new Set(configs.map((config) => config.file).flat()) 113 | ) 114 | await Promise.all( 115 | configFiles.map((configFile) => { 116 | fse.copyFile( 117 | path.resolve(tplPath, configFile), 118 | path.resolve( 119 | options.cwd, 120 | (options.module 121 | ? configFile 122 | : configFile.replace(/\.js$/, '.mjs') 123 | ).slice(configFile.lastIndexOf('/') + 1) 124 | ) 125 | ) 126 | }) 127 | ) 128 | 129 | console.log(blue('✨ created success. ✨')) 130 | } 131 | 132 | main().catch((e) => { 133 | console.error(e) 134 | process.exit(1) 135 | }) 136 | -------------------------------------------------------------------------------- /packages/create-lint/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bfehub/create-lint", 3 | "type": "module", 4 | "version": "3.1.0", 5 | "description": "lint cli", 6 | "author": "haiweilian ", 7 | "homepage": "https://github.com/bfehub/lint", 8 | "license": "MIT", 9 | "main": "index.js", 10 | "bin": { 11 | "create-lint": "index.js" 12 | }, 13 | "publishConfig": { 14 | "access": "public" 15 | }, 16 | "dependencies": { 17 | "@antfu/install-pkg": "^0.4.1", 18 | "fs-extra": "^11.2.0", 19 | "kolorist": "^1.8.0", 20 | "prompts": "^2.4.2", 21 | "which-pm-runs": "^1.1.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/create-lint/template/base/.prettierignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | -------------------------------------------------------------------------------- /packages/create-lint/template/base/.prettierrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('prettier').Options} */ 2 | export default { 3 | semi: false, 4 | trailingComma: 'es5', 5 | singleQuote: true, 6 | printWidth: 120, 7 | } 8 | -------------------------------------------------------------------------------- /packages/create-lint/template/commit-basic/.commitlintrc.js: -------------------------------------------------------------------------------- 1 | export default { 2 | extends: ['@commitlint/config-conventional'], 3 | } 4 | -------------------------------------------------------------------------------- /packages/create-lint/template/commit-basic/.czrc: -------------------------------------------------------------------------------- 1 | { 2 | "path": "@commitlint/cz-commitlint" 3 | } 4 | -------------------------------------------------------------------------------- /packages/create-lint/template/commit-basic/.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | npx --no-install commitlint --edit $1 4 | -------------------------------------------------------------------------------- /packages/create-lint/template/commit-basic/.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | npx lint-staged 4 | -------------------------------------------------------------------------------- /packages/create-lint/template/commit-basic/.lintstagedrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('lint-staged').Config} */ 2 | export default { 3 | '*.{js?(x),ts?(x)}': ['eslint --fix', 'prettier --write'], 4 | '*.{css,scss,less}': ['stylelint --fix', 'prettier --write'], 5 | '*.vue': ['eslint --fix', 'stylelint --fix', 'prettier --write'], 6 | 'package.json': ['prettier --write'], 7 | } 8 | -------------------------------------------------------------------------------- /packages/create-lint/template/commit-basic/config.js: -------------------------------------------------------------------------------- 1 | import { spawnSync } from 'node:child_process' 2 | import { setPkg } from '../../utils/index.js' 3 | 4 | // https://github.com/typicode/husky 5 | // https://github.com/okonet/lint-staged 6 | // https://github.com/commitizen/cz-cli 7 | // https://github.com/conventional-changelog/commitlint 8 | export default (options) => { 9 | return { 10 | pkg: [ 11 | 'husky', 12 | 'lint-staged', 13 | 'commitizen', 14 | '@commitlint/cli', 15 | '@commitlint/cz-commitlint', 16 | '@commitlint/config-conventional', 17 | ], 18 | file: [ 19 | 'commit-basic/.husky/pre-commit', 20 | 'commit-basic/.husky/commit-msg', 21 | 'commit-basic/.lintstagedrc.js', 22 | 'commit-basic/.czrc', 23 | 'commit-basic/.commitlintrc.js', 24 | ], 25 | async afterInstall() { 26 | await setPkg(options.cwd, { 27 | scripts: { 28 | prepare: 'husky', 29 | commit: 'cz', 30 | }, 31 | }) 32 | 33 | spawnSync('npm', ['run', 'prepare'], { 34 | cwd: options.cwd, 35 | }) 36 | }, 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/create-lint/template/eslint-antfu/config.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | return { 3 | pkg: ['eslint', '@antfu/eslint-config'], 4 | file: ['eslint-antfu/eslint.config.js'], 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/create-lint/template/eslint-antfu/eslint.config.js: -------------------------------------------------------------------------------- 1 | import antfu from '@antfu/eslint-config' 2 | 3 | // https://github.com/antfu/eslint-config 4 | export default antfu() 5 | -------------------------------------------------------------------------------- /packages/create-lint/template/eslint-basic/config.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | return { 3 | pkg: ['eslint', 'prettier', '@bfehub/eslint-config-basic'], 4 | file: [ 5 | 'base/.prettierignore', 6 | 'base/.prettierrc.js', 7 | 'eslint-basic/eslint.config.js', 8 | ], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/create-lint/template/eslint-basic/eslint.config.js: -------------------------------------------------------------------------------- 1 | import basic from '@bfehub/eslint-config-basic' 2 | 3 | /** @type {import('eslint').Linter.Config[]} */ 4 | export default basic 5 | -------------------------------------------------------------------------------- /packages/create-lint/template/eslint-react/config.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | return { 3 | pkg: ['eslint', 'prettier', 'typescript', '@bfehub/eslint-config-react'], 4 | file: [ 5 | 'base/.prettierignore', 6 | 'base/.prettierrc.js', 7 | 'eslint-react/eslint.config.js', 8 | ], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/create-lint/template/eslint-react/eslint.config.js: -------------------------------------------------------------------------------- 1 | import react from '@bfehub/eslint-config-react' 2 | 3 | /** @type {import('eslint').Linter.Config[]} */ 4 | export default react 5 | -------------------------------------------------------------------------------- /packages/create-lint/template/eslint-typescript/config.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | return { 3 | pkg: [ 4 | 'eslint', 5 | 'prettier', 6 | 'typescript', 7 | '@bfehub/eslint-config-typescript', 8 | ], 9 | file: [ 10 | 'base/.prettierignore', 11 | 'base/.prettierrc.js', 12 | 'eslint-typescript/eslint.config.js', 13 | ], 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/create-lint/template/eslint-typescript/eslint.config.js: -------------------------------------------------------------------------------- 1 | import typescript from '@bfehub/eslint-config-typescript' 2 | 3 | /** @type {import('eslint').Linter.Config[]} */ 4 | export default typescript 5 | -------------------------------------------------------------------------------- /packages/create-lint/template/eslint-vue/config.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | return { 3 | pkg: ['eslint', 'prettier', 'typescript', '@bfehub/eslint-config-vue'], 4 | file: [ 5 | 'base/.prettierignore', 6 | 'base/.prettierrc.js', 7 | 'eslint-vue/eslint.config.js', 8 | ], 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/create-lint/template/eslint-vue/eslint.config.js: -------------------------------------------------------------------------------- 1 | import vue from '@bfehub/eslint-config-vue' 2 | 3 | /** @type {import('eslint').Linter.Config[]} */ 4 | export default vue 5 | -------------------------------------------------------------------------------- /packages/create-lint/template/file-basic/editorconfig/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /packages/create-lint/template/file-basic/editorconfig/config.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | return { 3 | pkg: [], 4 | file: ['file-basic/editorconfig/.editorconfig'], 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/create-lint/template/file-basic/gitignore/.gitignore: -------------------------------------------------------------------------------- 1 | # System 2 | .DS_Store 3 | 4 | # Coverage directory 5 | coverage 6 | 7 | # Build Generate 8 | dist 9 | 10 | # Logs 11 | logs 12 | *.log 13 | npm-debug.log* 14 | yarn-debug.log* 15 | yarn-error.log* 16 | 17 | # Caches 18 | .eslintcache 19 | .stylelintcache 20 | 21 | # Dependency directories 22 | node_modules 23 | bower_components 24 | jspm_packages 25 | 26 | # Editor directories and files 27 | .idea 28 | *.suo 29 | *.ntvs* 30 | *.njsproj 31 | *.sln 32 | *.sw? 33 | -------------------------------------------------------------------------------- /packages/create-lint/template/file-basic/gitignore/config.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | return { 3 | pkg: [], 4 | file: ['file-basic/gitignore/.gitignore'], 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/create-lint/template/file-basic/npmrc/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmmirror.com 2 | disturl=https://npmmirror.com/dist 3 | sass_binary_site=https://npmmirror.com/mirrors/node-sass/ 4 | phantomjs_cdnurl=https://npmmirror.com/mirrors/phantomjs/ 5 | electron_mirror=https://npmmirror.com/mirrors/electron/ 6 | chromedriver_cdnurl=https://npmmirror.com/mirrors/chromedriver 7 | operadriver_cdnurl=https://npmmirror.com/mirrors/operadriver 8 | selenium_cdnurl=https://npmmirror.com/mirrors/selenium 9 | node_inspector_cdnurl=https://npmmirror.com/mirrors/node-inspector 10 | fsevents_binary_host_mirror=http://npmmirror.com/mirrors/fsevents/ 11 | -------------------------------------------------------------------------------- /packages/create-lint/template/file-basic/npmrc/config.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | return { 3 | pkg: [], 4 | file: ['file-basic/npmrc/.npmrc'], 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/create-lint/template/release-changesets/config.js: -------------------------------------------------------------------------------- 1 | import { spawnSync } from 'node:child_process' 2 | import { setPkg } from '../../utils/index.js' 3 | 4 | // https://github.com/changesets/changesets 5 | export default (options) => { 6 | return { 7 | pkg: ['@changesets/cli'], 8 | file: [], 9 | async afterInstall() { 10 | await setPkg(options.cwd, { 11 | scripts: { 12 | version: 'changeset version', 13 | publish: 'changeset publish', 14 | }, 15 | }) 16 | 17 | spawnSync('npx', ['changeset', 'init'], { 18 | cwd: options.cwd, 19 | }) 20 | }, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/create-lint/template/release-release-it/.release-it.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/release-it/schema/release-it.json", 3 | "git": { 4 | "commitMessage": "chore: release v${version}" 5 | }, 6 | "plugins": { 7 | "@release-it/conventional-changelog": { 8 | "preset": "angular", 9 | "infile": "CHANGELOG.md", 10 | "ignoreRecommendedBump": true 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/create-lint/template/release-release-it/config.js: -------------------------------------------------------------------------------- 1 | import { setPkg } from '../../utils/index.js' 2 | 3 | // https://github.com/release-it/release-it 4 | export default (options) => { 5 | return { 6 | pkg: ['release-it', '@release-it/conventional-changelog'], 7 | file: ['release-release-it/.release-it.json'], 8 | async afterInstall() { 9 | await setPkg(options.cwd, { 10 | scripts: { 11 | release: 'release-it', 12 | }, 13 | }) 14 | }, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/create-lint/template/stylelint-basic/.stylelintignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | -------------------------------------------------------------------------------- /packages/create-lint/template/stylelint-basic/.stylelintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('stylelint').Config} */ 2 | export default { 3 | extends: '@bfehub/stylelint-config-basic', 4 | } 5 | -------------------------------------------------------------------------------- /packages/create-lint/template/stylelint-basic/config.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | return { 3 | pkg: ['stylelint', 'prettier', 'postcss', '@bfehub/stylelint-config-basic'], 4 | file: [ 5 | 'base/.prettierignore', 6 | 'base/.prettierrc.js', 7 | 'stylelint-basic/.stylelintignore', 8 | 'stylelint-basic/.stylelintrc.js', 9 | ], 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/create-lint/template/test-vitest-react/config.js: -------------------------------------------------------------------------------- 1 | import { setPkg } from '../../utils/index.js' 2 | 3 | // https://github.com/vitest-dev/vitest 4 | // https://github.com/testing-library/react-testing-library 5 | export default (options) => { 6 | return { 7 | pkg: [ 8 | 'vitest', 9 | '@vitest/ui', 10 | '@vitest/coverage-v8', 11 | '@vitejs/plugin-react', 12 | '@testing-library/react', 13 | 'happy-dom', 14 | ], 15 | file: ['test-vitest-react/vitest.config.ts'], 16 | async afterInstall() { 17 | await setPkg(options.cwd, { 18 | scripts: { 19 | test: 'vitest', 20 | 'test:ui': 'vitest --ui', 21 | 'test:coverage': 'vitest run --coverage', 22 | }, 23 | }) 24 | }, 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/create-lint/template/test-vitest-react/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import react from '@vitejs/plugin-react' 2 | import { defineConfig } from 'vitest/config' 3 | 4 | // https://cn.vitest.dev/config/ 5 | // Can write vite.config.ts if it already exists 6 | export default defineConfig({ 7 | plugins: [react()], 8 | test: { 9 | environment: 'happy-dom', 10 | }, 11 | }) 12 | -------------------------------------------------------------------------------- /packages/create-lint/template/test-vitest-vue/config.js: -------------------------------------------------------------------------------- 1 | import { setPkg } from '../../utils/index.js' 2 | 3 | // https://github.com/vitest-dev/vitest 4 | // https://github.com/vuejs/test-utils 5 | export default (options) => { 6 | return { 7 | pkg: [ 8 | 'vitest', 9 | '@vitest/ui', 10 | '@vitest/coverage-v8', 11 | '@vitejs/plugin-vue', 12 | '@vue/test-utils', 13 | 'happy-dom', 14 | ], 15 | file: ['test-vitest-vue/vitest.config.ts'], 16 | async afterInstall() { 17 | await setPkg(options.cwd, { 18 | scripts: { 19 | test: 'vitest', 20 | 'test:ui': 'vitest --ui', 21 | 'test:coverage': 'vitest run --coverage', 22 | }, 23 | }) 24 | }, 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/create-lint/template/test-vitest-vue/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import vue from '@vitejs/plugin-vue' 2 | import { defineConfig } from 'vitest/config' 3 | 4 | // https://cn.vitest.dev/config/ 5 | // Can write vite.config.ts if it already exists 6 | export default defineConfig({ 7 | plugins: [vue()], 8 | test: { 9 | environment: 'happy-dom', 10 | }, 11 | }) 12 | -------------------------------------------------------------------------------- /packages/create-lint/utils/index.js: -------------------------------------------------------------------------------- 1 | import path from 'node:path' 2 | import fse from 'fs-extra' 3 | 4 | const getPkg = async (cwd) => { 5 | const pkgPath = path.resolve(cwd, 'package.json') 6 | return await fse.readJSON(pkgPath) 7 | } 8 | 9 | const setPkg = async (cwd, pkgObj) => { 10 | const pkgPath = path.resolve(cwd, 'package.json') 11 | const pkgJson = await fse.readJSON(pkgPath) 12 | 13 | for (const key in pkgObj) { 14 | if (pkgJson[key] && typeof pkgJson[key] === 'object') { 15 | Object.assign(pkgJson[key], pkgObj[key]) 16 | } else { 17 | pkgJson[key] = pkgObj[key] 18 | } 19 | } 20 | 21 | await fse.writeJSON(pkgPath, pkgJson, { spaces: 2 }) 22 | } 23 | 24 | const isModule = async (cwd) => { 25 | const pkg = await getPkg(cwd) 26 | return pkg.type === 'module' 27 | } 28 | 29 | export { getPkg, setPkg, isModule } 30 | -------------------------------------------------------------------------------- /packages/eslint-config-basic/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @bfehub/eslint-config-basic 2 | 3 | ## 3.1.0 4 | 5 | ### Minor Changes 6 | 7 | - fdef8aa: updated dependencies 8 | 9 | ## 3.0.0 10 | 11 | ### Major Changes 12 | 13 | - 7970f7b: - Migration of pure ESM 14 | 15 | - Migration of ESLint Flat Config 16 | 17 | ## 2.1.0 18 | 19 | ### Minor Changes 20 | 21 | - add vitest vue/react 22 | 23 | ## 2.0.2 24 | 25 | ### Patch Changes 26 | 27 | - 149c933: config order group 28 | 29 | ## 2.0.1 30 | 31 | ### Patch Changes 32 | 33 | - efe2d17: upgrade dependencies 34 | 35 | ## 2.0.0 36 | 37 | ### Major Changes 38 | 39 | - c9bc4dc: update prettier v3 40 | 41 | ## 1.3.3 42 | 43 | ### Patch Changes 44 | 45 | - 222be4a: fix rules 46 | 47 | ## 1.3.2 48 | 49 | ### Patch Changes 50 | 51 | - 52 | 53 | ## 1.3.1 54 | 55 | ### Patch Changes 56 | 57 | - fix cli lint 58 | 59 | ## 1.3.0 60 | 61 | ### Minor Changes 62 | 63 | - update dep 64 | 65 | ## 1.0.7 66 | 67 | ### Patch Changes 68 | 69 | - 修复安装错误 70 | 71 | ## 1.0.6 72 | 73 | ### Patch Changes 74 | 75 | - 修复安装错误 76 | 77 | ## 1.0.5 78 | 79 | ### Patch Changes 80 | 81 | - 优化安装方式 82 | 83 | ## 1.0.4 84 | 85 | ### Patch Changes 86 | 87 | - add jest test 88 | 89 | ## 1.0.3 90 | 91 | ### Patch Changes 92 | 93 | - fix stylelint postcss deps 94 | 95 | ## 1.0.2 96 | 97 | ### Patch Changes 98 | 99 | - add rules 100 | 101 | ## 1.0.1 102 | 103 | ### Patch Changes 104 | 105 | - add stylelint rules 106 | 107 | ## 1.0.0 108 | 109 | ### Major Changes 110 | 111 | - feat: add commit preset 112 | 113 | feat: add release preset 114 | 115 | feat: add files preset 116 | 117 | ## 0.0.2 118 | 119 | ### Patch Changes 120 | 121 | - add commit preset 122 | 123 | ## 0.0.1 124 | 125 | ### Patch Changes 126 | 127 | - Initial Version 128 | -------------------------------------------------------------------------------- /packages/eslint-config-basic/README.md: -------------------------------------------------------------------------------- 1 | # @bfehub/eslint-config-basic 2 | 3 | ## Usage 4 | 5 | 使用 `npm` or `yarn` or `pnpm` 安装。 6 | 7 | ```sh 8 | npm install -D eslint prettier @bfehub/eslint-config-basic 9 | ``` 10 | 11 | 添加 `eslint.config.js` / `eslint.config.mjs` 配置文件。 12 | 13 | ```js 14 | import basic from '@bfehub/eslint-config-basic' 15 | 16 | /** @type {import('eslint').Linter.Config[]} */ 17 | export default basic 18 | ``` 19 | -------------------------------------------------------------------------------- /packages/eslint-config-basic/index.js: -------------------------------------------------------------------------------- 1 | import js from '@eslint/js' 2 | import pluginImport from 'eslint-plugin-import-x' 3 | import pluginNode from 'eslint-plugin-n' 4 | import pluginPrettier from 'eslint-plugin-prettier/recommended' 5 | import pluginPromise from 'eslint-plugin-promise' 6 | import globals from 'globals' 7 | 8 | // https://eslint.org/docs/user-guide/getting-started 9 | /** @type {import('eslint').Linter.Config[]} */ 10 | export default [ 11 | // https://eslint.org/docs/latest/use/configure/language-options 12 | { 13 | languageOptions: { 14 | sourceType: 'module', 15 | ecmaVersion: 'latest', 16 | parserOptions: { 17 | ecmaFeatures: { 18 | jsx: true, 19 | }, 20 | }, 21 | globals: { 22 | ...globals.browser, 23 | ...globals.builtin, 24 | ...globals.node, 25 | window: 'readonly', 26 | document: 'readonly', 27 | navigator: 'readonly', 28 | }, 29 | }, 30 | }, 31 | 32 | // https://eslint.org/docs/latest/rules 33 | js.configs.recommended, 34 | 35 | // https://github.com/eslint-community/eslint-plugin-promise 36 | { 37 | plugins: { 38 | promise: pluginPromise, 39 | }, 40 | rules: { 41 | 'promise/param-names': 'error', 42 | }, 43 | }, 44 | 45 | // https://github.com/eslint-community/eslint-plugin-n 46 | { 47 | plugins: { 48 | // Rename to be compatible with eslint-plugin-node 49 | node: pluginNode, 50 | }, 51 | rules: { 52 | 'node/handle-callback-err': ['error', '^(err|error)$'], 53 | 'node/no-callback-literal': 'error', 54 | 'node/no-deprecated-api': 'error', 55 | 'node/no-exports-assign': 'error', 56 | 'node/no-new-require': 'error', 57 | 'node/no-path-concat': 'error', 58 | 'node/process-exit-as-throw': 'error', 59 | }, 60 | }, 61 | 62 | // https://github.com/un-ts/eslint-plugin-import-x 63 | { 64 | plugins: { 65 | // Rename to be compatible with eslint-plugin-import 66 | import: pluginImport, 67 | }, 68 | rules: { 69 | 'import/export': 'error', 70 | 'import/first': 'error', 71 | 'import/no-absolute-path': 'error', 72 | 'import/no-duplicates': 'error', 73 | 'import/no-named-default': 'error', 74 | 'import/no-webpack-loader-syntax': 'error', 75 | 'import/order': [ 76 | 'error', 77 | { 78 | pathGroups: [ 79 | { 80 | pattern: '@/**', 81 | group: 'external', 82 | position: 'after', 83 | }, 84 | { 85 | pattern: '#/**', 86 | group: 'external', 87 | position: 'after', 88 | }, 89 | { 90 | pattern: '~/**', 91 | group: 'external', 92 | position: 'after', 93 | }, 94 | ], 95 | alphabetize: { 96 | order: 'asc', 97 | caseInsensitive: true, 98 | }, 99 | }, 100 | ], 101 | }, 102 | }, 103 | 104 | // https://github.com/prettier/eslint-plugin-prettier 105 | // Turns off all rules that are unnecessary or might conflict with Prettier. 106 | pluginPrettier, 107 | ] 108 | -------------------------------------------------------------------------------- /packages/eslint-config-basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bfehub/eslint-config-basic", 3 | "type": "module", 4 | "version": "3.1.0", 5 | "description": "eslint basic", 6 | "author": "haiweilian ", 7 | "homepage": "https://github.com/bfehub/lint", 8 | "license": "MIT", 9 | "main": "index.js", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "peerDependencies": { 14 | "eslint": ">=9.0.0", 15 | "prettier": ">=3.0.0" 16 | }, 17 | "dependencies": { 18 | "@eslint/js": "^9.10.0", 19 | "eslint-config-prettier": "^9.1.0", 20 | "eslint-plugin-import-x": "^4.2.1", 21 | "eslint-plugin-n": "^17.10.2", 22 | "eslint-plugin-prettier": "^5.2.1", 23 | "eslint-plugin-promise": "^7.1.0", 24 | "globals": "^15.9.0" 25 | }, 26 | "devDependencies": { 27 | "eslint": "^9.10.0", 28 | "prettier": "^3.3.3" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/eslint-config-react/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @bfehub/eslint-config-react 2 | 3 | ## 3.1.0 4 | 5 | ### Minor Changes 6 | 7 | - fdef8aa: updated dependencies 8 | 9 | ### Patch Changes 10 | 11 | - Updated dependencies [fdef8aa] 12 | - @bfehub/eslint-config-typescript@3.1.0 13 | 14 | ## 3.0.0 15 | 16 | ### Major Changes 17 | 18 | - 7970f7b: - Migration of pure ESM 19 | 20 | - Migration of ESLint Flat Config 21 | 22 | ### Patch Changes 23 | 24 | - Updated dependencies [7970f7b] 25 | - @bfehub/eslint-config-typescript@3.0.0 26 | 27 | ## 2.1.0 28 | 29 | ### Minor Changes 30 | 31 | - add vitest vue/react 32 | 33 | ### Patch Changes 34 | 35 | - Updated dependencies 36 | - @bfehub/eslint-config-typescript@2.1.0 37 | 38 | ## 2.0.2 39 | 40 | ### Patch Changes 41 | 42 | - 149c933: config order group 43 | - Updated dependencies [149c933] 44 | - @bfehub/eslint-config-typescript@2.0.2 45 | 46 | ## 2.0.1 47 | 48 | ### Patch Changes 49 | 50 | - efe2d17: upgrade dependencies 51 | - Updated dependencies [efe2d17] 52 | - @bfehub/eslint-config-typescript@2.0.1 53 | 54 | ## 2.0.0 55 | 56 | ### Major Changes 57 | 58 | - c9bc4dc: update prettier v3 59 | 60 | ### Patch Changes 61 | 62 | - Updated dependencies [c9bc4dc] 63 | - @bfehub/eslint-config-typescript@2.0.0 64 | 65 | ## 1.3.3 66 | 67 | ### Patch Changes 68 | 69 | - 222be4a: fix rules 70 | - Updated dependencies [222be4a] 71 | - @bfehub/eslint-config-typescript@1.3.3 72 | 73 | ## 1.3.2 74 | 75 | ### Patch Changes 76 | 77 | - 78 | 79 | - Updated dependencies 80 | - @bfehub/eslint-config-typescript@1.3.2 81 | 82 | ## 1.3.1 83 | 84 | ### Patch Changes 85 | 86 | - fix cli lint 87 | - Updated dependencies 88 | - @bfehub/eslint-config-typescript@1.3.1 89 | 90 | ## 1.3.0 91 | 92 | ### Minor Changes 93 | 94 | - update dep 95 | 96 | ### Patch Changes 97 | 98 | - Updated dependencies 99 | - @bfehub/eslint-config-typescript@1.3.0 100 | 101 | ## 1.0.7 102 | 103 | ### Patch Changes 104 | 105 | - 修复安装错误 106 | - Updated dependencies 107 | - @bfehub/eslint-config-typescript@1.0.7 108 | 109 | ## 1.0.6 110 | 111 | ### Patch Changes 112 | 113 | - 修复安装错误 114 | - Updated dependencies 115 | - @bfehub/eslint-config-typescript@1.0.6 116 | 117 | ## 1.0.5 118 | 119 | ### Patch Changes 120 | 121 | - 优化安装方式 122 | - Updated dependencies 123 | - @bfehub/eslint-config-typescript@1.0.5 124 | 125 | ## 1.0.4 126 | 127 | ### Patch Changes 128 | 129 | - add jest test 130 | - Updated dependencies 131 | - @bfehub/eslint-config-typescript@1.0.4 132 | 133 | ## 1.0.3 134 | 135 | ### Patch Changes 136 | 137 | - fix stylelint postcss deps 138 | - Updated dependencies 139 | - @bfehub/eslint-config-typescript@1.0.3 140 | 141 | ## 1.0.2 142 | 143 | ### Patch Changes 144 | 145 | - add rules 146 | - Updated dependencies 147 | - @bfehub/eslint-config-typescript@1.0.2 148 | 149 | ## 1.0.1 150 | 151 | ### Patch Changes 152 | 153 | - add stylelint rules 154 | - Updated dependencies 155 | - @bfehub/eslint-config-typescript@1.0.1 156 | 157 | ## 1.0.0 158 | 159 | ### Major Changes 160 | 161 | - feat: add commit preset 162 | 163 | feat: add release preset 164 | 165 | feat: add files preset 166 | 167 | ### Patch Changes 168 | 169 | - Updated dependencies 170 | - @bfehub/eslint-config-typescript@1.0.0 171 | 172 | ## 0.0.2 173 | 174 | ### Patch Changes 175 | 176 | - add commit preset 177 | - Updated dependencies 178 | - @bfehub/eslint-config-typescript@0.0.2 179 | 180 | ## 0.0.1 181 | 182 | ### Patch Changes 183 | 184 | - Initial Version 185 | - Updated dependencies 186 | - @bfehub/eslint-config-typescript@0.0.1 187 | -------------------------------------------------------------------------------- /packages/eslint-config-react/README.md: -------------------------------------------------------------------------------- 1 | # @bfehub/eslint-config-react 2 | 3 | ## Usage 4 | 5 | 使用 `npm` or `yarn` or `pnpm` 安装。 6 | 7 | ```sh 8 | npm install -D eslint prettier typescript @bfehub/eslint-config-react 9 | ``` 10 | 11 | 添加 `eslint.config.js` / `eslint.config.mjs` 配置文件。 12 | 13 | ```js 14 | import react from '@bfehub/eslint-config-react' 15 | 16 | /** @type {import('eslint').Linter.Config[]} */ 17 | export default react 18 | ``` 19 | -------------------------------------------------------------------------------- /packages/eslint-config-react/index.js: -------------------------------------------------------------------------------- 1 | import typescript from '@bfehub/eslint-config-typescript' 2 | import configPrettier from 'eslint-config-prettier' 3 | import pluginReact from 'eslint-plugin-react' 4 | import pluginReactRecommended from 'eslint-plugin-react/configs/recommended.js' 5 | import pluginReactHooks from 'eslint-plugin-react-hooks' 6 | 7 | // https://github.com/facebook/react 8 | /** @type {import('eslint').Linter.Config[]} */ 9 | export default [ 10 | // @bfehub/eslint-config-typescript 11 | ...typescript, 12 | 13 | // https://github.com/jsx-eslint/eslint-plugin-react 14 | { 15 | plugins: { 16 | react: pluginReact, 17 | }, 18 | settings: { 19 | react: { 20 | version: 'detect', 21 | }, 22 | }, 23 | ...pluginReactRecommended, 24 | }, 25 | { 26 | rules: { 27 | 'react/prop-types': 'off', 28 | 'react/react-in-jsx-scope': 'off', 29 | }, 30 | }, 31 | 32 | // https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks 33 | { 34 | plugins: { 35 | 'react-hooks': pluginReactHooks, 36 | }, 37 | rules: { 38 | 'react-hooks/exhaustive-deps': 'warn', 39 | 'react-hooks/rules-of-hooks': 'error', 40 | }, 41 | }, 42 | 43 | // https://github.com/prettier/eslint-config-prettier 44 | // Turns off all rules that are unnecessary or might conflict with Prettier. 45 | configPrettier, 46 | ] 47 | -------------------------------------------------------------------------------- /packages/eslint-config-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bfehub/eslint-config-react", 3 | "type": "module", 4 | "version": "3.1.0", 5 | "description": "eslint react", 6 | "author": "haiweilian ", 7 | "homepage": "https://github.com/bfehub/lint", 8 | "license": "MIT", 9 | "main": "index.js", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "peerDependencies": { 14 | "eslint": ">=9.0.0", 15 | "prettier": ">=3.0.0" 16 | }, 17 | "dependencies": { 18 | "@bfehub/eslint-config-typescript": "workspace:*", 19 | "eslint-config-prettier": "^9.1.0", 20 | "eslint-plugin-react": "^7.36.1", 21 | "eslint-plugin-react-hooks": "^5.0.0" 22 | }, 23 | "devDependencies": { 24 | "eslint": "^9.10.0", 25 | "prettier": "^3.3.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/eslint-config-typescript/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @bfehub/eslint-config-typescript 2 | 3 | ## 3.1.0 4 | 5 | ### Minor Changes 6 | 7 | - fdef8aa: updated dependencies 8 | 9 | ### Patch Changes 10 | 11 | - Updated dependencies [fdef8aa] 12 | - @bfehub/eslint-config-basic@3.1.0 13 | 14 | ## 3.0.0 15 | 16 | ### Major Changes 17 | 18 | - 7970f7b: - Migration of pure ESM 19 | 20 | - Migration of ESLint Flat Config 21 | 22 | ### Patch Changes 23 | 24 | - Updated dependencies [7970f7b] 25 | - @bfehub/eslint-config-basic@3.0.0 26 | 27 | ## 2.1.0 28 | 29 | ### Minor Changes 30 | 31 | - add vitest vue/react 32 | 33 | ### Patch Changes 34 | 35 | - Updated dependencies 36 | - @bfehub/eslint-config-basic@2.1.0 37 | 38 | ## 2.0.2 39 | 40 | ### Patch Changes 41 | 42 | - 149c933: config order group 43 | - Updated dependencies [149c933] 44 | - @bfehub/eslint-config-basic@2.0.2 45 | 46 | ## 2.0.1 47 | 48 | ### Patch Changes 49 | 50 | - efe2d17: upgrade dependencies 51 | - Updated dependencies [efe2d17] 52 | - @bfehub/eslint-config-basic@2.0.1 53 | 54 | ## 2.0.0 55 | 56 | ### Major Changes 57 | 58 | - c9bc4dc: update prettier v3 59 | 60 | ### Patch Changes 61 | 62 | - Updated dependencies [c9bc4dc] 63 | - @bfehub/eslint-config-basic@2.0.0 64 | 65 | ## 1.3.3 66 | 67 | ### Patch Changes 68 | 69 | - 222be4a: fix rules 70 | - Updated dependencies [222be4a] 71 | - @bfehub/eslint-config-basic@1.3.3 72 | 73 | ## 1.3.2 74 | 75 | ### Patch Changes 76 | 77 | - 78 | 79 | - Updated dependencies 80 | - @bfehub/eslint-config-basic@1.3.2 81 | 82 | ## 1.3.1 83 | 84 | ### Patch Changes 85 | 86 | - fix cli lint 87 | - Updated dependencies 88 | - @bfehub/eslint-config-basic@1.3.1 89 | 90 | ## 1.3.0 91 | 92 | ### Minor Changes 93 | 94 | - update dep 95 | 96 | ### Patch Changes 97 | 98 | - Updated dependencies 99 | - @bfehub/eslint-config-basic@1.3.0 100 | 101 | ## 1.0.7 102 | 103 | ### Patch Changes 104 | 105 | - 修复安装错误 106 | - Updated dependencies 107 | - @bfehub/eslint-config-basic@1.0.7 108 | 109 | ## 1.0.6 110 | 111 | ### Patch Changes 112 | 113 | - 修复安装错误 114 | - Updated dependencies 115 | - @bfehub/eslint-config-basic@1.0.6 116 | 117 | ## 1.0.5 118 | 119 | ### Patch Changes 120 | 121 | - 优化安装方式 122 | - Updated dependencies 123 | - @bfehub/eslint-config-basic@1.0.5 124 | 125 | ## 1.0.4 126 | 127 | ### Patch Changes 128 | 129 | - add jest test 130 | - Updated dependencies 131 | - @bfehub/eslint-config-basic@1.0.4 132 | 133 | ## 1.0.3 134 | 135 | ### Patch Changes 136 | 137 | - fix stylelint postcss deps 138 | - Updated dependencies 139 | - @bfehub/eslint-config-basic@1.0.3 140 | 141 | ## 1.0.2 142 | 143 | ### Patch Changes 144 | 145 | - add rules 146 | - Updated dependencies 147 | - @bfehub/eslint-config-basic@1.0.2 148 | 149 | ## 1.0.1 150 | 151 | ### Patch Changes 152 | 153 | - add stylelint rules 154 | - Updated dependencies 155 | - @bfehub/eslint-config-basic@1.0.1 156 | 157 | ## 1.0.0 158 | 159 | ### Major Changes 160 | 161 | - feat: add commit preset 162 | 163 | feat: add release preset 164 | 165 | feat: add files preset 166 | 167 | ### Patch Changes 168 | 169 | - Updated dependencies 170 | - @bfehub/eslint-config-basic@1.0.0 171 | 172 | ## 0.0.2 173 | 174 | ### Patch Changes 175 | 176 | - add commit preset 177 | - Updated dependencies 178 | - @bfehub/eslint-config-basic@0.0.2 179 | 180 | ## 0.0.1 181 | 182 | ### Patch Changes 183 | 184 | - Initial Version 185 | - Updated dependencies 186 | - @bfehub/eslint-config-basic@0.0.1 187 | -------------------------------------------------------------------------------- /packages/eslint-config-typescript/README.md: -------------------------------------------------------------------------------- 1 | # @bfehub/eslint-config-typescript 2 | 3 | ## Usage 4 | 5 | 使用 `npm` or `yarn` or `pnpm` 安装。 6 | 7 | ```sh 8 | npm install -D eslint prettier typescript @bfehub/eslint-config-typescript 9 | ``` 10 | 11 | 添加 `eslint.config.js` / `eslint.config.mjs` 配置文件。 12 | 13 | ```js 14 | import typescript from '@bfehub/eslint-config-typescript' 15 | 16 | /** @type {import('eslint').Linter.Config[]} */ 17 | export default typescript 18 | ``` 19 | -------------------------------------------------------------------------------- /packages/eslint-config-typescript/index.js: -------------------------------------------------------------------------------- 1 | import basic from '@bfehub/eslint-config-basic' 2 | import configPrettier from 'eslint-config-prettier' 3 | import tseslint from 'typescript-eslint' 4 | 5 | // https://typescript-eslint.io/docs/linting 6 | /** @type {import('eslint').Linter.Config[]} */ 7 | export default [ 8 | // @bfehub/eslint-config-basic 9 | ...basic, 10 | 11 | // https://typescript-eslint.io/getting-started 12 | ...tseslint.configs.recommended, 13 | { 14 | rules: { 15 | // override rules 16 | 'no-undef': 'off', 17 | 'no-redeclare': 'off', 18 | '@typescript-eslint/no-redeclare': 'error', 19 | 'no-unused-vars': 'off', 20 | '@typescript-eslint/no-unused-vars': [ 21 | 'error', 22 | { 23 | args: 'none', 24 | caughtErrors: 'none', 25 | ignoreRestSiblings: true, 26 | vars: 'all', 27 | }, 28 | ], 29 | 'no-use-before-define': 'off', 30 | '@typescript-eslint/no-use-before-define': [ 31 | 'error', 32 | { 33 | functions: false, 34 | classes: false, 35 | variables: true, 36 | }, 37 | ], 38 | 'no-useless-constructor': 'off', 39 | 40 | // off rules 41 | '@typescript-eslint/ban-ts-comment': 'off', 42 | '@typescript-eslint/no-explicit-any': 'off', 43 | '@typescript-eslint/no-non-null-assertion': 'off', 44 | '@typescript-eslint/explicit-function-return-type': 'off', 45 | '@typescript-eslint/explicit-member-accessibility': 'off', 46 | '@typescript-eslint/explicit-module-boundary-types': 'off', 47 | }, 48 | }, 49 | 50 | // https://github.com/prettier/eslint-config-prettier 51 | // Turns off all rules that are unnecessary or might conflict with Prettier. 52 | configPrettier, 53 | ] 54 | -------------------------------------------------------------------------------- /packages/eslint-config-typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bfehub/eslint-config-typescript", 3 | "type": "module", 4 | "version": "3.1.0", 5 | "description": "eslint typescript", 6 | "author": "haiweilian ", 7 | "homepage": "https://github.com/bfehub/lint", 8 | "license": "MIT", 9 | "main": "index.js", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "peerDependencies": { 14 | "eslint": ">=9.0.0", 15 | "prettier": ">=3.0.0" 16 | }, 17 | "dependencies": { 18 | "@bfehub/eslint-config-basic": "workspace:*", 19 | "eslint-config-prettier": "^9.1.0", 20 | "typescript-eslint": "^8.15.0" 21 | }, 22 | "devDependencies": { 23 | "eslint": "^9.10.0", 24 | "prettier": "^3.3.3", 25 | "typescript": "^5.6.2" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/eslint-config-vue/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @bfehub/eslint-config-vue 2 | 3 | ## 3.1.0 4 | 5 | ### Minor Changes 6 | 7 | - fdef8aa: updated dependencies 8 | 9 | ### Patch Changes 10 | 11 | - Updated dependencies [fdef8aa] 12 | - @bfehub/eslint-config-typescript@3.1.0 13 | 14 | ## 3.0.0 15 | 16 | ### Major Changes 17 | 18 | - 7970f7b: - Migration of pure ESM 19 | 20 | - Migration of ESLint Flat Config 21 | 22 | ### Patch Changes 23 | 24 | - Updated dependencies [7970f7b] 25 | - @bfehub/eslint-config-typescript@3.0.0 26 | 27 | ## 2.1.0 28 | 29 | ### Minor Changes 30 | 31 | - add vitest vue/react 32 | 33 | ### Patch Changes 34 | 35 | - Updated dependencies 36 | - @bfehub/eslint-config-typescript@2.1.0 37 | 38 | ## 2.0.2 39 | 40 | ### Patch Changes 41 | 42 | - 149c933: config order group 43 | - Updated dependencies [149c933] 44 | - @bfehub/eslint-config-typescript@2.0.2 45 | 46 | ## 2.0.1 47 | 48 | ### Patch Changes 49 | 50 | - efe2d17: upgrade dependencies 51 | - Updated dependencies [efe2d17] 52 | - @bfehub/eslint-config-typescript@2.0.1 53 | 54 | ## 2.0.0 55 | 56 | ### Major Changes 57 | 58 | - c9bc4dc: update prettier v3 59 | 60 | ### Patch Changes 61 | 62 | - Updated dependencies [c9bc4dc] 63 | - @bfehub/eslint-config-typescript@2.0.0 64 | 65 | ## 1.3.3 66 | 67 | ### Patch Changes 68 | 69 | - 222be4a: fix rules 70 | - Updated dependencies [222be4a] 71 | - @bfehub/eslint-config-typescript@1.3.3 72 | 73 | ## 1.3.2 74 | 75 | ### Patch Changes 76 | 77 | - 78 | 79 | - Updated dependencies 80 | - @bfehub/eslint-config-typescript@1.3.2 81 | 82 | ## 1.3.1 83 | 84 | ### Patch Changes 85 | 86 | - fix cli lint 87 | - Updated dependencies 88 | - @bfehub/eslint-config-typescript@1.3.1 89 | 90 | ## 1.3.0 91 | 92 | ### Minor Changes 93 | 94 | - update dep 95 | 96 | ### Patch Changes 97 | 98 | - Updated dependencies 99 | - @bfehub/eslint-config-typescript@1.3.0 100 | 101 | ## 1.0.7 102 | 103 | ### Patch Changes 104 | 105 | - 修复安装错误 106 | - Updated dependencies 107 | - @bfehub/eslint-config-typescript@1.0.7 108 | 109 | ## 1.0.6 110 | 111 | ### Patch Changes 112 | 113 | - 修复安装错误 114 | - Updated dependencies 115 | - @bfehub/eslint-config-typescript@1.0.6 116 | 117 | ## 1.0.5 118 | 119 | ### Patch Changes 120 | 121 | - 优化安装方式 122 | - Updated dependencies 123 | - @bfehub/eslint-config-typescript@1.0.5 124 | 125 | ## 1.0.4 126 | 127 | ### Patch Changes 128 | 129 | - add jest test 130 | - Updated dependencies 131 | - @bfehub/eslint-config-typescript@1.0.4 132 | 133 | ## 1.0.3 134 | 135 | ### Patch Changes 136 | 137 | - fix stylelint postcss deps 138 | - Updated dependencies 139 | - @bfehub/eslint-config-typescript@1.0.3 140 | 141 | ## 1.0.2 142 | 143 | ### Patch Changes 144 | 145 | - add rules 146 | - Updated dependencies 147 | - @bfehub/eslint-config-typescript@1.0.2 148 | 149 | ## 1.0.1 150 | 151 | ### Patch Changes 152 | 153 | - add stylelint rules 154 | - Updated dependencies 155 | - @bfehub/eslint-config-typescript@1.0.1 156 | 157 | ## 1.0.0 158 | 159 | ### Major Changes 160 | 161 | - feat: add commit preset 162 | 163 | feat: add release preset 164 | 165 | feat: add files preset 166 | 167 | ### Patch Changes 168 | 169 | - Updated dependencies 170 | - @bfehub/eslint-config-typescript@1.0.0 171 | 172 | ## 0.0.2 173 | 174 | ### Patch Changes 175 | 176 | - add commit preset 177 | - Updated dependencies 178 | - @bfehub/eslint-config-typescript@0.0.2 179 | 180 | ## 0.0.1 181 | 182 | ### Patch Changes 183 | 184 | - Initial Version 185 | - Updated dependencies 186 | - @bfehub/eslint-config-typescript@0.0.1 187 | -------------------------------------------------------------------------------- /packages/eslint-config-vue/README.md: -------------------------------------------------------------------------------- 1 | # @bfehub/eslint-config-vue 2 | 3 | ## Usage 4 | 5 | 使用 `npm` or `yarn` or `pnpm` 安装。 6 | 7 | ```sh 8 | npm install -D eslint prettier typescript @bfehub/eslint-config-vue 9 | ``` 10 | 11 | 添加 `eslint.config.js` / `eslint.config.mjs` 配置文件。 12 | 13 | ```js 14 | import vue from '@bfehub/eslint-config-vue' 15 | 16 | /** @type {import('eslint').Linter.Config[]} */ 17 | export default vue 18 | ``` 19 | -------------------------------------------------------------------------------- /packages/eslint-config-vue/index.js: -------------------------------------------------------------------------------- 1 | import typescript from '@bfehub/eslint-config-typescript' 2 | import configPrettier from 'eslint-config-prettier' 3 | import pluginVue from 'eslint-plugin-vue' 4 | 5 | // https://eslint.vuejs.org/user-guide 6 | /** @type {import('eslint').Linter.Config[]} */ 7 | export default [ 8 | // @bfehub/eslint-config-typescript 9 | ...typescript, 10 | 11 | // https://eslint.vuejs.org/user-guide/#bundle-configurations 12 | ...pluginVue.configs['flat/recommended'], 13 | { 14 | rules: { 15 | 'vue/max-attributes-per-line': 'off', 16 | 'vue/no-v-html': 'off', 17 | 'vue/require-prop-types': 'off', 18 | 'vue/require-default-prop': 'off', 19 | 'vue/multi-word-component-names': 'off', 20 | }, 21 | }, 22 | { 23 | files: ['**/*.vue'], 24 | languageOptions: { 25 | parserOptions: { 26 | parser: '@typescript-eslint/parser', 27 | sourceType: 'module', 28 | ecmaVersion: 'latest', 29 | ecmaFeatures: { 30 | jsx: true, 31 | }, 32 | }, 33 | }, 34 | }, 35 | 36 | // https://github.com/prettier/eslint-config-prettier 37 | // Turns off all rules that are unnecessary or might conflict with Prettier. 38 | configPrettier, 39 | ] 40 | -------------------------------------------------------------------------------- /packages/eslint-config-vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bfehub/eslint-config-vue", 3 | "type": "module", 4 | "version": "3.1.0", 5 | "description": "eslint vue", 6 | "author": "haiweilian ", 7 | "homepage": "https://github.com/bfehub/lint", 8 | "license": "MIT", 9 | "main": "index.js", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "peerDependencies": { 14 | "eslint": ">=9.0.0", 15 | "prettier": ">=3.0.0" 16 | }, 17 | "dependencies": { 18 | "@bfehub/eslint-config-typescript": "workspace:*", 19 | "@typescript-eslint/parser": "^8.15.0", 20 | "eslint-config-prettier": "^9.1.0", 21 | "eslint-plugin-vue": "^9.28.0" 22 | }, 23 | "devDependencies": { 24 | "eslint": "^9.10.0", 25 | "prettier": "^3.3.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/stylelint-config-basic/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @bfehub/stylelint-config-basic 2 | 3 | ## 3.1.0 4 | 5 | ### Minor Changes 6 | 7 | - fdef8aa: updated dependencies 8 | 9 | ## 3.0.0 10 | 11 | ### Major Changes 12 | 13 | - 7970f7b: - Migration of pure ESM 14 | 15 | - Migration of ESLint Flat Config 16 | 17 | ## 2.1.0 18 | 19 | ### Minor Changes 20 | 21 | - add vitest vue/react 22 | 23 | ## 2.0.2 24 | 25 | ### Patch Changes 26 | 27 | - 149c933: config order group 28 | 29 | ## 2.0.1 30 | 31 | ### Patch Changes 32 | 33 | - efe2d17: upgrade dependencies 34 | 35 | ## 2.0.0 36 | 37 | ### Major Changes 38 | 39 | - c9bc4dc: update prettier v3 40 | 41 | ## 1.3.3 42 | 43 | ### Patch Changes 44 | 45 | - 222be4a: fix rules 46 | 47 | ## 1.3.2 48 | 49 | ### Patch Changes 50 | 51 | - 52 | 53 | ## 1.3.1 54 | 55 | ### Patch Changes 56 | 57 | - fix cli lint 58 | 59 | ## 1.3.0 60 | 61 | ### Minor Changes 62 | 63 | - update dep 64 | 65 | ## 1.0.7 66 | 67 | ### Patch Changes 68 | 69 | - 修复安装错误 70 | 71 | ## 1.0.6 72 | 73 | ### Patch Changes 74 | 75 | - 修复安装错误 76 | 77 | ## 1.0.5 78 | 79 | ### Patch Changes 80 | 81 | - 优化安装方式 82 | 83 | ## 1.0.4 84 | 85 | ### Patch Changes 86 | 87 | - add jest test 88 | 89 | ## 1.0.3 90 | 91 | ### Patch Changes 92 | 93 | - fix stylelint postcss deps 94 | 95 | ## 1.0.2 96 | 97 | ### Patch Changes 98 | 99 | - add rules 100 | 101 | ## 1.0.1 102 | 103 | ### Patch Changes 104 | 105 | - add stylelint rules 106 | 107 | ## 1.0.0 108 | 109 | ### Major Changes 110 | 111 | - feat: add commit preset 112 | 113 | feat: add release preset 114 | 115 | feat: add files preset 116 | 117 | ## 0.0.2 118 | 119 | ### Patch Changes 120 | 121 | - add commit preset 122 | 123 | ## 0.0.1 124 | 125 | ### Patch Changes 126 | 127 | - Initial Version 128 | -------------------------------------------------------------------------------- /packages/stylelint-config-basic/README.md: -------------------------------------------------------------------------------- 1 | # @bfehub/stylelint-config-basic 2 | 3 | ## Usage 4 | 5 | 使用 `npm` or `yarn` or `pnpm` 安装。 6 | 7 | ```sh 8 | npm install -D stylelint prettier @bfehub/stylelint-config-basic 9 | ``` 10 | 11 | 添加 `.stylelintrc.js` / `.stylelintrc.mjs` 配置文件。 12 | 13 | ```js 14 | /** @type {import('stylelint').Config} */ 15 | export default { 16 | extends: '@bfehub/stylelint-config-basic', 17 | } 18 | ``` 19 | -------------------------------------------------------------------------------- /packages/stylelint-config-basic/index.js: -------------------------------------------------------------------------------- 1 | // https://stylelint.io/user-guide/get-started 2 | /** @type {import('stylelint').Config} */ 3 | export default { 4 | overrides: [ 5 | { 6 | files: ['**/*.scss'], 7 | customSyntax: 'postcss-scss', 8 | rules: { 9 | 'import-notation': 'string', 10 | }, 11 | }, 12 | { 13 | files: ['**/*.less'], 14 | customSyntax: 'postcss-less', 15 | rules: { 16 | 'import-notation': 'string', 17 | }, 18 | }, 19 | ], 20 | extends: [ 21 | // https://github.com/ota-meshi/stylelint-config-html 22 | 'stylelint-config-html', 23 | // https://github.com/stylelint/stylelint-config-standard 24 | 'stylelint-config-standard', 25 | // https://github.com/stormwarning/stylelint-config-recess-order 26 | 'stylelint-config-recess-order', 27 | // https://github.com/prettier/stylelint-prettier 28 | 'stylelint-prettier/recommended', 29 | ], 30 | plugins: [ 31 | // https://github.com/hudochenkov/stylelint-order 32 | 'stylelint-order', 33 | ], 34 | rules: { 35 | 'no-empty-source': null, 36 | 'unit-no-unknown': null, 37 | 'at-rule-no-unknown': null, 38 | 'value-no-vendor-prefix': null, 39 | 'selector-class-pattern': null, 40 | 'selector-pseudo-class-no-unknown': [ 41 | true, 42 | { 43 | ignorePseudoClasses: ['deep', 'global', 'slotted'], 44 | }, 45 | ], 46 | }, 47 | } 48 | -------------------------------------------------------------------------------- /packages/stylelint-config-basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bfehub/stylelint-config-basic", 3 | "type": "module", 4 | "version": "3.1.0", 5 | "description": "stylelint basic", 6 | "author": "haiweilian ", 7 | "homepage": "https://github.com/bfehub/lint", 8 | "license": "MIT", 9 | "main": "index.js", 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "peerDependencies": { 14 | "postcss": ">=8.0.0", 15 | "prettier": ">=3.0.0", 16 | "stylelint": ">=15.0.0" 17 | }, 18 | "dependencies": { 19 | "postcss-html": "^1.7.0", 20 | "postcss-less": "^6.0.0", 21 | "postcss-scss": "^4.0.9", 22 | "stylelint-config-html": "^1.1.0", 23 | "stylelint-config-recess-order": "^5.1.0", 24 | "stylelint-config-standard": "^36.0.1", 25 | "stylelint-order": "^6.0.4", 26 | "stylelint-prettier": "^5.0.2" 27 | }, 28 | "devDependencies": { 29 | "postcss": "^8.4.45", 30 | "prettier": "^3.3.3", 31 | "stylelint": "^16.9.0" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'tests/**' 3 | - 'packages/**' 4 | -------------------------------------------------------------------------------- /tests/base/.prettierrc.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('prettier').Options} */ 2 | export default { 3 | semi: false, 4 | trailingComma: 'es5', 5 | singleQuote: true, 6 | } 7 | -------------------------------------------------------------------------------- /tests/base/.stylelintrc.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('stylelint').Config} */ 2 | export default { 3 | extends: '@bfehub/stylelint-config-basic', 4 | } 5 | -------------------------------------------------------------------------------- /tests/base/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "stylelint.validate": [ 3 | "css", 4 | "less", 5 | "postcss", 6 | "scss", 7 | "html", 8 | "xml", 9 | "vue", 10 | "svelte", 11 | "php" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/base/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import basic from '@bfehub/eslint-config-basic' 2 | 3 | /** @type {import('eslint').Linter.Config[]} */ 4 | export default basic 5 | -------------------------------------------------------------------------------- /tests/base/index.css: -------------------------------------------------------------------------------- 1 | /* ❌ */ 2 | 3 | /* .demo { 4 | width: 0px; 5 | } */ 6 | 7 | /* ✅ */ 8 | 9 | .demo { 10 | width: 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/base/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/base/index.js: -------------------------------------------------------------------------------- 1 | // ❌ 2 | // import b from 'b' 3 | // import a from 'a' 4 | // console.log(a, b) 5 | 6 | // ✅ 7 | import a from 'a' 8 | import b from 'b' 9 | console.log(a, b) 10 | 11 | // ❌ 12 | // const eslintBasic = "hello" 13 | 14 | // ✅ 15 | const eslintBasic = 'hello' 16 | console.log(eslintBasic) 17 | 18 | // ❌ 19 | // new Promise((xxx, yyy) => { 20 | // window.true ? xxx() : yyy() 21 | // }) 22 | 23 | // ✅ 24 | new Promise((resolve, reject) => { 25 | window.true ? resolve() : reject() 26 | }) 27 | -------------------------------------------------------------------------------- /tests/base/index.less: -------------------------------------------------------------------------------- 1 | /* ❌ */ 2 | 3 | /* .demo { 4 | width: 0px; 5 | } */ 6 | 7 | /* ✅ */ 8 | 9 | .demo { 10 | width: 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/base/index.scss: -------------------------------------------------------------------------------- 1 | /* ❌ */ 2 | 3 | /* .demo { 4 | width: 0px; 5 | } */ 6 | 7 | /* ✅ */ 8 | 9 | .demo { 10 | width: 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/base/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "base-demo", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "keywords": [], 9 | "author": "", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "@bfehub/eslint-config-basic": "workspace:*", 13 | "@bfehub/stylelint-config-basic": "workspace:*", 14 | "eslint": "^9.10.0", 15 | "postcss": "^8.4.45", 16 | "prettier": "^3.3.3", 17 | "stylelint": "^16.9.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/react/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /tests/react/.prettierrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('prettier').Options} */ 2 | export default { 3 | semi: false, 4 | trailingComma: 'es5', 5 | singleQuote: true, 6 | printWidth: 120, 7 | } 8 | -------------------------------------------------------------------------------- /tests/react/.stylelintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('stylelint').Config} */ 2 | export default { 3 | extends: '@bfehub/stylelint-config-basic', 4 | } 5 | -------------------------------------------------------------------------------- /tests/react/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.codeActionsOnSave": { 3 | "source.fixAll.eslint": "explicit", 4 | "source.fixAll.stylelint": "explicit" 5 | }, 6 | "stylelint.validate": [ 7 | "css", 8 | "less", 9 | "postcss", 10 | "scss", 11 | "html", 12 | "xml", 13 | "vue", 14 | "svelte", 15 | "php" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tests/react/eslint.config.js: -------------------------------------------------------------------------------- 1 | import react from '@bfehub/eslint-config-react' 2 | 3 | /** @type {import('eslint').Linter.Config[]} */ 4 | export default react 5 | -------------------------------------------------------------------------------- /tests/react/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-demo", 3 | "type": "module", 4 | "version": "1.0.0", 5 | "private": true, 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "react": "^18.3.1", 13 | "react-dom": "^18.3.1" 14 | }, 15 | "devDependencies": { 16 | "@bfehub/eslint-config-react": "workspace:*", 17 | "@bfehub/stylelint-config-basic": "workspace:*", 18 | "@types/react": "^18.3.5", 19 | "@types/react-dom": "^18.3.0", 20 | "@vitejs/plugin-react": "^4.3.1", 21 | "eslint": "^9.10.0", 22 | "postcss": "^8.4.45", 23 | "prettier": "^3.3.3", 24 | "stylelint": "^16.9.0", 25 | "typescript": "^5.6.2", 26 | "vite": "^5.4.5" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/react/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: app-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | display: flex; 18 | flex-direction: column; 19 | align-items: center; 20 | justify-content: center; 21 | min-height: 100vh; 22 | font-size: calc(10px + 2vmin); 23 | color: white; 24 | background-color: #282c34; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes app-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | 36 | to { 37 | transform: rotate(360deg); 38 | } 39 | } 40 | 41 | button { 42 | font-size: calc(10px + 2vmin); 43 | } 44 | -------------------------------------------------------------------------------- /tests/react/src/App.tsx: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | import logo from './logo.svg' 3 | import './App.css' 4 | 5 | function App() { 6 | const [count, setCount] = useState(0) 7 | 8 | // ❌ 9 | // if (count) { 10 | // const [count, setCount] = useState(0) 11 | // } 12 | 13 | return ( 14 |
15 | {/* ❌ */} 16 | {/* {[1, 2].map(() => ( 17 |
  • 18 | ))} */} 19 | 20 |
    21 | logo 22 |

    Hello Vite + React!

    23 |

    24 | 27 |

    28 | 29 |

    30 | Edit App.tsx and save to test HMR updates. 31 |

    32 |

    33 | 34 | Learn React 35 | 36 | {' | '} 37 | 43 | Vite Docs 44 | 45 |

    46 |
    47 |
    48 | ) 49 | } 50 | 51 | export default App 52 | -------------------------------------------------------------------------------- /tests/react/src/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/react/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 4 | 'Droid Sans', 'Helvetica Neue', sans-serif; 5 | -webkit-font-smoothing: antialiased; 6 | -moz-osx-font-smoothing: grayscale; 7 | } 8 | 9 | code { 10 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; 11 | } 12 | -------------------------------------------------------------------------------- /tests/react/src/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/react/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import './index.css' 4 | import App from './App' 5 | 6 | const root = document.getElementById('root')! 7 | ReactDOM.createRoot(root).render( 8 | 9 | 10 | 11 | ) 12 | -------------------------------------------------------------------------------- /tests/react/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /tests/react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "useDefineForClassFields": true, 5 | "lib": ["DOM", "DOM.Iterable", "ESNext"], 6 | "allowJs": false, 7 | "skipLibCheck": false, 8 | "esModuleInterop": false, 9 | "allowSyntheticDefaultImports": true, 10 | "strict": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "module": "ESNext", 13 | "moduleResolution": "Node", 14 | "resolveJsonModule": true, 15 | "isolatedModules": true, 16 | "noEmit": true, 17 | "jsx": "react-jsx" 18 | }, 19 | "include": ["./src"] 20 | } 21 | -------------------------------------------------------------------------------- /tests/react/vite.config.ts: -------------------------------------------------------------------------------- 1 | import react from '@vitejs/plugin-react' 2 | import { defineConfig } from 'vite' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /tests/vue/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /tests/vue/.prettierrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('prettier').Options} */ 2 | export default { 3 | semi: false, 4 | trailingComma: 'es5', 5 | singleQuote: true, 6 | printWidth: 120, 7 | } 8 | -------------------------------------------------------------------------------- /tests/vue/.stylelintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import('stylelint').Config} */ 2 | export default { 3 | extends: '@bfehub/stylelint-config-basic', 4 | } 5 | -------------------------------------------------------------------------------- /tests/vue/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["johnsoncodehk.volar"] 3 | } 4 | -------------------------------------------------------------------------------- /tests/vue/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.codeActionsOnSave": { 3 | "source.fixAll.eslint": "explicit", 4 | "source.fixAll.stylelint": "explicit" 5 | }, 6 | "stylelint.validate": [ 7 | "css", 8 | "less", 9 | "postcss", 10 | "scss", 11 | "html", 12 | "xml", 13 | "vue", 14 | "svelte", 15 | "php" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tests/vue/README.md: -------------------------------------------------------------------------------- 1 | # Vue 3 + Typescript + Vite 2 | 3 | This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 ` 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-demo", 3 | "type": "module", 4 | "version": "1.0.0", 5 | "private": true, 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vue-tsc --noEmit && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "vue": "^3.5.5" 13 | }, 14 | "devDependencies": { 15 | "@bfehub/eslint-config-vue": "workspace:*", 16 | "@bfehub/stylelint-config-basic": "workspace:*", 17 | "@vitejs/plugin-vue": "^5.1.3", 18 | "eslint": "^9.10.0", 19 | "postcss": "^8.4.45", 20 | "prettier": "^3.3.3", 21 | "stylelint": "^16.9.0", 22 | "typescript": "^5.6.2", 23 | "vite": "^5.4.5", 24 | "vue-tsc": "^2.1.6" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bfehub/lint/52517b1198a88ee507337214e9ddeec09f16353b/tests/vue/public/favicon.ico -------------------------------------------------------------------------------- /tests/vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | 22 | 32 | -------------------------------------------------------------------------------- /tests/vue/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bfehub/lint/52517b1198a88ee507337214e9ddeec09f16353b/tests/vue/src/assets/logo.png -------------------------------------------------------------------------------- /tests/vue/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 33 | 34 | 63 | -------------------------------------------------------------------------------- /tests/vue/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-empty-object-type 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /tests/vue/src/main.css: -------------------------------------------------------------------------------- 1 | /* ❌ */ 2 | 3 | /* .demo { 4 | width: 0px; 5 | } */ 6 | 7 | /* ✅ */ 8 | 9 | .demo { 10 | width: 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/vue/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | 4 | // ❌ 5 | // const app = createApp(App).mount("#app") 6 | 7 | // ✅ 8 | createApp(App).mount('#app') 9 | -------------------------------------------------------------------------------- /tests/vue/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "esModuleInterop": true, 12 | "lib": ["esnext", "dom"] 13 | }, 14 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] 15 | } 16 | -------------------------------------------------------------------------------- /tests/vue/vite.config.ts: -------------------------------------------------------------------------------- 1 | import vue from '@vitejs/plugin-vue' 2 | import { defineConfig } from 'vite' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [vue()], 7 | }) 8 | --------------------------------------------------------------------------------