chore: add stylelint support

This commit is contained in:
pengzhanbo 2024-01-07 01:53:19 +08:00
parent 30ac4e3ac9
commit 5a96bacdec
10 changed files with 637 additions and 1155 deletions

7
.stylelintignore Normal file
View File

@ -0,0 +1,7 @@
node_modules
.cache
.temp
lib
dist

View File

@ -10,8 +10,10 @@
}, },
"css.validate": false, "css.validate": false,
"scss.validate": false, "scss.validate": false,
"less.validate": false,
"typescript.tsdk": "node_modules/typescript/lib", "typescript.tsdk": "node_modules/typescript/lib",
"eslint.experimental.useFlatConfig": true, "eslint.experimental.useFlatConfig": true,
"stylelint.packageManager": "pnpm",
"eslint.rules.customizations": [ "eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" }, { "rule": "style/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" }, { "rule": "*-indent", "severity": "off" },
@ -27,6 +29,7 @@
"source.fixAll": "explicit", "source.fixAll": "explicit",
"source.fixAll.eslint": "explicit", "source.fixAll.eslint": "explicit",
"source.organizeImports": "never" "source.organizeImports": "never"
// "source.fixAll.stylelint": "explicit"
}, },
"editor.formatOnPaste": true, "editor.formatOnPaste": true,
"eslint.validate": [ "eslint.validate": [
@ -41,6 +44,12 @@
"jsonc", "jsonc",
"yaml" "yaml"
], ],
"stylelint.validate": [
"css",
"scss",
"postcss",
"vue"
],
"cSpell.words": [ "cSpell.words": [
"bumpp", "bumpp",
"caniuse", "caniuse",

View File

@ -30,6 +30,6 @@ export const theme = themePlume({
// apiKey: '111', // apiKey: '111',
// appId: '111', // appId: '111',
// indexName: '1234', // indexName: '1234',
// }, // }
}, },
}) })

View File

@ -86,9 +86,8 @@ H~2~O
[外部链接](https://github.com/pengzhanbo) [外部链接](https://github.com/pengzhanbo)
![image](/images/1px-lines.png) ![](/images/1px-lines.png)
![image](/images/1px-lines.png)
**Badge** **Badge**
@ -220,6 +219,25 @@ const c = a + b
``` ```
::: :::
**GFM alert**
> [!note]
> note
> [!info]
> info
> [!tip]
> tip
> [!warning]
> warning
> [!caution]
> caution
> [!important]
> important
**代码演示** **代码演示**
@ -243,3 +261,39 @@ span {
``` ```
::: :::
**选项卡**
::: tabs
@tab 标题1
内容区块
@tab 标题2
内容区块
:::
:::: warning
::: tabs
@tab 标题1
内容区块
@tab 标题2
内容区块
:::
::::
**脚注**
脚注 1 链接[^first]。
脚注 2 链接[^second]。
行内的脚注^[行内脚注文本] 定义。
重复的页脚定义[^second]。
[^first]: 脚注 **可以包含特殊标记**
也可以由多个段落组成
[^second]: 脚注文字。

View File

@ -1,9 +1,6 @@
import config from '@pengzhanbo/eslint-config-vue' import config from '@pengzhanbo/eslint-config-vue'
export default config({ export default config({
formatters: {
css: true,
},
ignores: ['lib', 'docs/**/*.md'], ignores: ['lib', 'docs/**/*.md'],
globals: { globals: {
__VUEPRESS_VERSION__: 'readonly', __VUEPRESS_VERSION__: 'readonly',

View File

@ -4,7 +4,7 @@
"version": "1.0.0-rc.15", "version": "1.0.0-rc.15",
"private": true, "private": true,
"packageManager": "pnpm@8.14.0", "packageManager": "pnpm@8.14.0",
"author": "pengzhanbo", "author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [
"vuepress", "vuepress",
@ -20,7 +20,6 @@
"scripts": { "scripts": {
"build": "pnpm run build:package", "build": "pnpm run build:package",
"build:package": "pnpm --filter=!vuepress-theme-plume-monorepo --filter=!docs --filter=!plugin-page-collection run -r --stream build", "build:package": "pnpm --filter=!vuepress-theme-plume-monorepo --filter=!docs --filter=!plugin-page-collection run -r --stream build",
"commit": "cz",
"dev": "concurrently \"pnpm run dev:package\" \"pnpm run docs\"", "dev": "concurrently \"pnpm run dev:package\" \"pnpm run docs\"",
"dev:package": "pnpm --filter=!vuepress-theme-plume-monorepo --filter=!docs --parallel dev", "dev:package": "pnpm --filter=!vuepress-theme-plume-monorepo --filter=!docs --parallel dev",
"dev:theme": "concurrently \"pnpm --filter=vuepress-theme-plume dev\" \"pnpm run docs\"", "dev:theme": "concurrently \"pnpm --filter=vuepress-theme-plume dev\" \"pnpm run docs\"",
@ -28,12 +27,13 @@
"docs:build": "pnpm --filter=docs docs:build", "docs:build": "pnpm --filter=docs docs:build",
"docs:clean": "pnpm --filter=docs docs:clean", "docs:clean": "pnpm --filter=docs docs:clean",
"docs:serve": "pnpm --filter=docs docs:serve", "docs:serve": "pnpm --filter=docs docs:serve",
"commit": "cz",
"lint": "eslint .", "lint": "eslint .",
"pkg": "node scripts/create/index.js", "lint:css": "stylelint **/*.{css,scss,vue}",
"prepare": "husky install", "prepare": "husky install",
"release": "pnpm release:check && pnpm release:version && pnpm release:publish", "release": "pnpm release:check && pnpm release:version && pnpm release:publish",
"release:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", "release:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"release:check": "pnpm lint && pnpm build", "release:check": "pnpm lint && pnpm lint:css && pnpm build",
"release:publish": "pnpm -r publish", "release:publish": "pnpm -r publish",
"release:version": "bumpp package.json plugins/*/package.json theme/package.json --execute=\"pnpm release:changelog\" --commit \"build: publish v%s\" --all --tag --push" "release:version": "bumpp package.json plugins/*/package.json theme/package.json --execute=\"pnpm release:changelog\" --commit \"build: publish v%s\" --all --tag --push"
}, },
@ -41,50 +41,25 @@
"@commitlint/cli": "^18.4.4", "@commitlint/cli": "^18.4.4",
"@commitlint/config-conventional": "^18.4.4", "@commitlint/config-conventional": "^18.4.4",
"@pengzhanbo/eslint-config-vue": "^1.5.1", "@pengzhanbo/eslint-config-vue": "^1.5.1",
"@types/minimist": "^1.2.5", "@pengzhanbo/stylelint-config": "^1.5.1",
"@types/lodash.merge": "^4.6.9",
"@types/node": "20.9.1", "@types/node": "20.9.1",
"@types/webpack-env": "^1.18.4", "@types/webpack-env": "^1.18.4",
"bumpp": "^9.2.1", "bumpp": "^9.2.1",
"chalk": "^5.3.0",
"commitizen": "^4.3.0", "commitizen": "^4.3.0",
"concurrently": "^8.2.2", "concurrently": "^8.2.2",
"conventional-changelog-cli": "^4.1.0", "conventional-changelog-cli": "^4.1.0",
"cpx2": "^7.0.1", "cpx2": "^7.0.1",
"cross-env": "^7.0.3",
"cz-conventional-changelog": "^3.3.0", "cz-conventional-changelog": "^3.3.0",
"eslint": "^8.56.0", "eslint": "^8.56.0",
"eslint-plugin-format": "^0.1.0",
"execa": "^8.0.1",
"handlebars": "^4.7.8",
"husky": "^8.0.3", "husky": "^8.0.3",
"lint-staged": "^15.2.0", "lint-staged": "^15.2.0",
"minimist": "^1.2.8",
"ora": "^8.0.1",
"pnpm": "^8.14.0",
"rimraf": "^5.0.5", "rimraf": "^5.0.5",
"sort-package-json": "^2.6.0", "stylelint": "^16.1.0",
"taze": "^0.13.1",
"tsconfig-vuepress": "^4.5.0", "tsconfig-vuepress": "^4.5.0",
"typescript": "^5.3.3", "typescript": "^5.3.3",
"vite": "^5.0.11" "vite": "^5.0.11"
}, },
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"@algolia/client-search",
"@types/react",
"eslint-plugin-import",
"eslint-plugin-n",
"eslint-plugin-promise",
"react",
"react-dom",
"webpack",
"cypress",
"postcss",
"jest"
]
}
},
"lint-staged": { "lint-staged": {
"*": "eslint --fix" "*": "eslint --fix"
}, },

1651
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

19
stylelint.config.js Normal file
View File

@ -0,0 +1,19 @@
import { stylelintConfig } from '@pengzhanbo/stylelint-config'
export default stylelintConfig({
rules: {
'selector-pseudo-element-no-unknown': [true, {
ignorePseudoElements: ['input-placeholder'],
}],
'no-descending-specificity': null,
'custom-property-empty-line-before': null,
'property-no-vendor-prefix': null,
'selector-no-vendor-prefix': null,
'property-no-unknown': [true, {
ignoreProperties: ['r', 'font-named-instance'],
}],
'declaration-block-no-redundant-longhand-properties': [true, {
ignoreShorthands: ['inset'],
}],
},
})

View File

@ -89,8 +89,5 @@
"vuepress-plugin-reading-time2": "2.0.0-rc.10", "vuepress-plugin-reading-time2": "2.0.0-rc.10",
"vuepress-plugin-seo2": "2.0.0-rc.10", "vuepress-plugin-seo2": "2.0.0-rc.10",
"vuepress-plugin-sitemap2": "2.0.0-rc.10" "vuepress-plugin-sitemap2": "2.0.0-rc.10"
},
"devDependencies": {
"@types/lodash.merge": "^4.6.9"
} }
} }

View File

@ -14,6 +14,7 @@
"@internal/*": ["./docs/.vuepress/.temp/internal/*"], "@internal/*": ["./docs/.vuepress/.temp/internal/*"],
"@vuepress-plume/*": ["./plugins/*/src/node/index.ts"], "@vuepress-plume/*": ["./plugins/*/src/node/index.ts"],
"vuepress-theme-plume": ["./theme/src/node/index.ts"], "vuepress-theme-plume": ["./theme/src/node/index.ts"],
"@vuepress-plume/*/client": ["./plugins/*/src/client/index.ts"],
"vuepress-plugin-netlify-functions": [ "vuepress-plugin-netlify-functions": [
"./plugins/plugin-netlify-functions/src/node/index.ts" "./plugins/plugin-netlify-functions/src/node/index.ts"
] ]