#js eslint
使用 eslint 的时候发现 svg 文件被意外包含导致报错,尝试在eslint命令中使用
使用 eslint 的时候发现 svg 文件被意外包含导致报错,尝试在eslint命令中使用
--ext 参数排除 svg 文件,但是没有生效,经过排查发现是 eslint 命令书写不规范导致的// 错误命令(即使 ext 没有 svg 检查的时候还是会检查svg)
eslint --ext .ts,.tsx src/**
// 正确命令
eslint --ext .ts,.tsx src
Forwarded from 羽毛的小白板
如何检测网络是否已连接?
比较通用的方法是访问一个返回204(No Content)的页面
比如
https://g.co/generate_204
https://g.cn/generate_204
如果在国内可以选择清华大学的开源镜像站
https://mirrors.tuna.tsinghua.edu.cn/generate_204
比较通用的方法是访问一个返回204(No Content)的页面
比如
https://g.co/generate_204
https://g.cn/generate_204
如果在国内可以选择清华大学的开源镜像站
https://mirrors.tuna.tsinghua.edu.cn/generate_204
#git
git push 的常用完整形式为
比如
git push 的常用完整形式为
git push origin local_branch:origin_branch比如
git push origin HEAD:master 为把当前分支推送到 origin 的 master 分支大家对这个频道有什么意见建议,消息存在错误甚至想要搭讪,都欢迎通过 [google forms](https://forms.gle/jUknwjNmG9EaNDtJ8) 联系我(支持匿名)
Google Docs
Contact me
Arki 的每日 BUG 观察 pinned «大家对这个频道有什么意见建议,消息存在错误甚至想要搭讪,都欢迎通过 [google forms](https://forms.gle/jUknwjNmG9EaNDtJ8) 联系我(支持匿名)»
#bash
# 如果存在 build 目录就删除该目录平时 bash 写的少,这种必须写分号的地方没写结果报错又找不到哪错QAQ
if [ -d build ]; then
rm -rf build; # 结尾分号!!
fi
#git
如何将某个 dist 文件夹单独部署 gh-pages 分支?
大部分人可能重新建个git仓库push
* 该方案未亲自测试,如果有人踩坑请务必告知
如何将某个 dist 文件夹单独部署 gh-pages 分支?
大部分人可能重新建个git仓库push
cd dist实际上,使用 subtree 这个稀有命令更方便更优雅
git init
git add .
git commit -m 'Deploy'
git remote add upstream [Upstream git URL]
git push origin gh-pages
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder参考 [Deploying a subfolder to GitHub Pages](https://gist.github.com/cobyism/4730490)
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages
* 该方案未亲自测试,如果有人踩坑请务必告知
Gist
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io). - gh-pages-deploy.md
#html
ol/ul > li 会自动缩进,并且由于 ol 会自动添上 list 的 marker ,单纯使用 padding-left 取消缩进会发现 list 的 marker 位置不对了
正确的取消缩进的方法除了修改
关于
https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-position
ol/ul > li 会自动缩进,并且由于 ol 会自动添上 list 的 marker ,单纯使用 padding-left 取消缩进会发现 list 的 marker 位置不对了
正确的取消缩进的方法除了修改
padding-left 为 0 之外还需要使用 css list-style-position: outside; 调整 marker 位置关于
list-style-position 这个 css 可以看这里https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-position
MDN Web Docs
list-style-position - CSS | MDN
The list-style-position CSS property sets the position of the ::marker relative to a list item.