Skip to content

Commit

Permalink
Merge branch 'master' into use-eslint-plugin-rulesdir
Browse files Browse the repository at this point in the history
  • Loading branch information
not-an-aardvark committed Oct 11, 2017
2 parents 41ab1aa + 51360c8 commit 27bd80d
Show file tree
Hide file tree
Showing 110 changed files with 3,071 additions and 719 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Expand Up @@ -3,8 +3,8 @@
This template is for bug reports. If you are reporting a bug, please continue on. If you are here for another reason, please see below:
1. To propose a new rule: http://eslint.org/docs/developer-guide/contributing/new-rules
2. To request a change: http://eslint.org/docs/developer-guide/contributing/changes
1. To propose a new rule: https://eslint.org/docs/developer-guide/contributing/new-rules
2. To request a change: https://eslint.org/docs/developer-guide/contributing/changes
3. If you have any questions, please stop by our chatroom: https://gitter.im/eslint/eslint
Note that leaving sections blank will make it difficult for us to troubleshoot and we may have to close the issue.
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -20,7 +20,7 @@
<!--
Please ensure your pull request is ready:
- Read the pull request guide (http://eslint.org/docs/developer-guide/contributing/pull-requests)
- Read the pull request guide (https://eslint.org/docs/developer-guide/contributing/pull-requests)
- Include tests for this change
- Update documentation for this change (if appropriate)
-->
Expand Down
78 changes: 78 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,81 @@
v4.8.0 - September 29, 2017

* 3f2b908 New: add option to report unused eslint-disable directives (fixes #9249) (#9250) (Teddy Katz)
* ff2be59 Fix: dot notation rule failing to catch string template (fixes #9350) (#9357) (Phil Quinn)
* b1372da Chore: remove sourceCode property from Linter (refs #9161) (#9363) (Teddy Katz)
* cef6f8c Docs: remove line about removing rules from semver policy (#9367) (Teddy Katz)
* 06efe87 Fix: Add meta element with charset attribute. (#9365) (H1Gdev)
* 458ca67 Docs: update architecture page (fixes #9337) (#9345) (Victor Hom)
* 1c6bc67 Fix: special EventEmitter keys leak information about other rules (#9328) (Teddy Katz)
* d593e61 Docs: update eslint.org links to use https (#9358) (Teddy Katz)
* 38d0cb2 Fix: fix wrong code-path about try-for-in (fixes #8848) (#9348) (Toru Nagashima)
* 434d9e2 Fix: Invalid font-size property value issue. (#9341) (H1Gdev)
* a7668c2 Chore: Remove unnecessary slice from logging utility (#9343) (Gyandeep Singh)
* 2ff6fb6 Chore: remove unused arguments in codebase (#9340) (Teddy Katz)

v4.7.2 - September 21, 2017

* 4f87732 Fix: Revert setting node.parent early (fixes #9331) (#9336) (Teddy Katz)

v4.7.1 - September 18, 2017

* 08656db Fix: Handle nested disable directive correctly (fixes #9318) (#9322) (Gyandeep Singh)
* 9226495 Revert "Chore: rewrite parseListConfig for a small perf gain." (#9325) (薛定谔的猫)

v4.7.0 - September 15, 2017

* 787b78b Upgrade: Espree v3.5.1 (fixes #9153) (#9314) (Brandon Mills)
* 1488b51 Update: run rules after `node.parent` is already set (fixes #9122) (#9283) (Teddy Katz)
* 4431d68 Docs: fix wrong config in max-len example. (#9309) (薛定谔的猫)
* 7d24dde Docs: Fix code snippet to refer to the correct option (#9313) (Ruben Tytgat)
* 12388d4 Chore: rewrite parseListConfig for a small perf gain. (#9300) (薛定谔的猫)
* ce1f084 Update: fix MemberExpression handling in no-extra-parens (fixes #9156) (jackyho112)
* 0c720a3 Update: allow autofixing when using processors (fixes #7510) (#9090) (Teddy Katz)
* 838df76 Chore: upgrade deps. (#9289) (薛定谔的猫)
* f12def6 Update: indent flatTernary option to handle `return` (fixes #9285) (#9296) (Teddy Katz)
* e220687 Fix: remove autofix for var undef inits (fixes #9231) (#9288) (Victor Hom)
* 002e199 Docs: fix no-restricted-globals wrong config. (#9305) (薛定谔的猫)
* fcfe91a Docs: fix wrong config in id-length example. (#9303) (薛定谔的猫)
* 2731f94 Update: make newline-per-chained-call fixable (#9149) (João Granado)
* 61f1093 Chore: avoid monkeypatching Linter instances in RuleTester (#9276) (Teddy Katz)
* 28929cb Chore: remove Linter#reset (refs #9161) (#9268) (Teddy Katz)
* abc8634 Build: re-run browserify when generating site (#9275) (Teddy Katz)
* 7685fed Fix: IIFE and arrow functions in no-invalid-this (fixes #9126) (#9258) (Toru Nagashima)
* 2b1eba2 Chore: enable eslint-plugin/no-deprecated-context-methods (#9279) (Teddy Katz)
* 981f933 Fix: reuse the AST of source code object in verify (#9256) (Toru Nagashima)
* cd698ba Docs: move RuleTester documentation to Node.js API page (#9273) (Teddy Katz)
* 4ae7ad3 Docs: fix inaccuracy in `npm run perf` description (#9274) (Teddy Katz)
* cad45bd Docs: improve documentation for rule contexts (#9272) (Teddy Katz)
* 3b0c6fd Chore: remove extraneous linter properties (refs #9161) (#9267) (Teddy Katz)
* c3231b3 Docs: Fix typo in array-bracket-newline.md (#9269) (宋文强)
* 51132d6 Fix: Formatters keep trailing '.' if preceded by a space (fixes #9154) (#9247) (i-ron-y)
* 88d5d4d Chore: remove undocumented Linter#markVariableAsUsed method (refs #9161) (#9266) (Teddy Katz)
* 09414cf Chore: remove internal Linter#getDeclaredVariables method (refs #9161) (#9264) (Teddy Katz)
* f31f59d Chore: prefer smaller scope for variables in codebase (#9265) (Teddy Katz)
* 3693e4e Chore: remove undocumented Linter#getScope method (#9253) (Teddy Katz)
* 5d7eb81 Chore: refactor config hash caching in CLIEngine (#9260) (Teddy Katz)
* 1a76c4d Chore: remove SourceCode passthroughs from Linter.prototype (refs #9161) (#9263) (Teddy Katz)
* 40ae27b Chore: avoid relying on Linter#getScope/markVariableAsUsed in tests (#9252) (Teddy Katz)
* b383d81 Chore: make executeOnFile a pure function in CLIEngine (#9262) (Teddy Katz)
* 5e0e579 Chore: avoid internal SourceCode methods in Linter tests (refs #9161) (#9223) (Teddy Katz)
* adab827 Chore: remove unused eslint-disable comment (#9251) (Teddy Katz)
* 31e4ec8 Chore: use consistent names for apply-disable-directives in tests (#9246) (Teddy Katz)
* 7ba46e6 Fix: shebang error in eslint-disable-new-line; add tests (fixes #9238) (#9240) (i-ron-y)
* 8f6546c Chore: remove undocumented defaults() method (refs #9161) (#9237) (Teddy Katz)
* 82d8b73 Docs: Fix error in example code for sort-imports (fixes #8734) (#9245) (i-ron-y)
* a32ec36 Update: refactor eslint-disable comment processing (#9216) (Teddy Katz)
* 583f0b8 Chore: avoid using globals in CLIEngine tests (#9242) (Teddy Katz)
* c8bf687 Chore: upgrade eslint-plugin-eslint-plugin@1.0.0 (#9234) (薛定谔的猫)
* 3c41a05 Chore: always normalize rules to new API in rules.js (#9236) (Teddy Katz)
* c5f4227 Chore: move logic for handling missing rules to rules.js (#9235) (Teddy Katz)
* bf1e344 Chore: create report translators lazily (#9221) (Teddy Katz)
* 2eedc1f Chore: remove currentFilename prop from Linter instances (refs #9161) (#9219) (Teddy Katz)
* 5566e94 Docs: Replace misleading CLA links (#9133) (#9232) (i-ron-y)
* c991630 Chore: remove ConfigOps.normalize in favor of ConfigOps.getRuleSeverity (#9224) (Teddy Katz)
* 171962a Chore: remove internal Linter#getAncestors helper (refs #9161) (#9222) (Teddy Katz)
* a567499 Chore: avoid storing list of problems on Linter instance (refs #9161) (#9214) (Teddy Katz)
* ed6d088 Chore: avoid relying on undocumented Linter#getFilename API in tests (#9218) (Teddy Katz)

v4.6.1 - September 3, 2017

* bdec46d Build: avoid process leak when generating website (#9217) (Teddy Katz)
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Expand Up @@ -10,16 +10,16 @@ This project adheres to the [JS Foundation Code of Conduct](https://js.foundatio

Before filing an issue, please be sure to read the guidelines for what you're reporting:

* [Bug Report](http://eslint.org/docs/developer-guide/contributing/reporting-bugs)
* [Propose a New Rule](http://eslint.org/docs/developer-guide/contributing/new-rules)
* [Proposing a Rule Change](http://eslint.org/docs/developer-guide/contributing/rule-changes)
* [Request a Change](http://eslint.org/docs/developer-guide/contributing/changes)
* [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs)
* [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules)
* [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes)
* [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes)

## Contributing Code

Please sign our [Contributor License Agreement](https://cla.js.foundation/eslint/eslint) and read over the [Pull Request Guidelines](http://eslint.org/docs/developer-guide/contributing/pull-requests).
Please sign our [Contributor License Agreement](https://cla.js.foundation/eslint/eslint) and read over the [Pull Request Guidelines](https://eslint.org/docs/developer-guide/contributing/pull-requests).

## Full Documentation

Our full contribution guidelines can be found at:
http://eslint.org/docs/developer-guide/contributing/
https://eslint.org/docs/developer-guide/contributing/
2 changes: 1 addition & 1 deletion Makefile.js
Expand Up @@ -73,7 +73,7 @@ const NODE = "node ", // intentional extra space

// Utilities - intentional extra space at the end of each string
MOCHA = `${NODE_MODULES}mocha/bin/_mocha `,
ESLINT = `${NODE} bin/eslint.js `,
ESLINT = `${NODE} bin/eslint.js --report-unused-disable-directives `,

// Files
MAKEFILE = "./Makefile.js",
Expand Down
37 changes: 19 additions & 18 deletions README.md
Expand Up @@ -9,11 +9,11 @@

# ESLint

[Website](http://eslint.org) |
[Configuring](http://eslint.org/docs/user-guide/configuring) |
[Rules](http://eslint.org/docs/rules/) |
[Contributing](http://eslint.org/docs/developer-guide/contributing) |
[Reporting Bugs](http://eslint.org/docs/developer-guide/contributing/reporting-bugs) |
[Website](https://eslint.org) |
[Configuring](https://eslint.org/docs/user-guide/configuring) |
[Rules](https://eslint.org/docs/rules/) |
[Contributing](https://eslint.org/docs/developer-guide/contributing) |
[Reporting Bugs](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) |
[Code of Conduct](https://js.foundation/community/code-of-conduct) |
[Twitter](https://twitter.com/geteslint) |
[Mailing List](https://groups.google.com/group/eslint) |
Expand All @@ -27,6 +27,8 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J

## Installation and Usage

Prerequisites: [Node.js](https://nodejs.org/en/) (>=4.x), npm version 2+.

There are two ways to install ESLint: globally and locally.

### Local Installation and Usage
Expand Down Expand Up @@ -88,17 +90,17 @@ After running `eslint --init`, you'll have a `.eslintrc` file in your directory.
}
```

The names `"semi"` and `"quotes"` are the names of [rules](http://eslint.org/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values:
The names `"semi"` and `"quotes"` are the names of [rules](https://eslint.org/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values:

* `"off"` or `0` - turn the rule off
* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
* `"error"` or `2` - turn the rule on as an error (exit code will be 1)

The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](http://eslint.org/docs/user-guide/configuring)).
The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/user-guide/configuring)).

## Sponsors

* Site search ([eslint.org](http://eslint.org)) is sponsored by [Algolia](https://www.algolia.com)
* Site search ([eslint.org](https://eslint.org)) is sponsored by [Algolia](https://www.algolia.com)

## Team

Expand Down Expand Up @@ -145,10 +147,10 @@ ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/comm

Before filing an issue, please be sure to read the guidelines for what you're reporting:

* [Bug Report](http://eslint.org/docs/developer-guide/contributing/reporting-bugs)
* [Propose a New Rule](http://eslint.org/docs/developer-guide/contributing/new-rules)
* [Proposing a Rule Change](http://eslint.org/docs/developer-guide/contributing/rule-changes)
* [Request a Change](http://eslint.org/docs/developer-guide/contributing/changes)
* [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs)
* [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules)
* [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes)
* [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes)

## Semantic Versioning Policy

Expand All @@ -171,7 +173,6 @@ ESLint follows [semantic versioning](http://semver.org). However, due to the nat
* Major release (likely to break your lint build)
* `eslint:recommended` is updated.
* A new option to an existing rule that results in ESLint reporting more errors by default.
* An existing rule is removed.
* An existing formatter is removed.
* Part of the public API is removed or changed in an incompatible way.

Expand All @@ -195,11 +196,11 @@ Despite being slower, we believe that ESLint is fast enough to replace JSHint wi

### I heard ESLint is going to replace JSCS?

Yes. Since we are solving the same problems, ESLint and JSCS teams have decided to join forces and work together in the development of ESLint instead of competing with each other. You can read more about this in both [ESLint](http://eslint.org/blog/2016/04/welcoming-jscs-to-eslint) and [JSCS](https://medium.com/@markelog/jscs-end-of-the-line-bc9bf0b3fdb2#.u76sx334n) announcements.
Yes. Since we are solving the same problems, ESLint and JSCS teams have decided to join forces and work together in the development of ESLint instead of competing with each other. You can read more about this in both [ESLint](https://eslint.org/blog/2016/04/welcoming-jscs-to-eslint) and [JSCS](https://medium.com/@markelog/jscs-end-of-the-line-bc9bf0b3fdb2#.u76sx334n) announcements.

### So, should I stop using JSCS and start using ESLint?

Maybe, depending on how much you need it. [JSCS has reached end of life](http://eslint.org/blog/2016/07/jscs-end-of-life), but if it is working for you then there is no reason to move yet. We are still working to smooth the transition. You can see our progress [here](https://github.com/eslint/eslint/milestones/JSCS%20Compatibility). We’ll announce when all of the changes necessary to support JSCS users in ESLint are complete and will start encouraging JSCS users to switch to ESLint at that time.
Maybe, depending on how much you need it. [JSCS has reached end of life](https://eslint.org/blog/2016/07/jscs-end-of-life), but if it is working for you then there is no reason to move yet. We are still working to smooth the transition. You can see our progress [here](https://github.com/eslint/eslint/milestones/JSCS%20Compatibility). We’ll announce when all of the changes necessary to support JSCS users in ESLint are complete and will start encouraging JSCS users to switch to ESLint at that time.

If you are having issues with JSCS, you can try to move to ESLint. We are focusing our time and energy on JSCS compatibility issues.

Expand All @@ -210,17 +211,17 @@ ESLint does both traditional linting (looking for problematic patterns) and styl

### Does ESLint support JSX?

Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](http://eslint.org/docs/user-guide/configuring).). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.
Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/user-guide/configuring).). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.

### What about ECMAScript 6 support?

ESLint has full support for ECMAScript 6. By default, this support is off. You can enable ECMAScript 6 syntax and global variables through [configuration](http://eslint.org/docs/user-guide/configuring).
ESLint has full support for ECMAScript 6. By default, this support is off. You can enable ECMAScript 6 syntax and global variables through [configuration](https://eslint.org/docs/user-guide/configuring).

### What about experimental features?

ESLint doesn't natively support experimental ECMAScript language features. You can use [babel-eslint](https://github.com/babel/babel-eslint) to use any option available in Babel.

Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](http://eslint.org/docs/developer-guide/contributing). Until then, please use the appropriate parser and plugin(s) for your experimental feature.
Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/developer-guide/contributing). Until then, please use the appropriate parser and plugin(s) for your experimental feature.

### Where to ask for help?

Expand Down
3 changes: 2 additions & 1 deletion conf/default-cli-options.js
Expand Up @@ -23,5 +23,6 @@ module.exports = {
cacheLocation: "",
cacheFile: ".eslintcache",
fix: false,
allowInlineConfig: true
allowInlineConfig: true,
reportUnusedDisableDirectives: false
};
1 change: 1 addition & 0 deletions conf/eslint-recommended.js
Expand Up @@ -63,6 +63,7 @@ module.exports = {
"linebreak-style": "off",
"lines-around-comment": "off",
"lines-around-directive": "off",
"lines-between-class-members": "off",
"max-depth": "off",
"max-len": "off",
"max-lines": "off",
Expand Down
5 changes: 4 additions & 1 deletion docs/developer-guide/architecture.md
Expand Up @@ -4,7 +4,10 @@ At a high level, there are a few key parts to ESLint:

* `bin/eslint.js` - this is the file that actually gets executed with the command line utility. It's a dumb wrapper that does nothing more than bootstrap ESLint, passing the command line arguments to `cli`. This is intentionally small so as not to require heavy testing.
* `lib/cli.js` - this is the heart of the ESLint CLI. It takes an array of arguments and then uses `eslint` to execute the commands. By keeping this as a separate utility, it allows others to effectively call ESLint from within another Node.js program as if it were done on the command line. The main call is `cli.execute()`. This is also the part that does all the file reading, directory traversing, input, and output.
* `lib/eslint.js` - this is the core `eslint` object that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly.
* `lib/linter.js` - this is the core Linter class that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly.
* `lib/api.js` - this exposes an object that contains Linter, CLIEngine, RuleTester, and SourceCode.
* `lib/testers/rule-tester.js` - this is a wrapper around Mocha, so that rules can be unit tested. This class lets us write consistently formatted tests for each rule that is implemented and be confident that each of the rules work. The RuleTester interface was modeled after Mocha and works with Mocha's global testing methods. RuleTester can also be modified to work with other testing frameworks.
* `lib/util/source-code.js` - this contains a SourceCode class that is used to represent the parsed source code. It takes in source code and the Program node of the AST representing the code.

## The `cli` object

Expand Down

0 comments on commit 27bd80d

Please sign in to comment.