Skip to content

Commit

Permalink
Merge branch 'eslint:main' into prefer-named-capture-group-suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Nov 12, 2022
2 parents 4e1438e + a01315a commit ea45df1
Show file tree
Hide file tree
Showing 1,138 changed files with 53,892 additions and 12,205 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions .eslintignore
@@ -1,6 +1,7 @@
/build/**
/coverage/**
/docs/**
!/docs/.eleventy.js
/jsdoc/**
/templates/**
/tests/bench/**
Expand Down
89 changes: 54 additions & 35 deletions .eslintrc.js
@@ -1,10 +1,26 @@
/*
* IMPORTANT!
*
* Any changes made to this file must also be made to eslint.config.js.
*
* Internally, ESLint is using the eslint.config.js file to lint itself.
* This file is needed too, because:
*
* 1. There are tests that expect .eslintrc.js to be present to actually run.
* 2. ESLint VS Code extension expects eslintrc config files to be
* present to work correctly.
*
* Once we no longer need to support both eslintrc and flat config, we will
* remove this file.
*/


"use strict";

const path = require("path");

const INTERNAL_FILES = {
CLI_ENGINE_PATTERN: "lib/cli-engine/**/*",
INIT_PATTERN: "lib/init/**/*",
LINTER_PATTERN: "lib/linter/**/*",
RULE_TESTER_PATTERN: "lib/rule-tester/**/*",
RULES_PATTERN: "lib/rules/**/*",
Expand Down Expand Up @@ -47,8 +63,7 @@ module.exports = {
"internal-rules"
],
extends: [
"eslint",
"plugin:eslint-plugin/recommended"
"eslint"
],
parserOptions: {
ecmaVersion: 2021
Expand All @@ -64,21 +79,29 @@ module.exports = {
}
},
rules: {
"eslint-plugin/prefer-message-ids": "error",
"eslint-plugin/prefer-output-null": "error",
"eslint-plugin/prefer-placeholders": "error",
"eslint-plugin/prefer-replace-text": "error",
"eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
"eslint-plugin/require-meta-docs-description": "error",
"eslint-plugin/test-case-property-ordering": "error",
"eslint-plugin/test-case-shorthand-strings": "error",
"internal-rules/multiline-comment-style": "error"
},
overrides: [
{
files: ["tools/*.js"],
rules: {
"no-console": "off"
}
},
{
files: ["lib/rules/*", "tools/internal-rules/*"],
excludedFiles: ["index.js"],
extends: [
"plugin:eslint-plugin/rules-recommended"
],
rules: {
"eslint-plugin/no-missing-message-ids": "error",
"eslint-plugin/no-unused-message-ids": "error",
"eslint-plugin/prefer-message-ids": "error",
"eslint-plugin/prefer-placeholders": "error",
"eslint-plugin/prefer-replace-text": "error",
"eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
"eslint-plugin/require-meta-docs-description": ["error", { pattern: "^(Enforce|Require|Disallow) .+[^. ]$" }],
"internal-rules/no-invalid-meta": "error"
}
},
Expand All @@ -89,6 +112,17 @@ module.exports = {
"eslint-plugin/require-meta-docs-url": ["error", { pattern: "https://eslint.org/docs/rules/{{name}}" }]
}
},
{
files: ["tests/lib/rules/*", "tests/tools/internal-rules/*"],
extends: [
"plugin:eslint-plugin/tests-recommended"
],
rules: {
"eslint-plugin/prefer-output-null": "error",
"eslint-plugin/test-case-property-ordering": "error",
"eslint-plugin/test-case-shorthand-strings": "error"
}
},
{
files: ["tests/**/*"],
env: { mocha: true },
Expand All @@ -105,49 +139,37 @@ module.exports = {
files: ["lib/*"],
excludedFiles: ["lib/unsupported-api.js"],
rules: {
"node/no-restricted-require": ["error", [
"n/no-restricted-require": ["error", [
...createInternalFilesPatterns()
]]
}
},
{
files: [INTERNAL_FILES.CLI_ENGINE_PATTERN],
rules: {
"node/no-restricted-require": ["error", [
...createInternalFilesPatterns(INTERNAL_FILES.CLI_ENGINE_PATTERN),
resolveAbsolutePath("lib/init/index.js")
]]
}
},
{
files: [INTERNAL_FILES.INIT_PATTERN],
rules: {
"node/no-restricted-require": ["error", [
...createInternalFilesPatterns(INTERNAL_FILES.INIT_PATTERN),
resolveAbsolutePath("lib/rule-tester/index.js")
"n/no-restricted-require": ["error", [
...createInternalFilesPatterns(INTERNAL_FILES.CLI_ENGINE_PATTERN)
]]
}
},
{
files: [INTERNAL_FILES.LINTER_PATTERN],
rules: {
"node/no-restricted-require": ["error", [
"n/no-restricted-require": ["error", [
...createInternalFilesPatterns(INTERNAL_FILES.LINTER_PATTERN),
"fs",
resolveAbsolutePath("lib/cli-engine/index.js"),
resolveAbsolutePath("lib/init/index.js"),
resolveAbsolutePath("lib/rule-tester/index.js")
]]
}
},
{
files: [INTERNAL_FILES.RULES_PATTERN],
rules: {
"node/no-restricted-require": ["error", [
"n/no-restricted-require": ["error", [
...createInternalFilesPatterns(INTERNAL_FILES.RULES_PATTERN),
"fs",
resolveAbsolutePath("lib/cli-engine/index.js"),
resolveAbsolutePath("lib/init/index.js"),
resolveAbsolutePath("lib/linter/index.js"),
resolveAbsolutePath("lib/rule-tester/index.js"),
resolveAbsolutePath("lib/source-code/index.js")
Expand All @@ -157,10 +179,9 @@ module.exports = {
{
files: ["lib/shared/**/*"],
rules: {
"node/no-restricted-require": ["error", [
"n/no-restricted-require": ["error", [
...createInternalFilesPatterns(),
resolveAbsolutePath("lib/cli-engine/index.js"),
resolveAbsolutePath("lib/init/index.js"),
resolveAbsolutePath("lib/linter/index.js"),
resolveAbsolutePath("lib/rule-tester/index.js"),
resolveAbsolutePath("lib/source-code/index.js")
Expand All @@ -170,11 +191,10 @@ module.exports = {
{
files: [INTERNAL_FILES.SOURCE_CODE_PATTERN],
rules: {
"node/no-restricted-require": ["error", [
"n/no-restricted-require": ["error", [
...createInternalFilesPatterns(INTERNAL_FILES.SOURCE_CODE_PATTERN),
"fs",
resolveAbsolutePath("lib/cli-engine/index.js"),
resolveAbsolutePath("lib/init/index.js"),
resolveAbsolutePath("lib/linter/index.js"),
resolveAbsolutePath("lib/rule-tester/index.js"),
resolveAbsolutePath("lib/rules/index.js")
Expand All @@ -184,10 +204,9 @@ module.exports = {
{
files: [INTERNAL_FILES.RULE_TESTER_PATTERN],
rules: {
"node/no-restricted-require": ["error", [
"n/no-restricted-require": ["error", [
...createInternalFilesPatterns(INTERNAL_FILES.RULE_TESTER_PATTERN),
resolveAbsolutePath("lib/cli-engine/index.js"),
resolveAbsolutePath("lib/init/index.js")
resolveAbsolutePath("lib/cli-engine/index.js")
]]
}
}
Expand Down
17 changes: 0 additions & 17 deletions .github/CODEOWNERS.md

This file was deleted.

53 changes: 0 additions & 53 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Expand Up @@ -39,7 +39,7 @@ body:
attributes:
label: What did you do?
description: |
Please include a *minimal* reproduction case with source code, configuration file, any other information about how you're using ESLint. You can use Markdown in this field.
Please include a *minimal* reproduction case. If possible, include a link to a reproduction of the problem in the [ESLint demo](https://eslint.org/demo). Otherwise, include source code, configuration file(s), and any other information about how you're using ESLint. You can use Markdown in this field.
value: |
<details>
<summary>Configuration</summary>
Expand Down
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Expand Up @@ -3,3 +3,6 @@ contact_links:
- name: 🗣 Ask a Question, Discuss
url: https://github.com/eslint/eslint/discussions
about: Get help using ESLint
- name: 📝 Help with VS Code ESLint
url: https://github.com/microsoft/vscode-eslint/issues/
about: Bugs and feature requests for the VS Code ESLint plugin
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
@@ -1,7 +1,7 @@
<!--
Thank you for contributing!
ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct).
ESLint adheres to the [JS Foundation Code of Conduct](https://eslint.org/conduct).
-->

#### Prerequisites checklist
Expand Down
8 changes: 8 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "ci"
31 changes: 21 additions & 10 deletions .github/workflows/ci.yml
@@ -1,17 +1,20 @@
name: CI
on:
push:
branches: [master, main]
branches: [main]
pull_request:
branches: [master, main]
branches: [main]

permissions:
contents: read

jobs:
verify_files:
name: Verify Files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install Packages
Expand All @@ -22,22 +25,30 @@ jobs:
run: node Makefile checkRuleFiles
- name: Check Licenses
run: node Makefile checkLicenses
- name: Install Docs Packages
working-directory: docs
run: npm install
- name: Stylelint Docs
working-directory: docs
run: npm run lint:scss
- name: Lint Docs JS Files
run: node Makefile lintDocsJS

test_on_node:
name: Test
strategy:
matrix:
os: [ubuntu-latest]
node: [17.x, 16.x, 14.x, 12.x, "12.22.0"]
node: [19.x, 18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
include:
- os: windows-latest
node: "16.x"
- os: macOS-latest
node: "16.x"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install Packages
Expand All @@ -51,10 +62,10 @@ jobs:
name: Browser Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12'
node-version: '16'
- name: Install Packages
run: npm install
- name: Test
Expand Down

0 comments on commit ea45df1

Please sign in to comment.