Skip to content
#

blog

Here are 16,185 public repositories matching this topic...

alexfinnarn
alexfinnarn commented Jun 24, 2019

Describe the bug

GitHub provides a few options when configuring a new repo like: license, .gitignore file, a README.md, and the Rennovate plugin. If you want to install any of these by default, which I usually do, then you get an error about the remote having newer content.

To Reproduce
Steps to reproduce the behavior:

  1. Create a repo with a readme during the script
  2. See the er
varHarrie
varHarrie commented Oct 29, 2018

Linters

JavaScript

$ npm i -D eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node
// .eslintrc
{
  "extends": ["standard"]
}

TypeScript

$ npm i -D tslint tslint tslint-config-standard
// tslint.json
{
  "extends": [
    "tslint:latest",
    "tslint-config-stan
cssmagic
cssmagic commented Jul 27, 2018

前言

ESLint 是目前最主流、最强大的 JS 代码校验工具。当我们的代码触发了 ESLint 的报警规则时,ESLint 就会提示错误。

本系列文章将详细讲解那些需要手工介入修复的 ESLint 规则,帮助你顺利地把既有代码迁移到 ESLint 的保护之中。

no-empty

禁止出现空代码块,比如 if/else/for/catch 等代码块都在报警之列。

比如下面这个判断语句,if 块就是空的:

if (foo) {

} else {
    bar()
}

我们把判断条件反转一下,就可以消灭掉空的 if 块了。代码还更简练些:

if (!foo) {
    bar()
}

在某些情况下,判断条件

Improve this page

Add a description, image, and links to the blog topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the blog topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.