Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: eslint/eslint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 031a35614f9353b57c072ba14aff16f930ab6520
Choose a base ref
...
head repository: eslint/eslint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a7985a6a6ba3d800194f20faf94f5efb9282a360
Choose a head ref
Loading
Showing 1,299 changed files with 185,637 additions and 50,400 deletions.
37 changes: 37 additions & 0 deletions .azure-pipelines/job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
parameters:
name: ""
displayName: ""
vmImage: ""
nodeVersion: ""

jobs:
- job: ${{parameters.name}}
displayName: ${{parameters.displayName}}
pool:
vmImage: ${{parameters.vmImage}}
steps:
- task: NodeTool@0
displayName: Install Node.js
inputs:
versionSpec: ${{parameters.nodeVersion}}

- script: npm install
displayName: Install Packages

- script: npm test
displayName: Test

- task: PublishTestResults@2
displayName: Process Test Results
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: $(System.DefaultWorkingDirectory)/test-results.xml

- task: PublishCodeCoverageResults@1
displayName: Process Coverage Results
condition: succeededOrFailed()
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)/coverage
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/bin/**
/build/**
/coverage/**
/docs/**
@@ -8,4 +7,6 @@
/tests/fixtures/**
/tests/performance/**
/tmp/**
/lib/rules/utils/unicode/is-combining-character.js
test.js
!.eslintrc.js
187 changes: 187 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
"use strict";

const internalFiles = [
"**/cli-engine/**/*",
"**/init/**/*",
"**/linter/**/*",
"**/rule-tester/**/*",
"**/rules/**/*",
"**/source-code/**/*"
];

module.exports = {
root: true,
plugins: [
"eslint-plugin",
"internal-rules"
],
extends: [
"eslint",
"plugin:eslint-plugin/recommended"
],
rules: {
"eslint-plugin/consistent-output": "error",
"eslint-plugin/no-deprecated-context-methods": "error",
"eslint-plugin/prefer-output-null": "error",
"eslint-plugin/prefer-placeholders": "error",
"eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
"eslint-plugin/require-meta-type": "error",
"eslint-plugin/test-case-property-ordering": [
"error",

// https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/79
[
"filename",
"code",
"output",
"options",
"parser",
"parserOptions",
"globals",
"env",
"errors"
]
],
"eslint-plugin/test-case-shorthand-strings": "error",
"internal-rules/multiline-comment-style": "error"
},
overrides: [
{
files: ["lib/rules/*", "tools/internal-rules/*"],
excludedFiles: ["index.js"],
rules: {
"internal-rules/no-invalid-meta": "error",
"internal-rules/consistent-docs-description": "error"

/*
* TODO: enable it when all the rules using meta.messages
* "internal-rules/consistent-meta-messages": "error"
*/
}
},
{
files: ["lib/rules/*"],
excludedFiles: ["index.js"],
rules: {
"internal-rules/consistent-docs-url": "error"
}
},
{
files: ["tests/**/*"],
env: { mocha: true },
rules: {
"no-restricted-syntax": ["error", {
selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']",
message: "`assert.doesNotThrow()` should be replaced with a comment next to the code."
}]
}
},

// Restrict relative path imports
{
files: ["lib/*"],
rules: {
"no-restricted-modules": ["error", {
patterns: [
...internalFiles
]
}]
}
},
{
files: ["lib/cli-engine/**/*"],
rules: {
"no-restricted-modules": ["error", {
patterns: [
...internalFiles,
"**/init"
]
}]
}
},
{
files: ["lib/init/**/*"],
rules: {
"no-restricted-modules": ["error", {
patterns: [
...internalFiles,
"**/rule-tester"
]
}]
}
},
{
files: ["lib/linter/**/*"],
rules: {
"no-restricted-modules": ["error", {
patterns: [
...internalFiles,
"fs",
"**/cli-engine",
"**/init",
"**/rule-tester"
]
}]
}
},
{
files: ["lib/rules/**/*"],
rules: {
"no-restricted-modules": ["error", {
patterns: [
...internalFiles,
"fs",
"**/cli-engine",
"**/init",
"**/linter",
"**/rule-tester",
"**/source-code"
]
}]
}
},
{
files: ["lib/shared/**/*"],
rules: {
"no-restricted-modules": ["error", {
patterns: [
...internalFiles,
"**/cli-engine",
"**/init",
"**/linter",
"**/rule-tester",
"**/source-code"
]
}]
}
},
{
files: ["lib/source-code/**/*"],
rules: {
"no-restricted-modules": ["error", {
patterns: [
...internalFiles,
"fs",
"**/cli-engine",
"**/init",
"**/linter",
"**/rule-tester",
"**/rules"
]
}]
}
},
{
files: ["lib/rule-tester/**/*"],
rules: {
"no-restricted-modules": ["error", {
patterns: [
...internalFiles,
"**/cli-engine",
"**/init"
]
}]
}
}
]
};
7 changes: 0 additions & 7 deletions .eslintrc.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Convert text file line endings to lf
* text=auto

*.js text
*.js text eol=lf

# The test fixtures are text files.
/tests/fixtures/**/* text eol=lf
/tests/fixtures/ignored-paths/crlf/.eslintignore text eol=crlf
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open_collective: eslint
41 changes: 34 additions & 7 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,47 @@
<!--
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:
ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct).
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
3. If you have any questions, please stop by our chatroom: https://gitter.im/eslint/eslint
This template is for bug reports. If you are here for another reason, please see below:
Note that leaving sections blank will make it difficult for us to troubleshoot and we may have to close the issue.
1. To propose a new rule: https://eslint.org/docs/developer-guide/contributing/new-rules
2. To request a rule change: https://eslint.org/docs/developer-guide/contributing/rule-changes
3. To request a change that is not a bug fix, rule change, or new rule: https://eslint.org/docs/developer-guide/contributing/changes
4. 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.
-->

**What version of ESLint are you using?**
**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.**
<details>
<summary>Configuration</summary>

<!-- Paste your configuration below: -->
```js

```

</details>

**What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.**

<!-- Paste the source code below: -->
```js

```

<!-- Paste the command you used to run ESLint: -->
```bash

```

**What did you expect to happen?**

61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: "\U0001F41E Bug report"
about: Report an issue with ESLint or rules bundled with ESLint
title: ''
labels: bug, triage
assignees: ''

---

<!--
ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct).
This template is for bug reports. If you are here for another reason, please see below:
1. To propose a new rule: https://eslint.org/docs/developer-guide/contributing/new-rules
2. To request a rule change: https://eslint.org/docs/developer-guide/contributing/rule-changes
3. To request a change that is not a bug fix, rule change, or new rule: https://eslint.org/docs/developer-guide/contributing/changes
4. 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.
-->

**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:**

<details>
<summary>Configuration</summary>

<!-- Paste your configuration below: -->
```js

```

</details>

**What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.**

<!-- Paste the source code below: -->
```js

```

<!-- Paste the command you used to run ESLint: -->
```bash

```

**What did you expect to happen?**


**What actually happened? Please include the actual, raw output from ESLint.**


**Are you willing to submit a pull request to fix this bug?**
Loading