chore(@vant/cli): no longer provide stylelint (#10844)
This commit is contained in:
@@ -10,7 +10,7 @@ Vant CLI is a tool for building vue component library. You can quickly build a f
|
||||
|
||||
- Provides rich commands covering the complete process from development to deploy
|
||||
- Based on conventional directory structure. Generate elegant document website and component examples automatically.
|
||||
- ESlint Stylelint built-in.
|
||||
- ESlint built-in.
|
||||
- Support Tree Shaking/Theme Customization/Import on Demand
|
||||
|
||||
### Quickstart
|
||||
@@ -50,16 +50,12 @@ Please add the followed config to `package.json` file.
|
||||
"nano-staged": {
|
||||
"*.md": "prettier --write",
|
||||
"*.{ts,tsx,js,vue,less,scss}": "prettier --write",
|
||||
"*.{ts,tsx,js,vue}": "eslint --fix",
|
||||
"*.{vue,css,less,scss}": "stylelint --fix"
|
||||
"*.{ts,tsx,js,vue}": "eslint --fix"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": ["@vant"]
|
||||
},
|
||||
"stylelint": {
|
||||
"extends": ["@vant/stylelint-config"]
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@ Vant CLI 是一个 Vue 组件库构建工具,通过 Vant CLI 可以快速搭
|
||||
|
||||
- 提供丰富的命令,涵盖从开发测试到构建发布的完整流程
|
||||
- 基于约定的目录结构,自动生成优雅的文档站点和组件示例
|
||||
- 内置 ESLint、Stylelint 校验规则,提交代码时自动执行校验
|
||||
- 内置 ESLint 校验规则,提交代码时自动执行校验
|
||||
- 构建后的组件库默认支持按需引入、主题定制、Tree Shaking
|
||||
|
||||
### 快速上手
|
||||
@@ -46,16 +46,12 @@ pnpm add @vant/cli -D
|
||||
"nano-staged": {
|
||||
"*.md": "prettier --write",
|
||||
"*.{ts,tsx,js,vue,less,scss}": "prettier --write",
|
||||
"*.{ts,tsx,js,vue}": "eslint --fix",
|
||||
"*.{vue,css,less,scss}": "stylelint --fix"
|
||||
"*.{ts,tsx,js,vue}": "eslint --fix"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": ["@vant"]
|
||||
},
|
||||
"stylelint": {
|
||||
"extends": ["@vant/stylelint-config"]
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true
|
||||
},
|
||||
|
||||
@@ -19,6 +19,12 @@
|
||||
+ "release:site": "pnpm build:site && npx gh-pages -d site-dist",
|
||||
```
|
||||
|
||||
- 不再默认内置 `stylelint`,需要的话可以自行安装:
|
||||
|
||||
```bash
|
||||
yarn add stylelint@13 @vant/stylelint-config
|
||||
```
|
||||
|
||||
## v4.0.3
|
||||
|
||||
`2022-07-02`
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
"@types/jest": "^27.0.3",
|
||||
"@vant/eslint-config": "^3.3.2",
|
||||
"@vant/markdown-vetur": "^2.3.0",
|
||||
"@vant/stylelint-config": "^1.4.2",
|
||||
"@vant/touch-emulator": "^1.3.2",
|
||||
"@vitejs/plugin-vue": "^3.0.1",
|
||||
"@vitejs/plugin-vue-jsx": "^2.0.0",
|
||||
@@ -85,7 +84,6 @@
|
||||
"postcss-load-config": "^3.1.0",
|
||||
"prettier": "^2.5.0",
|
||||
"release-it": "^15.1.1",
|
||||
"stylelint": "^13.0.0",
|
||||
"transliteration": "^2.2.0",
|
||||
"typescript": "^4.7.4",
|
||||
"vite": "^3.0.0",
|
||||
|
||||
@@ -16,7 +16,7 @@ program
|
||||
|
||||
program
|
||||
.command('lint')
|
||||
.description('Run eslint and stylelint')
|
||||
.description('Run ESLint')
|
||||
.action(async () => {
|
||||
const { lint } = await import('./commands/lint.js');
|
||||
return lint();
|
||||
|
||||
@@ -44,23 +44,10 @@ function eslint() {
|
||||
);
|
||||
}
|
||||
|
||||
function stylelint() {
|
||||
return runCommand(
|
||||
'stylelint',
|
||||
['src/**/*.css', 'src/**/*.vue', 'src/**/*.less', 'src/**/*.sass', '--fix'],
|
||||
{
|
||||
start: 'Running stylelint...',
|
||||
succeed: 'Stylelint Passed.',
|
||||
failed: 'Stylelint failed!',
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export async function lint() {
|
||||
const eslintPassed = await eslint();
|
||||
const stylelintPassed = await stylelint();
|
||||
|
||||
if (!eslintPassed || !stylelintPassed) {
|
||||
if (!eslintPassed) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user