mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-08 21:06:42 +10:00
build: refine eslint and set up commitlint
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const VuepressPackages = fs.readdirSync(path.resolve(__dirname, 'packages/@vuepress'))
|
||||
|
||||
module.exports = {
|
||||
extends: [
|
||||
'@commitlint/config-conventional'
|
||||
],
|
||||
rules: {
|
||||
'scope-enum': [
|
||||
'cli',
|
||||
...VuepressPackages
|
||||
].map(name => `$${name}`)
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,6 @@
|
||||
**/node_modules
|
||||
!.eslintrc.js
|
||||
!.commitlintrc.js
|
||||
!.vuepress
|
||||
packages/@vuepress/shared-utils/lib
|
||||
packages/@vuepress/shared-utils/types
|
||||
|
||||
+20
-5
@@ -1,12 +1,27 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
'plugin:vue-libs/recommended',
|
||||
'plugin:jest/recommended'
|
||||
'plugin:vue-libs/recommended'
|
||||
],
|
||||
rules: {
|
||||
indent: ['error', 2, { MemberExpression: 'off' }],
|
||||
"no-undef": ["error"],
|
||||
'operator-linebreak': ["error", "before"]
|
||||
}
|
||||
'no-undef': ['error'],
|
||||
'operator-linebreak': ['error', 'before']
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/__tests__/**/*.spec.js'],
|
||||
extends: ['plugin:jest/recommended']
|
||||
},
|
||||
{
|
||||
files: ['*.ts'],
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended'
|
||||
],
|
||||
parser: 'vue-eslint-parser',
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"*.{js,vue}": ["eslint --fix", "git add"]
|
||||
}
|
||||
+39
-24
@@ -1,36 +1,53 @@
|
||||
{
|
||||
"private": true,
|
||||
"description": "Minimalistic doc generator with Vue component based layout system",
|
||||
"workspaces": [
|
||||
"packages/@vuepress/*",
|
||||
"packages/vuepress",
|
||||
"packages/docs"
|
||||
],
|
||||
"description": "Minimalistic doc generator with Vue component based layout system",
|
||||
"scripts": {
|
||||
"bootstrap": "yarn && yarn tsc",
|
||||
"lerna:bootstrap": "lerna bootstrap",
|
||||
"clean": "lerna clean && rm -rf node_modules",
|
||||
"packages:list": "lerna ls -l",
|
||||
"packages:diff": "lerna diff",
|
||||
"packages:changed": "lerna changed",
|
||||
"boot": "node scripts/bootstrap.js",
|
||||
"remote-version": "node scripts/remote-version.js",
|
||||
"dev": "yarn tsc && yarn dev:docs",
|
||||
"dev:docs": "yarn workspace docs dev",
|
||||
"bootstrap": "yarn && yarn tsc",
|
||||
"build": "yarn tsc && yarn build:docs",
|
||||
"build:docs": "yarn workspace docs build",
|
||||
"view-info": "yarn tsc && yarn workspace docs view-info",
|
||||
"show-help": "yarn workspace docs show-help",
|
||||
"register-vuepress": "lerna exec --scope vuepress -- yarn link",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2",
|
||||
"clean": "lerna clean && rm -rf node_modules",
|
||||
"dev": "yarn tsc && yarn dev:docs",
|
||||
"dev:docs": "yarn workspace docs dev",
|
||||
"lerna:bootstrap": "lerna bootstrap",
|
||||
"lint": "yarn lint:check --fix",
|
||||
"lint:check": "eslint packages --ext .js,.vue",
|
||||
"packages:changed": "lerna changed",
|
||||
"packages:diff": "lerna diff",
|
||||
"packages:list": "lerna ls -l",
|
||||
"register-vuepress": "lerna exec --scope vuepress -- yarn link",
|
||||
"release": "yarn --pure-lockfile && yarn tsc && node scripts/release.js",
|
||||
"unregister-vuepress": "lerna exec --scope vuepress -- yarn unlink",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2",
|
||||
"remote-version": "node scripts/remote-version.js",
|
||||
"show-help": "yarn workspace docs show-help",
|
||||
"test": "node scripts/test.js",
|
||||
"tsc": "yarn workspace @vuepress/shared-utils tsc"
|
||||
"tsc": "yarn workspace @vuepress/shared-utils tsc",
|
||||
"unregister-vuepress": "lerna exec --scope vuepress -- yarn unlink",
|
||||
"view-info": "yarn tsc && yarn workspace docs view-info"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,vue}": [
|
||||
"eslint --fix",
|
||||
"git add"
|
||||
],
|
||||
"package.json": [
|
||||
"sort-package-json",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^8.2.0",
|
||||
"@commitlint/config-conventional": "^8.2.0",
|
||||
"@types/escape-html": "^0.0.20",
|
||||
"@types/fs-extra": "^5.0.4",
|
||||
"@types/globby": "^9.1.0",
|
||||
@@ -38,21 +55,19 @@
|
||||
"@types/lru-cache": "^5.1.0",
|
||||
"@types/node": "^12.7.5",
|
||||
"@types/semver": "^6.0.0",
|
||||
"conventional-changelog-cli": "^2.0.23",
|
||||
"@typescript-eslint/eslint-plugin": "^2.9.0",
|
||||
"@typescript-eslint/parser": "^2.9.0",
|
||||
"all-contributors-cli": "^6.9.1",
|
||||
"eslint": "5.11.1",
|
||||
"eslint-plugin-jest": "^22.17.0",
|
||||
"conventional-changelog-cli": "^2.0.23",
|
||||
"eslint": "^6.7.1",
|
||||
"eslint-plugin-jest": "^23.0.5",
|
||||
"eslint-plugin-vue-libs": "^4.0.0",
|
||||
"husky": "^3.0.5",
|
||||
"inquirer": "^7.0.0",
|
||||
"lerna": "3.16.4",
|
||||
"lint-staged": "^9.3.0",
|
||||
"minimist": "^1.2.0",
|
||||
"sort-package-json": "^1.24.0",
|
||||
"typescript": "^3.6.3"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"docs/**/*.md": ["yarn lint-md", "git add"]
|
||||
}
|
||||
+19
-21
@@ -1,33 +1,32 @@
|
||||
{
|
||||
"private": true,
|
||||
"version": "1.2.0",
|
||||
"name": "docs",
|
||||
"version": "1.2.0",
|
||||
"private": true,
|
||||
"description": "docs of VuePress",
|
||||
"scripts": {
|
||||
"precommit": "lint-staged",
|
||||
"dev": "vuepress dev docs --temp .temp",
|
||||
"build": "vuepress build docs --temp .temp",
|
||||
"view-info": "vuepress view-info docs --temp .temp",
|
||||
"show-help": "vuepress --help",
|
||||
"lint-md:wording": "textlint ./docs/**/*.md",
|
||||
"lint-md:style": "remark --quiet --frail .",
|
||||
"lint-md": "yarn lint-md:style && yarn lint-md:wording"
|
||||
"keywords": [
|
||||
"documentation",
|
||||
"generator",
|
||||
"vue"
|
||||
],
|
||||
"homepage": "https://github.com/vuejs/vuepress#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vuepress/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vuepress.git"
|
||||
},
|
||||
"keywords": [
|
||||
"documentation",
|
||||
"vue",
|
||||
"generator"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vuepress/issues"
|
||||
"author": "Evan You",
|
||||
"scripts": {
|
||||
"build": "vuepress build docs --temp .temp",
|
||||
"dev": "vuepress dev docs --temp .temp",
|
||||
"lint-md": "yarn lint-md:style && yarn lint-md:wording",
|
||||
"lint-md:style": "remark --quiet --frail .",
|
||||
"lint-md:wording": "textlint ./docs/**/*.md",
|
||||
"show-help": "vuepress --help",
|
||||
"view-info": "vuepress view-info docs --temp .temp"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vuepress#readme",
|
||||
"devDependencies": {
|
||||
"@textlint-rule/textlint-rule-no-unmatched-pair": "^1.0.7",
|
||||
"@vuepress/plugin-back-to-top": "^1.2.0",
|
||||
@@ -35,7 +34,6 @@
|
||||
"@vuepress/plugin-medium-zoom": "^1.2.0",
|
||||
"@vuepress/plugin-pwa": "^1.2.0",
|
||||
"@vuepress/theme-vue": "^1.2.0",
|
||||
"lint-staged": "^8.1.5",
|
||||
"remark-cli": "^7.0.0",
|
||||
"remark-lint": "^6.0.5",
|
||||
"remark-preset-lint-consistent": "^2.0.3",
|
||||
|
||||
Reference in New Issue
Block a user