使用非常快的美化目的
更漂亮的配置和 Eslint 规则正在影响 node_modules。所以,想跳过它。
因此,尝试创建 .prettierignore 文件,其中定义了 node_modules
有如下配置设置规则:
"lint": "pretty-quick & eslint "src/**/*.{js,jsx}" --quiet --fix"
Run Code Online (Sandbox Code Playgroud)
给出错误为:
SyntaxError: Nested mappings are not allowed in compact mappings (8:9)
6 | artifact: 'file://dcs.tar.gz'
7 | deploymentStrategy: default
> 8 | config: artifact:
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 9 |
| ^
at e (/Users/mithha/Documents/dcs/ui/ui-plugins/dcs/node_modules/prettier/parser-yaml.js:1:323)
at Object.parse (/Users/mithha/Documents/dcs/ui/ui-plugins/dcs/node_modules/prettier/parser-yaml.js:1:156977)
at Object.parse$2 [as parse] (/Users/mithha/Documents/dcs/ui/ui-plugins/dcs/node_modules/prettier/index.js:7138:19)
at coreFormat (/Users/mithha/Documents/dcs/ui/ui-plugins/dcs/node_modules/prettier/index.js:10398:23)
at format (/Users/mithha/Documents/dcs/ui/ui-plugins/dcs/node_modules/prettier/index.js:10570:16)
at formatWithCursor (/Users/mithha/Documents/dcs/ui/ui-plugins/dcs/node_modules/prettier/index.js:10582:12)
at /Users/mithha/Documents/dcs/ui/ui-plugins/dcs/node_modules/prettier/index.js:34924:15
at format (/Users/mithha/Documents/dcs/ui/ui-plugins/dcs/node_modules/prettier/index.js:34943:12)
at exports.default (/Users/mithha/Documents/dcs/ui/ui-plugins/dcs/node_modules/pretty-quick/dist/formatFiles.js:18:41)
at exports.default (/Users/mithha/Documents/dcs/ui/ui-plugins/dcs/node_modules/pretty-quick/dist/index.js:54:29)
? …Run Code Online (Sandbox Code Playgroud) 到底是什么原因 Control Freak: Commit rejected. Foxtrot merges not allowed
我们经常会收到此错误,这是由于和的结合造成的pull,rebase还是amend由用户在提交时引起的?
需要明确说明才能永久摆脱这种情况。我知道并了解分支已经分散并且失去了踪迹,但是用简单的语言确切地导致了这一分支的原因是非常明显的
每当我们看到此错误时,我们便要重新定基,这是一个时间杀手。我们正在手动挑选更改以消除此问题。
如何确定提交的类型,例如在重新设置基数,拉动或修改之后是正确的提交,以及那是谁?
从今以后,我们要教育开发人员摆脱类似的提交错误。很想听听有关最佳做法的信息。
另外,想了解使用git-bash / source-tree这样的组合工具是否有任何理由?
我们可以关闭这个原因吗?
在 VS 代码中editor.formatOnSave = true,当尝试忽略某些规则并在行末尾使用 //NOSONAR 抑制错误时。线路评论正在下降。如何以及在哪里配置这些规则?
export const overviewReducer = (state = initialState, action) => { //NOSONAR
进入下一行,例如:
export const overviewReducer = (state = initialState, action) => {
//NOSONAR
curl -X POST http://xxx.yyy.zzz:5555/job/job-name/build --user john-devops-jenkins:11df3ed41129c5c7da1518e9c3149896de -H 'Jenkins-Crumb:31827a74a160347a641c87ddbc8e3b6e'
Run Code Online (Sandbox Code Playgroud)
上面带有 post 请求的卷曲代码在触发 Jenkins 构建方面绝对工作得很好。
尝试过:
错误:No valid crumb was included in the request
仍然不走运,如何配置 bitbucket hook 到 crumb 的容器头信息或如何通过 url 传递它而不依赖第三方插件?
有一个输入类型文件元素.在角度文件上载多次期间,该值不会被清除.因此,使用普通的JavaScript dom操作手动清除它.
以下是代码:
function removeFromQueue(item) {
vm.uploads.uploader.removeFromQueue(item);
// Clearing input file field for re-uploading
if(!vm.uploadFile) {
document.getElementById('upload-file-' + vm.type).value = null;
}
}
Run Code Online (Sandbox Code Playgroud)
在这种情况下,无法模拟document.getElementById,因此使用vm.uploadFile未定义的变量从单元测试用例中控制它是错误的.如何在这里模拟dom元素?
/public/assets/others/brochure/jan-2016.pdf尝试从Laravel 中的路径查看存储在文件中的 pdf brochure/jan-2016.pdf', 'BrochureController@show');。
但我收到错误:Whoops, looks like something went wrong
路线代码:
\n\nRoute::get('/brochure/{file}', 'BrochureController@show');\nRun Code Online (Sandbox Code Playgroud)\n\n在控制器中:
\n\n<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\n\nuse App\\Http\\Requests;\nuse App\\Http\\Controllers\\Controller;\n\nclass BrochureController extends Controller\n{ \n public function show($filename)\n { \n $filename = 'jan-2016.pdf';\n $filepath = 'assets/others/brochure/';\n $path = $filepath.$filename;\n\n return Response::make(file_get_contents($path), 200, [\n 'Content-Type' => 'application/pdf',\n 'Content-Disposition' => 'inline; '.$filename,\n ]);\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n\n当我尝试仅打印文件内容时,它捕获文件并使用某种奇怪的方式显示file_get_contents($path)
输出: %PDF-1.4 %\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd 1 0 obj <>stream PScript5.dll Version 5.2.2 GVTP January 2016 Dummy content endstream endobj …
我在abc控制器中有以下代码:
$rootScope.$on('selectedItem', function (event, data) {
vm.selectedItem = data;
});
Run Code Online (Sandbox Code Playgroud)
调用函数在xyz控制器中:
function doThis(){
$rootScope.$emit('selectedItem', 'somedata');
}
Run Code Online (Sandbox Code Playgroud)
如何在业力测试中复制或模拟这种情况?
我sitemap.xml在http://example.com的根目录中
当我尝试访问http://example.com/sitemap.xml时。显然会引发路由未找到错误。
因此,尝试将其更改.htaccess为如下所示:
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/sitemap.xml
RewriteRule ^ index.php [L]
Run Code Online (Sandbox Code Playgroud)
使用的Laravel版本:5.1。
但是,没有运气。我该如何使用和呈现手动生成的XML文件,而不是通过路由进行投放?我不是在这里寻找复杂的XML解析理论。只是尝试从特定路由逃脱。
这是我尝试处理的模型代码duplicate entries:
$userData = ['name' => $name, 'email' => $email, 'password' => $password];
public function addUser($userData) {
try {
DB::table('users')->insert($userData);
} catch (QueryException $e) {
$errorCode = $e->errorInfo[1];
if($errorCode == 1062){
throw ('Duplicate Entry');
}
}
}
Run Code Online (Sandbox Code Playgroud)
调用控制器代码如下所示: $userModel->addUser($userData);
在这里,我不是要打印从model.
获取错误为:
我究竟做错了什么?如何正确处理异常以及这样做的最佳实践是什么?
我的 VSCode 配置了更漂亮和 ESLint 设置,使开发更容易。
但我不确定哪个规则影响了我的 JSX 类名。理想情况下,类名应该是:test-wrapper
<i className={style.test-wrapper} />
Run Code Online (Sandbox Code Playgroud)
但它在保存时更改为以下并导致很多问题:
<i className={style.test - wrapper} />
Run Code Online (Sandbox Code Playgroud)
我可以知道我应该覆盖或修改哪个规则吗?