Skip to content

Commit

Permalink
chore(*): lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lyngai authored Jun 9, 2022
1 parent 5a74b0c commit b2fc3d4
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
// 大括号内的首尾需要空格
bracketSpacing: true,
// jsx 标签的反尖括号需要换行
jsxBracketSameLine: false,
bracketSameLine: false,
// 箭头函数,只有一个参数的时候,也需要括号
arrowParens: 'always',
// 每个文件格式化的范围是文件的全部内容
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@
"gulp-iconfont": "^11.0.0",
"gulp-rename": "^2.0.0",
"jest": "^27.5.1",
"node-sass": "^7.0.0",
"jest-diff": "^27.5.1",
"node-sass": "^7.0.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.2.15",
"prettier": "2.6.2",
"rimraf": "^3.0.2",
"rollup": "^1.27.5",
Expand Down
6 changes: 3 additions & 3 deletions src/Previewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ export default class Previewer {
}

getDomContainer = () =>
/** @type {HTMLDivElement} */ (this.isMobilePreview
? document.querySelector('.cherry-mobile-previewer-content')
: this.options.previewerDom);
/** @type {HTMLDivElement} */ (
this.isMobilePreview ? document.querySelector('.cherry-mobile-previewer-content') : this.options.previewerDom
);

getDom() {
return this.options.previewerDom;
Expand Down
3 changes: 2 additions & 1 deletion src/core/hooks/Blockquote.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export default class Blockquote extends ParagraphBase {
const { sign: contentSign, html: parsedHtml } = sentenceMakeFunc(content);
const sign = this.signWithCache(parsedHtml) || contentSign;
const lineCount = this.getLineCount(match, lines); // 段落所占行数
const listRegex = /^(([ \t]{0,3}([*+-]|\d+[.]|[a-z]\.|[I]+\.)[ \t]+)([^\r]+?)($|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.]|[a-z]\.|[I]+\.)[ \t]+)))/;
const listRegex =
/^(([ \t]{0,3}([*+-]|\d+[.]|[a-z]\.|[I]+\.)[ \t]+)([^\r]+?)($|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.]|[a-z]\.|[I]+\.)[ \t]+)))/;
let lastIndent = computeLeadingSpaces(lines);
// 逐行处理
const contentLines = parsedHtml.split('\n');
Expand Down
3 changes: 2 additions & 1 deletion src/core/hooks/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ function getListStyle(m2) {

// 标识符处理
function handleMark(str, node) {
const listRegex = /^((([*+-]|\d+[.]|[a-z]\.|[I]+\.)[ \t]+)([^\r]*?)($|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.]|[a-z]\.|[I]+\.)[ \t]+)))/;
const listRegex =
/^((([*+-]|\d+[.]|[a-z]\.|[I]+\.)[ \t]+)([^\r]*?)($|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.]|[a-z]\.|[I]+\.)[ \t]+)))/;
if (!listRegex.test(str)) {
node.type = 'blank';
return str;
Expand Down
8 changes: 5 additions & 3 deletions src/toolbars/MenuBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ import { createElement } from '@/utils/dom';
* @returns {HTMLDivElement}
*/
function createDiv(name, className, position, type = 'bottom') {
const div = /** @type {HTMLDivElement} */ (createElement('div', className, {
name,
}));
const div = /** @type {HTMLDivElement} */ (
createElement('div', className, {
name,
})
);
setPosition(div, position);
return div;
}
Expand Down
19 changes: 19 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8423,6 +8423,11 @@ nan@^2.12.1, nan@^2.13.2, nan@^2.14.2:
resolved "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee"
integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==

nanoid@^3.3.4:
version "3.3.4"
resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab"
integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==

nanomatch@^1.2.9:
version "1.2.13"
resolved "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
Expand Down Expand Up @@ -9476,6 +9481,15 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0:
resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514"
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==

postcss@^8.2.15:
version "8.4.14"
resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf"
integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==
dependencies:
nanoid "^3.3.4"
picocolors "^1.0.0"
source-map-js "^1.0.2"

prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
Expand Down Expand Up @@ -10425,6 +10439,11 @@ socks@^2.6.2:
ip "^1.1.5"
smart-buffer "^4.2.0"

source-map-js@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==

source-map-resolve@^0.5.0:
version "0.5.3"
resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a"
Expand Down

0 comments on commit b2fc3d4

Please sign in to comment.