uni-app 配置 eslint + prettier + stylelint + lint-staged + husky 代碼格式校驗

0x1 問題

更新時間:2021-01-13 19:10:25

  • 2021-01-13 19:10:25

    • stylelint --fix --allow-empty-input 增加 --allow-empty-input 參數防止意外提交卡頓坎背。
  • 2020-11-13 14:30:02

  • 增加 stylelint css 代碼校驗医寿,增加 package.json 校驗命令

    • 改變配置文件名符合共識
    • lint-staged 拆分楞抡,更加可讀
    • uni-app 開發(fā)項目最好用 npm 裝包灸拍!
  • 2020-09-22 13:10:40

    • 增加 commit 之前用 prettier 按照配置格式化一遍呢诬。防止 ?? 一樣的代碼蚕泽。
  • 2020-09-10 18:27:21

    • 增加 eslintprettier 配置(對 vscode 用戶友好)
  • 2020-08-28 21:41:15

    • 去除 package.jsonlint-stagedgit add 任務惋啃。
    • 增加 .eslintignore 配置

公司需要用到 uni-app 開發(fā)新的項目歹苦,關于 uni-app 的介紹可以移步官網介紹。

核心就是用 Vue 寫多端應用程序谆棺,但是 uni-app 的官方編輯器 HbuilderX 對代碼校驗這一塊基本是空白栽燕。自己對Hbuilderx 配置也是有點模糊。

Vue-cli 創(chuàng)建的項目默認啟用了保存代碼檢查改淑,但是 uni-app 開發(fā)方式有點區(qū)別碍岔。編譯和打包集成到了工具內部。所以我們只能在提交代碼之前來做代碼校驗了朵夏。

關于為什么要做代碼校驗蔼啦,一個人開發(fā)還好。要是團隊合作仰猖,沒有統一的規(guī)則捏肢。你是天津狗不理,我是長沙臭豆腐饥侵。那個工程寫出來鸵赫,基本沒有維護性可言。要自己去維護別人寫的代碼就是一個態(tài)度躏升,他寫的代碼像 ?? 一樣辩棒,看不懂,只能重構膨疏。大多數人都是這個樣子一睁,沒有例外。作為一個程序員佃却,是要想想為什么那些大佬的代碼一看就能懂者吁,寫代碼就像寫詩,在看看自己寫的饲帅,過幾天出了問題复凳,等到親切問候了全家之后再來看是自己寫的瘤泪。。染坯。??

由此可見規(guī)范是很重要的均芽。

0202 年了, ECMAScript 都已經 2020 版本了单鹿,別再用 var 定義變量掀宋、用 ==if 做判斷了。

0x2 規(guī)范提交代碼

可以參考約定式提交

一種用于給提交信息增加人機可讀含義的規(guī)范仲锄。

簡單來說就是提交代碼的規(guī)范劲妙。

已經詳細記錄到個人的文檔網站,這里不做詳細介紹 地址

0x3 安裝需要用到的依賴

npm i eslint babel-eslint eslint-plugin-vue husky lint-staged prettier @vue/eslint-config-prettier eslint-plugin-prettier -D
  • eslint - 校驗代碼的核心
  • babel-eslint - babel 插件儒喊,用 babel 解析 js 文件
  • eslint-plugin-vue - vue 官方的 eslint 插件
  • husky - 可以讓 git hooks 的使用變得更簡單方便
  • lint-staged - 可以在 git staged 階段的文件上執(zhí)行 linters镣奋,簡單點來說就是當我們運行 eslintstylelint 的命令時,只會檢查我們通過 git add 添加到暫存區(qū)的文件怀愧,可以避免我們每次檢查都把整個項目的代碼都檢查一遍

stylelint 需要用到的依賴

npm i stylelint stylelint-config-prettier stylelint-config-standard stylelint-order -D

0x4 配置

以下設置適用于 cli 創(chuàng)建的項目侨颈,HbuilderX 創(chuàng)建的項目,路徑需要修改芯义。例如 ./src/ 改成 ./ 這樣哈垢。

prettier

${app}/prettier.config.js

module.exports = {
  // 行寬 default:80
  printWidth: 100,
  // tab 寬度 default:2
  tabWidth: 2,
  // 使用 tab 鍵 default:false
  useTabs: false,
  // 語句行末是否添加分號 default:true
  semi: false,
  // 是否使用單引號 default:false
  singleQuote: true,
  // 對象需要引號在加 default:"as-needed"
  quoteProps: 'as-needed',
  // jsx單引號 default:false
  jsxSingleQuote: true,
  // 最后一個對象元素加逗號 default:"es5"
  trailingComma: 'es5',
  // 在對象字面量聲明所使用的的花括號后({)和前(})輸出空格 default:true
  bracketSpacing: true,
  // 將 > 多行 JSX 元素放在最后一行的末尾,而不是單獨放在下一行(不適用于自閉元素)扛拨。default:false
  jsxBracketSameLine: false,
  // (x) => {} 是否要有小括號 default:"always"
  arrowParens: 'always',
  // default:0
  rangeStart: 0,
  // default:Infinity
  rangeEnd: Infinity,
  // default:false
  insertPragma: false,
  // default:false
  requirePragma: false,
  // 不包裝 markdown text default:"preserve"
  proseWrap: 'never',
  // HTML空白敏感性 default:"css"
  htmlWhitespaceSensitivity: 'strict',
  // 在 *.vue 文件中 Script 和 Style 標簽內的代碼是否縮進 default:false
  vueIndentScriptAndStyle: true,
  // 末尾換行符 default:"lf"
  endOfLine: 'auto',
  // default:"auto"
  embeddedLanguageFormatting: 'auto',
  overrides: [
    {
      files: '*.md',
      options: {
        tabWidth: 2,
      },
    },
  ],
}

.prettierignore

# 忽略打包的文件
src/unpackage
# 忽略uni-app官方的組件庫錯誤和警告耘分,官方的竟然通不過...
src/components/uni-**

eslint

eslint 的配置復制于 PanJiaChen 大佬的項目,vue-admin-template绑警,關閉了一些實在是太變態(tài)的警告求泰。。计盒。(大部分是格式問題)

${app}/.eslintrc.js

module.exports = {
  root: true,
  env: {
    browser: true,
    node: true,
  },
  // 配置js全局變量渴频,因為是uni-app,全局的uni是不需要引入的北启,還有5+的plus對象
  globals: {
    uni: 'readonly',
    plus: 'readonly',
    wx: 'readonly',
  },
  extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/prettier'],
  parserOptions: {
    parser: 'babel-eslint',
  },
  rules: {
    'no-console': [
      'warn',
      {
        allow: ['warn', 'error'],
      },
    ],
    'no-eval': 'error',
    'no-alert': 'error',
    'vue/max-attributes-per-line': [
      0,
      {
        singleline: 10,
        multiline: {
          max: 1,
          allowFirstLine: false,
        },
      },
    ],
    'vue/singleline-html-element-content-newline': 'off',
    'vue/multiline-html-element-content-newline': 'off',
    'vue/name-property-casing': ['error', 'PascalCase'],
    'vue/no-v-html': 'off',
    'accessor-pairs': 2,

    'block-spacing': [2, 'always'],
    'brace-style': [
      2,
      '1tbs',
      {
        allowSingleLine: true,
      },
    ],
    camelcase: [
      0,
      {
        properties: 'always',
      },
    ],
    'comma-dangle': [2, 'only-multiline'],
    'comma-style': [2, 'last'],
    'constructor-super': 2,
    curly: [2, 'multi-line'],
    'dot-location': [2, 'property'],
    'eol-last': 2,
    eqeqeq: [
      'warn',
      'always',
      {
        null: 'ignore',
      },
    ],
    'generator-star-spacing': [
      2,
      {
        before: true,
        after: true,
      },
    ],
    'handle-callback-err': [2, '^(err|error)$'],
    'jsx-quotes': [2, 'prefer-single'],
    'new-cap': [
      2,
      {
        newIsCap: true,
        capIsNew: false,
      },
    ],
    'new-parens': 2,
    'no-array-constructor': 2,
    'no-caller': 2,
    'no-class-assign': 2,
    'no-cond-assign': 2,
    'no-const-assign': 2,
    'no-control-regex': 0,
    'no-delete-var': 2,
    'no-dupe-args': 2,
    'no-dupe-class-members': 2,
    'no-dupe-keys': 2,
    'no-duplicate-case': 2,
    'no-empty-character-class': 2,
    'no-empty-pattern': 2,
    'no-ex-assign': 2,
    'no-extend-native': 2,
    'no-extra-bind': 2,
    'no-extra-boolean-cast': 2,
    'no-extra-parens': [2, 'functions'],
    'no-fallthrough': 2,
    'no-floating-decimal': 2,
    'no-func-assign': 2,
    'no-implied-eval': 2,
    'no-inner-declarations': [2, 'functions'],
    'no-invalid-regexp': 2,
    'no-irregular-whitespace': 2,
    'no-iterator': 2,
    'no-label-var': 2,
    'no-labels': [
      2,
      {
        allowLoop: false,
        allowSwitch: false,
      },
    ],
    'no-lone-blocks': 2,
    'no-mixed-spaces-and-tabs': 1,
    'no-multi-spaces': 2,
    'no-multi-str': 2,

    'no-native-reassign': 2,
    'no-negated-in-lhs': 2,
    'no-new-object': 2,
    'no-new-require': 2,
    'no-new-symbol': 2,
    'no-new-wrappers': 2,
    'no-obj-calls': 2,
    'no-octal': 2,
    'no-octal-escape': 2,
    'no-path-concat': 2,
    'no-proto': 2,
    'no-redeclare': 2,
    'no-regex-spaces': 2,
    'no-return-assign': [2, 'except-parens'],
    'no-self-assign': 2,
    'no-self-compare': 2,
    'no-sequences': 2,
    'no-shadow-restricted-names': 2,
    'no-spaced-func': 2,
    'no-sparse-arrays': 2,
    'no-this-before-super': 2,
    'no-throw-literal': 2,
    'no-trailing-spaces': 0,
    'no-undef': 2,
    'no-undef-init': 2,
    'no-unexpected-multiline': 2,
    'no-unmodified-loop-condition': 2,
    'no-unneeded-ternary': [
      2,
      {
        defaultAssignment: false,
      },
    ],
    'no-unreachable': 2,
    'no-unsafe-finally': 2,
    'no-unused-vars': [
      2,
      {
        vars: 'all',
        args: 'none',
      },
    ],
    'no-useless-call': 2,
    'no-useless-computed-key': 2,
    'no-useless-constructor': 2,
    'no-useless-escape': 0,
    'no-whitespace-before-property': 2,
    'no-with': 2,
    'one-var': [
      2,
      {
        initialized: 'never',
      },
    ],
    'operator-linebreak': [
      2,
      'after',
      {
        overrides: {
          '?': 'before',
          ':': 'before',
        },
      },
    ],
    'padded-blocks': [2, 'never'],
    quotes: [
      2,
      'single',
      {
        avoidEscape: true,
        allowTemplateLiterals: true,
      },
    ],
    'semi-spacing': [
      2,
      {
        before: false,
        after: true,
      },
    ],

    'space-in-parens': [2, 'never'],
    'space-infix-ops': 1,
    'space-unary-ops': [
      2,
      {
        words: true,
        nonwords: false,
      },
    ],
    'template-curly-spacing': [2, 'never'],
    'use-isnan': 2,
    'valid-typeof': 2,
    'wrap-iife': [2, 'any'],
    'yield-star-spacing': [2, 'both'],
    yoda: [2, 'never'],
    'prefer-const': 2,
    'array-bracket-spacing': [2, 'never'],
    'no-prototype-builtins': 0,
    // 自定義開始
    'vue/html-indent': 0,
    'vue/html-closing-bracket-newline': 0,
    'vue/html-self-closing': 0,
    indent: 0,
    semi: 0,
    'comma-spacing': 0,
    'space-before-blocks': 0,
    'keyword-spacing': 0,
    'key-spacing': 0,
    'no-multiple-empty-lines': 0,
    'spaced-comment': 0,
    'space-before-function-paren': 0,
    'arrow-spacing': 0,
    'object-curly-spacing': 0,
  },
}

.eslintignore

需要忽略打包的文件卜朗,像 .gitignore 一樣的寫法就行

# 忽略打包的文件
unpackage
# 忽略uni-app官方的組件庫錯誤和警告,官方的竟然通不過...
components/uni-**

stylelint

用來校驗 scss,less,styl,css,html,vuecss

${app}/stylelint.config.js

module.exports = {
  root: true,
  plugins: ['stylelint-order'],
  extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
  rules: {
    'selector-pseudo-class-no-unknown': [
      true,
      {
        ignorePseudoClasses: ['global'],
      },
    ],
    'at-rule-no-unknown': [
      true,
      {
        ignoreAtRules: ['function', 'if', 'each', 'include', 'mixin', 'for'],
      },
    ],
    'no-duplicate-selectors': null,
    'no-empty-source': null,
    'unicode-bom': 'never',
    'no-descending-specificity': null,
    'font-family-no-missing-generic-family-keyword': null,
    'declaration-colon-space-after': 'always-single-line',
    'declaration-colon-space-before': 'never',
    'declaration-block-trailing-semicolon': 'always',
    'rule-empty-line-before': [
      'always',
      {
        ignore: ['after-comment', 'first-nested'],
      },
    ],
    'property-no-unknown': [
      true,
      {
        ignoreProperties: ['lines'],
      },
    ],
    'media-feature-name-no-unknown': [
      true,
      {
        ignoreMediaFeatureNames: 'min-device-pixel-ratio',
      },
    ],
    'unit-no-unknown': [
      true,
      {
        ignoreUnits: ['rpx'],
      },
    ],
    'selector-pseudo-element-no-unknown': [
      true,
      {
        ignorePseudoElements: ['v-deep'],
      },
    ],
    // 指定聲明塊內屬性的字母順序
    'order/properties-order': [
      'position',
      'top',
      'right',
      'bottom',
      'left',
      'z-index',
      'display',
      'float',
      'width',
      'height',
      'max-width',
      'max-height',
      'min-width',
      'min-height',
      'padding',
      'padding-top',
      'padding-right',
      'padding-bottom',
      'padding-left',
      'margin',
      'margin-top',
      'margin-right',
      'margin-bottom',
      'margin-left',
      'margin-collapse',
      'margin-top-collapse',
      'margin-right-collapse',
      'margin-bottom-collapse',
      'margin-left-collapse',
      'overflow',
      'overflow-x',
      'overflow-y',
      'clip',
      'clear',
      'font',
      'font-family',
      'font-size',
      'font-smoothing',
      'osx-font-smoothing',
      'font-style',
      'font-weight',
      'hyphens',
      'src',
      'line-height',
      'letter-spacing',
      'word-spacing',
      'color',
      'text-align',
      'text-decoration',
      'text-indent',
      'text-overflow',
      'text-rendering',
      'text-size-adjust',
      'text-shadow',
      'text-transform',
      'word-break',
      'word-wrap',
      'white-space',
      'vertical-align',
      'list-style',
      'list-style-type',
      'list-style-position',
      'list-style-image',
      'pointer-events',
      'cursor',
      'background',
      'background-attachment',
      'background-color',
      'background-image',
      'background-position',
      'background-repeat',
      'background-size',
      'border',
      'border-collapse',
      'border-top',
      'border-right',
      'border-bottom',
      'border-left',
      'border-color',
      'border-image',
      'border-top-color',
      'border-right-color',
      'border-bottom-color',
      'border-left-color',
      'border-spacing',
      'border-style',
      'border-top-style',
      'border-right-style',
      'border-bottom-style',
      'border-left-style',
      'border-width',
      'border-top-width',
      'border-right-width',
      'border-bottom-width',
      'border-left-width',
      'border-radius',
      'border-top-right-radius',
      'border-bottom-right-radius',
      'border-bottom-left-radius',
      'border-top-left-radius',
      'border-radius-topright',
      'border-radius-bottomright',
      'border-radius-bottomleft',
      'border-radius-topleft',
      'content',
      'quotes',
      'outline',
      'outline-offset',
      'opacity',
      'filter',
      'visibility',
      'size',
      'zoom',
      'transform',
      'box-align',
      'box-flex',
      'box-orient',
      'box-pack',
      'box-shadow',
      'box-sizing',
      'table-layout',
      'animation',
      'animation-delay',
      'animation-duration',
      'animation-iteration-count',
      'animation-name',
      'animation-play-state',
      'animation-timing-function',
      'animation-fill-mode',
      'transition',
      'transition-delay',
      'transition-duration',
      'transition-property',
      'transition-timing-function',
      'background-clip',
      'backface-visibility',
      'resize',
      'appearance',
      'user-select',
      'interpolation-mode',
      'direction',
      'marks',
      'page',
      'set-link-source',
      'unicode-bidi',
      'speak',
    ],
  },
}

.stylelintignore

# 忽略打包的文件
src/unpackage
# 忽略uni-app官方的組件庫錯誤和警告暖庄,官方的竟然通不過...
src/components/uni-**

lint-staged

用來對你已經 git add 的文件進行校驗聊替,所以不需要指定路徑楼肪。

${app}/lint-staged.config.js

module.exports = {
  '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
  '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'],
  'package.json': ['prettier --write'],
  '*.vue': ['prettier --write', 'stylelint --fix --allow-empty-input'],
  '*.{scss,less,styl,css,html}': ['stylelint --fix --allow-empty-input', 'prettier --write'],
  '*.md': ['prettier --write'],
}

package.json

刪除了不必要的信息

${app}/package.json

{
  "scripts": {
    "lint:eslint": "eslint --fix --ext \"src/**/*.{vue,less,css,scss}\"",
    "lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
    "lint:stylelint": "stylelint --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
    "gc": "git add -A && git-cz && git pull && git push"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  }
}

0x5 使用

提交代碼

本地執(zhí)行

yarn gc
# 實際執(zhí)行培廓,這是個人自己定義的命令,因為經常需要推送和拉取代碼春叫,核心就是git cz替代git commit -m ''可以選擇本次提交的類型肩钠,很方便
git add -A && git cz && git pull && git push

一條命令搞定了代碼提交泣港、校驗、拉取价匠、推送当纱。當然遇到有沖突的情況還是需要自己手動解決。

代碼校驗 - lint:eslint

yarn lint:eslint
# 實際執(zhí)行
eslint --fix --ext \"src/**/*.{vue,less,css,scss}\"

代碼校驗 - lint:prettier

yarn lint:prettier
# 實際執(zhí)行
prettier --write --loglevel warn \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"

代碼校驗 - lint:stylelint

yarn lint:prettier
# 實際執(zhí)行
stylelint --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/

0x6 總結

經過這么配置之后踩窖,代碼的質量和規(guī)范相對于沒有配置之前維護性大大提高坡氯,同時也可以避免一些錯誤的發(fā)生。但工具終究是工具洋腮,寫代碼的終究是人箫柳,在編寫代碼的同時,養(yǎng)成好的編碼習慣和優(yōu)化意識才是最重要的啥供。

在我眼中程序員可以不穿很時髦的衣服悯恍,但是一定要穿的干凈。多多少少有點潔癖伙狐、有點強迫癥涮毫、??

0x7 其他

參考文章:lint-staged 和 husky 在 pre-commit 階段做代碼檢查

配置參考:https://github.com/anncwb/vue-vben-admin

關于我

SunSeekerX,前端開發(fā)贷屎、Nodejs 開發(fā)罢防、小程序、uni-app 開發(fā)豫尽、等等

喜歡探討技術實現方案和細節(jié)篙梢,完美主義者,見不得 bug美旧。

Github:https://github.com/SunSeekerX

個人博客:https://yoouu.cn/

個人在線筆記:https://sunseekerx.yoouu.cn/

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
  • 序言:七十年代末渤滞,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子榴嗅,更是在濱河造成了極大的恐慌妄呕,老刑警劉巖,帶你破解...
    沈念sama閱讀 222,590評論 6 517
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件嗽测,死亡現場離奇詭異绪励,居然都是意外死亡,警方通過查閱死者的電腦和手機唠粥,發(fā)現死者居然都...
    沈念sama閱讀 95,157評論 3 399
  • 文/潘曉璐 我一進店門疏魏,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人晤愧,你說我怎么就攤上這事大莫。” “怎么了官份?”我有些...
    開封第一講書人閱讀 169,301評論 0 362
  • 文/不壞的土叔 我叫張陵只厘,是天一觀的道長烙丛。 經常有香客問我,道長羔味,這世上最難降的妖魔是什么河咽? 我笑而不...
    開封第一講書人閱讀 60,078評論 1 300
  • 正文 為了忘掉前任,我火速辦了婚禮赋元,結果婚禮上忘蟹,老公的妹妹穿的比我還像新娘。我一直安慰自己搁凸,他們只是感情好寒瓦,可當我...
    茶點故事閱讀 69,082評論 6 398
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著坪仇,像睡著了一般杂腰。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上椅文,一...
    開封第一講書人閱讀 52,682評論 1 312
  • 那天喂很,我揣著相機與錄音,去河邊找鬼皆刺。 笑死少辣,一個胖子當著我的面吹牛,可吹牛的內容都是我干的羡蛾。 我是一名探鬼主播漓帅,決...
    沈念sama閱讀 41,155評論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼痴怨!你這毒婦竟也來了忙干?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 40,098評論 0 277
  • 序言:老撾萬榮一對情侶失蹤浪藻,失蹤者是張志新(化名)和其女友劉穎捐迫,沒想到半個月后,有當地人在樹林里發(fā)現了一具尸體爱葵,經...
    沈念sama閱讀 46,638評論 1 319
  • 正文 獨居荒郊野嶺守林人離奇死亡施戴,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 38,701評論 3 342
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現自己被綠了萌丈。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片赞哗。...
    茶點故事閱讀 40,852評論 1 353
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖辆雾,靈堂內的尸體忽然破棺而出肪笋,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 36,520評論 5 351
  • 正文 年R本政府宣布涂乌,位于F島的核電站,受9級特大地震影響英岭,放射性物質發(fā)生泄漏湾盒。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 42,181評論 3 335
  • 文/蒙蒙 一诅妹、第九天 我趴在偏房一處隱蔽的房頂上張望罚勾。 院中可真熱鬧,春花似錦吭狡、人聲如沸尖殃。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,674評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽送丰。三九已至,卻和暖如春弛秋,著一層夾襖步出監(jiān)牢的瞬間器躏,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,788評論 1 274
  • 我被黑心中介騙來泰國打工蟹略, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留登失,地道東北人。 一個月前我還...
    沈念sama閱讀 49,279評論 3 379
  • 正文 我出身青樓挖炬,卻偏偏與公主長得像揽浙,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子意敛,可洞房花燭夜當晚...
    茶點故事閱讀 45,851評論 2 361