diff --git a/.github/ISSUE_TEMPLATE/CHANGE.md b/.github/ISSUE_TEMPLATE/CHANGE.md new file mode 100644 index 000000000000..b8181f56cfec --- /dev/null +++ b/.github/ISSUE_TEMPLATE/CHANGE.md @@ -0,0 +1,25 @@ + + +**Tell us about your environment** + +* **ESLint Version:** +* **Node Version:** +* **npm Version:** + +**What did you do?** + +**What happened?** + +**What did you expect to happen?** + diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md similarity index 72% rename from .github/ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md index d33ca110584c..d71ee1da0c5f 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md @@ -1,11 +1,12 @@ diff --git a/.github/ISSUE_TEMPLATE/NEW_RULE.md b/.github/ISSUE_TEMPLATE/NEW_RULE.md new file mode 100644 index 000000000000..91a034b02534 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/NEW_RULE.md @@ -0,0 +1,30 @@ + + +**Please describe what the rule should do:** + + +**What category of rule is this? (place an "X" next to just one item)** + +[ ] Enforces code style +[ ] Warns about a potential error +[ ] Suggests an alternate way of doing something +[ ] Other (please specify:) + +**Provide 2-3 code examples that this rule will warn about:** + +```js + +``` + +**Why should this rule be included in ESLint (instead of a plugin)?** diff --git a/.github/ISSUE_TEMPLATE/RULE_CHANGE.md b/.github/ISSUE_TEMPLATE/RULE_CHANGE.md new file mode 100644 index 000000000000..3ab52b8604dc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/RULE_CHANGE.md @@ -0,0 +1,32 @@ + + +**What rule do you want to change?** + + +**Does this change cause the rule to produce more or fewer warnings?** + + +**How will the change be implemented? (New option, new default behavior, etc.)?** + + +**Please provide some example code that this change will affect:** + +```js + +``` + +**What does the rule currently do for this code?** + + +**What will the rule do after it's changed?** diff --git a/docs/developer-guide/contributing/changes.md b/docs/developer-guide/contributing/changes.md index 957f1286edc0..6b5f1590107f 100644 --- a/docs/developer-guide/contributing/changes.md +++ b/docs/developer-guide/contributing/changes.md @@ -1,6 +1,6 @@ # Change Requests -If you'd like to request a change to ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new?body=**What%20version%20are%20you%20using%3F**%0A%0A**What%20did%20you%20do%3F**%0A%0A**What%20happened%3F**%0A%0A**What%20did%20you%20expect%20to%20happen%3F**%0A%0A) on GitHub. Be sure to include the following information: +If you'd like to request a change to ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new?template=CHANGE.md) on GitHub. Be sure to include the following information: 1. The version of ESLint you are using. 1. The problem you want to solve. diff --git a/docs/developer-guide/contributing/new-rules.md b/docs/developer-guide/contributing/new-rules.md index 072ca67004ec..81a7529d814b 100644 --- a/docs/developer-guide/contributing/new-rules.md +++ b/docs/developer-guide/contributing/new-rules.md @@ -19,7 +19,7 @@ Even though these are the formal criteria for inclusion, each rule is evaluated ## Proposing a Rule -If you want to propose a new rule, [create a pull request](/docs/developer-guide/contributing/pull-requests.md) or new issue and paste the questions from the [rule proposal template](https://github.com/eslint/eslint/blob/master/templates/rule-proposal.md) into the description. +If you want to propose a new rule, [create a pull request](/docs/developer-guide/contributing/pull-requests.md) or new issue and paste the questions from the [rule proposal template](https://github.com/eslint/eslint/issues/new?template=NEW_RULE.md) into the description. We need all of this information in order to determine whether or not the rule is a good core rule candidate. diff --git a/docs/developer-guide/contributing/reporting-bugs.md b/docs/developer-guide/contributing/reporting-bugs.md index bfd8660b22a6..81f5e8562e7e 100644 --- a/docs/developer-guide/contributing/reporting-bugs.md +++ b/docs/developer-guide/contributing/reporting-bugs.md @@ -1,6 +1,6 @@ # Reporting Bugs -If you think you've found a bug in ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new) or a [pull request](/docs/developer-guide/contributing/pull-requests.md) on GitHub. Be sure to copy the questions from the [bug report template](https://github.com/eslint/eslint/blob/master/templates/bug-report.md). +If you think you've found a bug in ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new) or a [pull request](/docs/developer-guide/contributing/pull-requests.md) on GitHub. Please include as much detail as possible to help us properly address your issue. If we need to triage issues and constantly ask people for more detail, that's time taken away from actually fixing issues. Help us be as efficient as possible by including a lot of detail in your issues. diff --git a/docs/developer-guide/contributing/rule-changes.md b/docs/developer-guide/contributing/rule-changes.md index 9973d784083c..cd3514b3710e 100644 --- a/docs/developer-guide/contributing/rule-changes.md +++ b/docs/developer-guide/contributing/rule-changes.md @@ -4,7 +4,7 @@ Occasionally, a core ESLint rule needs to be changed. This is not necessarily a ## Proposing a Rule Change -To propose a change to an existing rule, [create a new issue](https://github.com/eslint/eslint/issues/new) or a [pull request](/docs/developer-guide/contributing/pull-requests.md) on GitHub. Be sure to copy the questions from the [rule change proposal template](https://github.com/eslint/eslint/blob/master/templates/rule-change-proposal.md). +To propose a change to an existing rule, [create a new issue](https://github.com/eslint/eslint/issues/new?template=RULE_CHANGE.md) or a [pull request](/docs/developer-guide/contributing/pull-requests.md) on GitHub. Be sure to copy the questions from the [rule change proposal template](https://github.com/eslint/eslint/blob/master/templates/rule-change-proposal.md). We need all of this information in order to determine whether or not the change is a good candidate for inclusion. diff --git a/docs/developer-guide/working-with-rules.md b/docs/developer-guide/working-with-rules.md index f345f7cdc273..f23afb16bfb1 100644 --- a/docs/developer-guide/working-with-rules.md +++ b/docs/developer-guide/working-with-rules.md @@ -222,23 +222,26 @@ var foo = 2; // ^ error: Avoid using variables named 'foo' // In your tests: -var rule = require('../../../lib/rules/no-insecure-random'); -var RuleTester = require('eslint').RuleTester; +var rule = require("../../../lib/rules/my-rule"); +var RuleTester = require("eslint").RuleTester; var ruleTester = new RuleTester(); -ruleTester.run('my-rule', rule, { - valid: ['bar', 'baz'], +ruleTester.run("my-rule", rule, { + valid: ["bar", "baz"], - invalid: [ - { - code: 'foo', - errors: [ + invalid: [ { - messageId: 'foo', + code: "foo", + errors: [ + { + messageId: "avoidName", + data: { + name: "foo" + } + } + ] } - ] - } - ] + ] }); {% endraw %} ``` diff --git a/templates/bug-report.md b/templates/bug-report.md index eb64ba737477..9f374ab07a40 100644 --- a/templates/bug-report.md +++ b/templates/bug-report.md @@ -1,16 +1,16 @@ -**Tell us about your environment** - -* **ESLint Version:** -* **Node Version:** -* **npm Version:** - -**What parser (default, Babel-ESLint, etc.) are you using?** - -**Please show your full configuration:** - -**What did you do? Please include the actual source code causing the issue.** - -**What did you expect to happen?** - -**What actually happened? Please include the actual, raw output from ESLint.** +**Tell us about your environment** + +* **ESLint Version:** +* **Node Version:** +* **npm Version:** + +**What parser (default, Babel-ESLint, etc.) are you using?** + +**Please show your full configuration:** + +**What did you do? Please include the actual source code causing the issue.** + +**What did you expect to happen?** + +**What actually happened? Please include the actual, raw output from ESLint.** diff --git a/templates/rule-change-proposal.md b/templates/rule-change-proposal.md index 689e218a44c2..bc066a1e8cff 100644 --- a/templates/rule-change-proposal.md +++ b/templates/rule-change-proposal.md @@ -1,19 +1,20 @@ -**What rule do you want to change?** - - -**Does this change cause the rule to produce more or fewer warnings?** - - -**How will the change be implemented? (New option, new default behavior, etc.)?** - - -**Please provide some example code that this change will affect:** - -```js - -``` - -**What does the rule currently do for this code?** - - +**What rule do you want to change?** + + +**Does this change cause the rule to produce more or fewer warnings?** + + +**How will the change be implemented? (New option, new default behavior, etc.)?** + + +**Please provide some example code that this change will affect:** + +```js + +``` + +**What does the rule currently do for this code?** + + **What will the rule do after it's changed?** + diff --git a/templates/rule-proposal.md b/templates/rule-proposal.md index 9814d592362f..0f5021d6bd0e 100644 --- a/templates/rule-proposal.md +++ b/templates/rule-proposal.md @@ -1,17 +1,18 @@ -**Please describe what the rule should do:** - - -**What category of rule is this? (place an "X" next to just one item)** - -[ ] Enforces code style -[ ] Warns about a potential error -[ ] Suggests an alternate way of doing something -[ ] Other (please specify:) - -**Provide 2-3 code examples that this rule will warn about:** - -```js - -``` - +**Please describe what the rule should do:** + + +**What category of rule is this? (place an "X" next to just one item)** + +[ ] Enforces code style +[ ] Warns about a potential error +[ ] Suggests an alternate way of doing something +[ ] Other (please specify:) + +**Provide 2-3 code examples that this rule will warn about:** + +```js + +``` + **Why should this rule be included in ESLint (instead of a plugin)?** +