eslint-config-styled

2019-06-14 admin

eslint-config-styled是什么

什么是eslint-config-styled,ESLint shareable config for JavaScript Styled.

eslint-config-styled使用教程帮助文档

JavaScript Styled

ESLint shareable config for JavaScript Styled.

Travis Status AppVeyor Status Codacy Status Dependencies Status Version Status Download Status Gitter Chat

Install

$ npm install --save-dev eslint-config-styled

Usage

Add some ESLint config to your .eslintrc:

{
	"extends": "styled"
}

Or to command line options:

eslint --config=styled

Or to package.json:

{
	"name": "my-project",
	"eslintConfig": {
			"extends": "styled"
	}
}

Rules

  • No semicolons.
  • No unused variables.
  • Use tab for indentation.
  • Use === instead of ==.
  • Use single quotes for strings except to avoid escaping.
  • Add a space after keywords.
  • Add a space before a function declaration’s parentheses.
  • Infix operators must be spaced.
  • Commas should have a space after them.
  • Keep else statements on the same line as their curly braces.
  • For multi-line if statements, use curly braces.
  • Always handle the err function parameter.
  • Always prefix browser globals with window..
  • Multiple blank lines not allowed.
  • For the ternary operator in a multi-line setting, place ? and : on their own lines.
  • For var declarations, write each declaration in its own statement.
  • Wrap conditional assignments with additional parentheses. This makes it clear that the expression is intentionally an assignment (=) rather than a typo for equality (===).

NOTE: The best way to learn about that is to just install it and give it a try on your code.

Contributing

Want to contribute? Follow these recommendations.

License

Designed with ♥ by CJ Patoilo. Licensed under the MIT License.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-67251.html

文章标题:eslint-config-styled

回到顶部