Skip to content

Commit

Permalink
sync to v3.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
molee1905 committed Nov 7, 2016
1 parent ac5d349 commit 084d9a8
Show file tree
Hide file tree
Showing 680 changed files with 78,612 additions and 20,597 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "ESLint中文"
exclude: [
'node_modules',
'bower_components',
'vendor'
]
keywords: "ESLint中文, ESLint中文网, ESLint规则, ESLint配置, 代码检测, 代码质量, JavaScript, Linter, Linting, Pluggable, Configurable, Code Quality"
Expand Down
12 changes: 12 additions & 0 deletions _data/logos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,15 @@
- url: https://read.douban.com
src: /img/logos/ark.svg
name: Ark Reading

- url: http://phoenixrobotix.com
src: /img/logos/phoenixrobotix.png
name: Phoenix Robotix

- url: http://www.jeuxvideo.com/
src: /img/logos/jeuxvideo.com.svg
name: JeuxVideo.com

- url: https://www.airhelp.com/
src: /img/logos/airhelp.png
name: AirHelp
1,343 changes: 1,343 additions & 0 deletions _data/rules.yml

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions _includes/ad.html

This file was deleted.

3 changes: 2 additions & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<li><a href="https://groups.google.com/group/eslint">Mailing List</a></li>
<li><a href="https://github.com/eslint/eslint">GitHub</a></li>
<li><a href="https://twitter.com/geteslint">Twitter</a></li>
<li>Copyright jQuery Foundation and other contributors, <a href="https://jquery.org">https://jquery.org/</a></li>
<li><a href="https://gitter.im/eslint/eslint">Chat Room</a></li>
<li>Copyright JS Foundation and other contributors, <a href="https://js.foundation">https://js.foundation/</a></li>
</ul>
</footer>
</div><!-- /.container -->
Expand Down
7 changes: 2 additions & 5 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="description" content="{{ site.description }}">
{% if page.title != site.name %}
{% if page.title != "ESLint" %}
<title>{{ page.title | remove:'Rule'}} - {{ site.name }}</title>
<title>{{ page.title }} - {{ site.name }}</title>
{% else %}
<title>{{ site.name }}</title>
{% endif %}
Expand All @@ -17,14 +17,11 @@
{% endif %}

<link href="{{ site.url }}{{ page.url }}" rel="canonical" />
<link rel="stylesheet" href="/styles/main.936b04d2.css"/>
<link rel="stylesheet" href="/styles/search.css"/>
<link rel="stylesheet" href="/styles/overrides.css"/>
<link rel="stylesheet" href="/styles/main.css"/>
{% if include.multi == "true" %}
<link rel="stylesheet" href="/styles/mixed.css"/>
{% endif %}
<link rel="icon" href="/img/favicon.512x512.png">
<link rel="stylesheet" href="/styles/rouge.css"/>
<link rel="alternate" type="application/rss+xml" title="{{ site.name }}" href="{{ site.url }}/feed.xml">

<script src="https://cdn.jsdelivr.net/g/[email protected],[email protected],[email protected],[email protected](autocomplete.min.js)"></script>
Expand Down
6 changes: 3 additions & 3 deletions _includes/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{% endif %}
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">用户指南<span class="caret"></span></a>
<a href="/docs/user-guide" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">用户指南<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/docs/user-guide/configuring">配置</a></li>
<li><a href="/docs/user-guide/command-line-interface">命令行</a></li>
Expand All @@ -43,7 +43,7 @@
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">开发指南<span class="caret"></span></a>
<a href="/docs/developer-guide" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">开发指南<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/docs/developer-guide/architecture">架构</a></li>
<li><a href="/docs/developer-guide/source-code">源码</a></li>
Expand All @@ -60,7 +60,7 @@
</li>
<li><a href="/blog/">博客</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">演示<span class="caret"></span></a>
<a href="/demo" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">演示<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/demo/">ESLint Demo</a></li>
<li><a href="/parser/">Espree Demo</a></li>
Expand Down
76 changes: 76 additions & 0 deletions _posts/2016-06-17-eslint-v2.13.0-released.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
layout: post
title: ESLint v2.13.0 released
tags:
- release
- minor
---
# ESLint v2.13.0 released

We just pushed ESLint v2.13.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.

## Highlights

This is a summary of the major changes you need to know about for this version of ESLint.

### Last 2.x Release

This is the last planned 2.x release. The next scheduled release is 3.0.0, which contains several small breaking changes. While there are breaking changes, we expect the impact to users to be very minimal. You can [review the 3.0.0 plan](https://github.com/eslint/eslint/issues/6356) for more information.

### More Autofixing

We are continuing to add autofixing to more rules, and this release we added autofixing to `object-shorthand`, `padded-blocks`, and `no-multiple-empty-lines`.

## Enhancements


* [da30cf9](https://github.com/eslint/eslint/commit/da30cf9) Update: Add fixer for object-shorthand (fixes [#6412](https://github.com/eslint/eslint/issues/6412)) ([#6418](https://github.com/eslint/eslint/issues/6418)) (Nick Heiner)
* [1316db0](https://github.com/eslint/eslint/commit/1316db0) Update: Add `never` option for `func-names` (fixes [#6059](https://github.com/eslint/eslint/issues/6059)) ([#6392](https://github.com/eslint/eslint/issues/6392)) (alberto)
* [1c123e2](https://github.com/eslint/eslint/commit/1c123e2) Update: Add autofix for `padded-blocks` (fixes [#6320](https://github.com/eslint/eslint/issues/6320)) ([#6393](https://github.com/eslint/eslint/issues/6393)) (alberto)
* [5122f73](https://github.com/eslint/eslint/commit/5122f73) Update: no-multiple-empty-lines fixer (fixes [#6225](https://github.com/eslint/eslint/issues/6225)) ([#6226](https://github.com/eslint/eslint/issues/6226)) (Ruurd Moelker)




## Bug Fixes


* [cf223dd](https://github.com/eslint/eslint/commit/cf223dd) Fix: add test for a syntax error (fixes [#6013](https://github.com/eslint/eslint/issues/6013)) ([#6378](https://github.com/eslint/eslint/issues/6378)) (Toru Nagashima)
* [8ec89c8](https://github.com/eslint/eslint/commit/8ec89c8) Fix: `--print-config` return config inside subdir (fixes [#6329](https://github.com/eslint/eslint/issues/6329)) ([#6385](https://github.com/eslint/eslint/issues/6385)) (alberto)
* [4f73240](https://github.com/eslint/eslint/commit/4f73240) Fix: `object-curly-newline` multiline with comments (fixes [#6381](https://github.com/eslint/eslint/issues/6381)) ([#6396](https://github.com/eslint/eslint/issues/6396)) (Toru Nagashima)
* [ed84c4c](https://github.com/eslint/eslint/commit/ed84c4c) Fix: improve `newline-per-chained-call` message (fixes [#6340](https://github.com/eslint/eslint/issues/6340)) ([#6360](https://github.com/eslint/eslint/issues/6360)) (Toru Nagashima)
* [fb49c7f](https://github.com/eslint/eslint/commit/fb49c7f) Fix: nested `extends` with relative path (fixes [#6358](https://github.com/eslint/eslint/issues/6358)) ([#6359](https://github.com/eslint/eslint/issues/6359)) (Toru Nagashima)
* [cfdd524](https://github.com/eslint/eslint/commit/cfdd524) Fix: allow semi as braceless body of statements (fixes [#6386](https://github.com/eslint/eslint/issues/6386)) ([#6391](https://github.com/eslint/eslint/issues/6391)) (alberto)




## Documentation


* [852b6df](https://github.com/eslint/eslint/commit/852b6df) Docs: Delete empty table of links from Code Path Analysis ([#6423](https://github.com/eslint/eslint/issues/6423)) (Mark Pedrotti)
* [c2b5277](https://github.com/eslint/eslint/commit/c2b5277) Docs: Add gitter chat link to Reporting Bugs ([#6430](https://github.com/eslint/eslint/issues/6430)) (Mark Pedrotti)
* [73a9a6d](https://github.com/eslint/eslint/commit/73a9a6d) Docs: Fix links in Configuring ESLint ([#6421](https://github.com/eslint/eslint/issues/6421)) (Mark Pedrotti)
* [9ea4e44](https://github.com/eslint/eslint/commit/9ea4e44) Docs: Update parser reference to `espree` instead of `esprima` ([#6404](https://github.com/eslint/eslint/issues/6404)) (alberto)
* [7f57467](https://github.com/eslint/eslint/commit/7f57467) Docs: Make `fix` param clearer (fixes [#6366](https://github.com/eslint/eslint/issues/6366)) ([#6367](https://github.com/eslint/eslint/issues/6367)) (Nick Heiner)
* [0e7ce72](https://github.com/eslint/eslint/commit/0e7ce72) Docs: Fix rest-spread-spacing's name ([#6365](https://github.com/eslint/eslint/issues/6365)) (cody)
* [6b08cfc](https://github.com/eslint/eslint/commit/6b08cfc) Docs: key-spacing fixable documenation notes (fixes [#6375](https://github.com/eslint/eslint/issues/6375)) ([#6376](https://github.com/eslint/eslint/issues/6376)) (Ruurd Moelker)
* [4b4be3b](https://github.com/eslint/eslint/commit/4b4be3b) Docs: `max-lines` option: fix `skipComments` typo ([#6374](https://github.com/eslint/eslint/issues/6374)) (Jordan Harband)
* [20ab4f6](https://github.com/eslint/eslint/commit/20ab4f6) Docs: Fix wrong link in object-curly-newline ([#6373](https://github.com/eslint/eslint/issues/6373)) (Grant Snodgrass)
* [412ce8d](https://github.com/eslint/eslint/commit/412ce8d) Docs: Fix broken links in no-mixed-operators ([#6372](https://github.com/eslint/eslint/issues/6372)) (Grant Snodgrass)








## Chores


* [2cd90eb](https://github.com/eslint/eslint/commit/2cd90eb) Chore: Fix rule meta description inconsistencies (refs [#5417](https://github.com/eslint/eslint/issues/5417)) ([#6422](https://github.com/eslint/eslint/issues/6422)) (Mark Pedrotti)
* [5e9117e](https://github.com/eslint/eslint/commit/5e9117e) Chore: sort rules in eslint.json (fixes [#6425](https://github.com/eslint/eslint/issues/6425)) ([#6426](https://github.com/eslint/eslint/issues/6426)) (alberto)
* [77697a7](https://github.com/eslint/eslint/commit/77697a7) Chore: Fake config hierarchy fixtures (fixes [#6206](https://github.com/eslint/eslint/issues/6206)) ([#6402](https://github.com/eslint/eslint/issues/6402)) (Gyandeep Singh)


42 changes: 42 additions & 0 deletions _posts/2016-06-20-eslint-v2.13.1-released.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
layout: post
title: ESLint v2.13.1 released
tags:
- release
- patch
---
# ESLint v2.13.1 released

We just pushed ESLint v2.13.1, which is a patch release upgrade of ESLint. This release fixes several bugs found in the previous release.










## Bug Fixes


* [434de7f](https://github.com/eslint/eslint/commit/434de7f) Fix: wrong baseDir (fixes [#6450](https://github.com/eslint/eslint/issues/6450)) ([#6457](https://github.com/eslint/eslint/issues/6457)) (Toru Nagashima)
* [3c9ce09](https://github.com/eslint/eslint/commit/3c9ce09) Fix: Keep indentation when fixing `padded-blocks` "never" (fixes [#6454](https://github.com/eslint/eslint/issues/6454)) ([#6456](https://github.com/eslint/eslint/issues/6456)) (Ed Lee)
* [1e185b9](https://github.com/eslint/eslint/commit/1e185b9) Fix: no-multiple-empty-lines errors when no line breaks (fixes [#6449](https://github.com/eslint/eslint/issues/6449)) ([#6451](https://github.com/eslint/eslint/issues/6451)) (strawbrary)




## Documentation


* [a9d4cb2](https://github.com/eslint/eslint/commit/a9d4cb2) Docs: Fix typo in max-params examples ([#6471](https://github.com/eslint/eslint/issues/6471)) (J. William Ashton)








79 changes: 79 additions & 0 deletions _posts/2016-07-01-eslint-new-rule-format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
layout: post
title: ESLint's New Rule Format
tags:
- rules
- development
---
# ESLint's New Rule Format

When ESLint began three years ago, it was a much smaller project with a much smaller user base. The project has grown a lot since that time and, in order to help the project scale, we've invested a lot of time into automating as many processes as possible. For instance, our release process is now completely automated, including deciding what the next version number should be based on the commits going into the release. When we looked over the processes that are still manual, there was one that jumped out as a big pain point: keeping rule documentation in sync. This wasn't a big problem when there were a dozen rules, but with over 200, this repeated process has become a big time commitment.

So, for the first time, we've decided to change the rule format for ESLint. The change is fairly small and we're hoping you'll agree that it makes a lot of sense. The overall design goal was allow for meta data to be stored directly on the rules themselves. Doing so allows us to have one source of truth for rule-related meta data and then generate documentation such as our rules index page and documentation pages for individual rules based off of that meta data. That means we'll no longer have to manually update multiple documentation pages whenever a rule becomes fixable or is added to `eslint:recommended`.

We went through a lot of design sessions to come up with a new rule format that would be easy for existing rule developers to work with -- making the new format familiar with as few changes as possible

## Format Comparison

To start, consider what rules have traditionally looked like in ESLint:

```js
// the rule creator function
module.exports = function(context) {
// code
};

// the rule options schema
module.exports.schema = [];
```

The two key parts of this format are the rule creator function and the rule options schema. As might be obvious, we started without rule options schemas and added them later. That led to the someone awkward inclusion of the `schema` object on `module.exports`. We never really liked this setup because it seemed like the schema should be defined before the creator function, but we didn't have much of an option without changing the whole rule format (which we didn't want to do at that point).

The new rule format should look a bit similar:

```js
module.exports = {

meta: {

// special key used for doc-only information
docs: {},

// indicates if the rule is fixable
fixable: "code",

// the rule options schema
schema: []
},

// the rule creator function
create: function(context) {
// code
}
};
```

The rule creator function and the rule options schema are still present in this new format. The big difference is that an object is exported and the rule creator function is a method called `create()` on that object. The contents of `create()` are the same as the contents of the creator function in the old format -- you don't have to do anything differently, so you can just copy over all of your old code as-is.

The object also has a `meta` property that contains additional meta data for the rule, including the rule options schema. Additionally, there is a `docs` object that contains information used in our documentation generation and the `fixable` property, which is present only if a rule is fixable (knowing that a rule is fixable ahead of time allows us to optimize the autofixing process as well as call this out in documentation).

You can read more about the new format in [Working with Rules](http://eslint.org/docs/developer-guide/working-with-rules).

## Automatic Transformation

All of the ESLint core rules have now been converted over into the new format, and we recommend that plugin authors update their custom rules to the new format as well. We used a tool that is now available called `eslint-transforms` to automatically convert our old-style rules into the new format. You can install the tool from npm:

```
$ npm install -g eslint-transforms
```

You can then transform your rules like this:

```
$ eslint-transforms new-rule-format path/to/rules/ rule.js
```

You can pass in as many files or directories as necessary to transform. See the [repo](https://github.com/eslint/eslint-transforms) for more information.



Loading

0 comments on commit 084d9a8

Please sign in to comment.