mirror of
https://git.proxmox.com/git/pve-eslint
synced 2025-10-04 04:25:55 +00:00
import 8.41.0 source
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
28ff354db0
commit
f2a92ac62f
2
Makefile
2
Makefile
@ -10,7 +10,7 @@ DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
|
|||||||
|
|
||||||
SRCDIR=src
|
SRCDIR=src
|
||||||
UPSTREAM=eslint
|
UPSTREAM=eslint
|
||||||
UPSTREAMTAG=v8.23.1
|
UPSTREAMTAG=v8.41.0
|
||||||
BUILDSRC=${UPSTREAM}-${UPSTREAMTAG}
|
BUILDSRC=${UPSTREAM}-${UPSTREAMTAG}
|
||||||
|
|
||||||
all: ${DEB}
|
all: ${DEB}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/build/**
|
/build/**
|
||||||
/coverage/**
|
/coverage/**
|
||||||
/docs/**
|
/docs/*
|
||||||
!/docs/.eleventy.js
|
!/docs/*.js
|
||||||
|
!/docs/tools/
|
||||||
/jsdoc/**
|
/jsdoc/**
|
||||||
/templates/**
|
/templates/**
|
||||||
/tests/bench/**
|
/tests/bench/**
|
||||||
|
@ -83,9 +83,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ["tools/*.js"],
|
files: ["tools/*.js", "docs/tools/*.js"],
|
||||||
rules: {
|
rules: {
|
||||||
"no-console": "off"
|
"no-console": "off",
|
||||||
|
"n/no-process-exit": "off"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -101,7 +102,7 @@ module.exports = {
|
|||||||
"eslint-plugin/prefer-placeholders": "error",
|
"eslint-plugin/prefer-placeholders": "error",
|
||||||
"eslint-plugin/prefer-replace-text": "error",
|
"eslint-plugin/prefer-replace-text": "error",
|
||||||
"eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
|
"eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
|
||||||
"eslint-plugin/require-meta-docs-description": ["error", { pattern: "^(Enforce|Require|Disallow)" }],
|
"eslint-plugin/require-meta-docs-description": ["error", { pattern: "^(Enforce|Require|Disallow) .+[^. ]$" }],
|
||||||
"internal-rules/no-invalid-meta": "error"
|
"internal-rules/no-invalid-meta": "error"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -109,7 +110,7 @@ module.exports = {
|
|||||||
files: ["lib/rules/*"],
|
files: ["lib/rules/*"],
|
||||||
excludedFiles: ["index.js"],
|
excludedFiles: ["index.js"],
|
||||||
rules: {
|
rules: {
|
||||||
"eslint-plugin/require-meta-docs-url": ["error", { pattern: "https://eslint.org/docs/rules/{{name}}" }]
|
"eslint-plugin/require-meta-docs-url": ["error", { pattern: "https://eslint.org/docs/latest/rules/{{name}}" }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
2
eslint/.github/CODEOWNERS
vendored
Normal file
2
eslint/.github/CODEOWNERS
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/docs/ @eslint/website-team @eslint/eslint-team
|
||||||
|
* @eslint/eslint-team
|
17
eslint/.github/CODEOWNERS.md
vendored
17
eslint/.github/CODEOWNERS.md
vendored
@ -1,17 +0,0 @@
|
|||||||
# Config-related files
|
|
||||||
|
|
||||||
lib/conf/config-schema.js @nzakas
|
|
||||||
lib/cli-engine/config-array/* @nzakas
|
|
||||||
lib/cli-engine/config-array-factory.js @nzakas
|
|
||||||
lib/cli-engine/cascading-config-array-factory.js @nzakas
|
|
||||||
lib/shared/config-* @nzakas
|
|
||||||
lib/shared/naming.js @nzakas
|
|
||||||
lib/shared/relative-module-resolver.js @nzakas
|
|
||||||
|
|
||||||
tests/lib/conf/config-schema.js @nzakas
|
|
||||||
tests/lib/cli-engine/config-array/* @nzakas
|
|
||||||
tests/lib/cli-engine/config-array-factory.js @nzakas
|
|
||||||
tests/lib/cli-engine/cascading-config-array-factory.js @nzakas
|
|
||||||
tests/lib/shared/config-* @nzakas
|
|
||||||
tests/lib/shared/naming.js @nzakas
|
|
||||||
tests/lib/shared/relative-module-resolver.js @nzakas
|
|
7
eslint/.github/ISSUE_TEMPLATE/bug-report.yml
vendored
7
eslint/.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@ -68,6 +68,13 @@ body:
|
|||||||
Please copy-paste the actual ESLint output. You can use Markdown in this field.
|
Please copy-paste the actual ESLint output. You can use Markdown in this field.
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Link to Minimal Reproducible Example
|
||||||
|
description: 'Link to a [playground](https://eslint.org/play), [StackBlitz](https://stackblitz.com), or GitHub repo with a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be auto-closed.'
|
||||||
|
placeholder: 'https://stackblitz.com/abcd1234'
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
attributes:
|
attributes:
|
||||||
label: Participation
|
label: Participation
|
||||||
|
1
eslint/.github/ISSUE_TEMPLATE/change.yml
vendored
1
eslint/.github/ISSUE_TEMPLATE/change.yml
vendored
@ -3,7 +3,6 @@ description: "Request a change that is not a bug fix, rule change, or new rule"
|
|||||||
title: "Change Request: (fill in)"
|
title: "Change Request: (fill in)"
|
||||||
labels:
|
labels:
|
||||||
- enhancement
|
- enhancement
|
||||||
- triage
|
|
||||||
- core
|
- core
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
|
6
eslint/.github/ISSUE_TEMPLATE/config.yml
vendored
6
eslint/.github/ISSUE_TEMPLATE/config.yml
vendored
@ -3,3 +3,9 @@ contact_links:
|
|||||||
- name: 🗣 Ask a Question, Discuss
|
- name: 🗣 Ask a Question, Discuss
|
||||||
url: https://github.com/eslint/eslint/discussions
|
url: https://github.com/eslint/eslint/discussions
|
||||||
about: Get help using ESLint
|
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
|
||||||
|
- name: Discord Server
|
||||||
|
url: https://eslint.org/chat
|
||||||
|
about: Talk with the team
|
||||||
|
2
eslint/.github/PULL_REQUEST_TEMPLATE.md
vendored
2
eslint/.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -31,7 +31,7 @@
|
|||||||
<!--
|
<!--
|
||||||
Please ensure your pull request is ready:
|
Please ensure your pull request is ready:
|
||||||
|
|
||||||
- Read the pull request guide (https://eslint.org/docs/developer-guide/contributing/pull-requests)
|
- Read the pull request guide (https://eslint.org/docs/latest/contribute/pull-requests)
|
||||||
- Include tests for this change
|
- Include tests for this change
|
||||||
- Update documentation for this change (if appropriate)
|
- Update documentation for this change (if appropriate)
|
||||||
-->
|
-->
|
||||||
|
2
eslint/.github/dependabot.yml
vendored
2
eslint/.github/dependabot.yml
vendored
@ -4,3 +4,5 @@ updates:
|
|||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
|
commit-message:
|
||||||
|
prefix: "ci"
|
||||||
|
18
eslint/.github/workflows/add-to-triage.yml
vendored
Normal file
18
eslint/.github/workflows/add-to-triage.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
name: Add to Triage
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
add-to-project:
|
||||||
|
name: Add issue to project
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/add-to-project@v0.5.0
|
||||||
|
with:
|
||||||
|
project-url: https://github.com/orgs/eslint/projects/3
|
||||||
|
github-token: ${{ secrets.PROJECT_BOT_TOKEN }}
|
||||||
|
labeled: "triage:no"
|
||||||
|
label-operator: NOT
|
17
eslint/.github/workflows/ci.yml
vendored
17
eslint/.github/workflows/ci.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: 'lts/*'
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: npm install
|
run: npm install
|
||||||
- name: Lint Files
|
- name: Lint Files
|
||||||
@ -28,20 +28,29 @@ jobs:
|
|||||||
- name: Install Docs Packages
|
- name: Install Docs Packages
|
||||||
working-directory: docs
|
working-directory: docs
|
||||||
run: npm install
|
run: npm install
|
||||||
|
- name: Stylelint Docs
|
||||||
|
working-directory: docs
|
||||||
|
run: npm run lint:scss
|
||||||
- name: Lint Docs JS Files
|
- name: Lint Docs JS Files
|
||||||
run: node Makefile lintDocsJS
|
run: node Makefile lintDocsJS
|
||||||
|
- name: Build Docs Website
|
||||||
|
working-directory: docs
|
||||||
|
run: npm run build
|
||||||
|
- name: Validate internal links
|
||||||
|
working-directory: docs
|
||||||
|
run: npm run lint:links
|
||||||
|
|
||||||
test_on_node:
|
test_on_node:
|
||||||
name: Test
|
name: Test
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
node: [18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
|
node: [20.x, 19.x, 18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
|
||||||
include:
|
include:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
node: "16.x"
|
node: "lts/*"
|
||||||
- os: macOS-latest
|
- os: macOS-latest
|
||||||
node: "16.x"
|
node: "lts/*"
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
10
eslint/.github/workflows/stale.yml
vendored
10
eslint/.github/workflows/stale.yml
vendored
@ -18,13 +18,15 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v5
|
- uses: actions/stale@v8
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
days-before-stale: 60
|
days-before-issue-stale: 30
|
||||||
|
days-before-pr-stale: 10
|
||||||
days-before-close: 7
|
days-before-close: 7
|
||||||
stale-issue-message: 'Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update.'
|
stale-issue-message: 'Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update.'
|
||||||
stale-pr-message: 'Oops! It looks like we lost track of this pull request. What do we want to do here? This pull request will auto-close in 7 days without an update.'
|
close-issue-message: 'This issue was auto-closed due to inactivity. While we wish we could keep responding to every issue, we unfortunately don''t have the bandwidth and need to focus on high-value issues.'
|
||||||
|
stale-pr-message: 'Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.'
|
||||||
|
close-pr-message: 'This pull request was auto-closed due to inactivity. While we wish we could keep working on every request, we unfortunately don''t have the bandwidth to continue here and need to focus on other things. You can resubmit this pull request if you would like to continue working on it.'
|
||||||
exempt-all-assignees: true
|
exempt-all-assignees: true
|
||||||
exempt-issue-labels: accepted
|
exempt-issue-labels: accepted
|
||||||
exempt-pr-labels: accepted
|
|
||||||
|
33
eslint/.github/workflows/update-readme.yml
vendored
Normal file
33
eslint/.github/workflows/update-readme.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: Data Fetch
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 8 * * *" # Every day at 1am PDT
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.WORKFLOW_PUSH_BOT_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
|
||||||
|
- name: Install npm packages
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Update README with latest team and sponsor data
|
||||||
|
run: npm run build:readme
|
||||||
|
|
||||||
|
- name: Setup Git
|
||||||
|
run: |
|
||||||
|
git config user.name "GitHub Actions Bot"
|
||||||
|
git config user.email "<eslint@googlegroups.com>"
|
||||||
|
|
||||||
|
- name: Save updated files
|
||||||
|
run: |
|
||||||
|
chmod +x ./tools/commit-readme.sh
|
||||||
|
./tools/commit-readme.sh
|
@ -1 +1,2 @@
|
|||||||
package-lock = false
|
package-lock = false
|
||||||
|
install-links = false
|
||||||
|
@ -1,3 +1,361 @@
|
|||||||
|
v8.41.0 - May 19, 2023
|
||||||
|
|
||||||
|
* [`f43216a`](https://github.com/eslint/eslint/commit/f43216a8c77ab6cf1d0823978e8c728786b4cba7) chore: upgrade @eslint/js@8.41.0 (#17200) (Milos Djermanovic)
|
||||||
|
* [`95c3007`](https://github.com/eslint/eslint/commit/95c300780a1cfd9ad680bc78850542eb55d7fbf4) chore: package.json update for @eslint/js release (ESLint Jenkins)
|
||||||
|
* [`4f5440d`](https://github.com/eslint/eslint/commit/4f5440db631707b17140c4e5cc7beb223afbd2b9) fix: incorrect warning message for ignored dotfiles (#17196) (Milos Djermanovic)
|
||||||
|
* [`ddc5291`](https://github.com/eslint/eslint/commit/ddc5291debd90ff476e17c532af7577e26720b91) chore: don't use deprecated `context` methods in `ast-utils` tests (#17194) (Milos Djermanovic)
|
||||||
|
* [`880a431`](https://github.com/eslint/eslint/commit/880a4317b949e575a4a6c5e8baaba1eea7674cc6) feat: change default ignore pattern to `**/node_modules/` in flat config (#17184) (Milos Djermanovic)
|
||||||
|
* [`94da96c`](https://github.com/eslint/eslint/commit/94da96cbf0fb2bb6694fa2e757eb1b3e74c40db7) fix: unify `LintMessage` type (#17076) (Brandon Mills)
|
||||||
|
* [`7709b14`](https://github.com/eslint/eslint/commit/7709b14e18ad4e11c1119ed6575454243b8e7084) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`8bf5505`](https://github.com/eslint/eslint/commit/8bf550594fca6d29fab1a3453e701c1a457767e1) feat: expose `shouldUseFlatConfig` (#17169) (Connor Prussin)
|
||||||
|
* [`7f183e0`](https://github.com/eslint/eslint/commit/7f183e020579380fa57473caaf9ed154470c25b3) docs: Update triage process description (#17157) (Nicholas C. Zakas)
|
||||||
|
* [`0c415cd`](https://github.com/eslint/eslint/commit/0c415cda5d76dbe5120ab9f3c4c81320538e35f0) fix: validate `ignorePatterns` constructor option in `FlatESLint` class (#17139) (Milos Djermanovic)
|
||||||
|
* [`b1516db`](https://github.com/eslint/eslint/commit/b1516db51514032ed06e1425c4b1f955238dc682) chore: Fix return type of `findFlatConfigFile` (#17161) (Milos Djermanovic)
|
||||||
|
* [`b68346b`](https://github.com/eslint/eslint/commit/b68346b290d55324e73868ca42b3854157b27375) docs: fix license to reflect relicensing of jshint (#17165) (Stefan Bischof)
|
||||||
|
* [`9682d66`](https://github.com/eslint/eslint/commit/9682d669e4ee8641293914e21679f40fee8bc354) fix: switch `grapheme-splitter` to `graphemer` (#17160) (fisker Cheung)
|
||||||
|
* [`918b0fd`](https://github.com/eslint/eslint/commit/918b0fd21723e84bd7acb17942a36606f1d8360a) perf: Store indent descriptors in a plain array (#17148) (Francesco Trotta)
|
||||||
|
* [`4caa344`](https://github.com/eslint/eslint/commit/4caa34449555d8a680222ec2049d97c59476c11e) refactor: locateConfigFileToUse returns an Error object (#17159) (唯然)
|
||||||
|
|
||||||
|
v8.40.0 - May 5, 2023
|
||||||
|
|
||||||
|
* [`4053004`](https://github.com/eslint/eslint/commit/4053004c951813473d1c43f9f9959a9a3484242f) chore: upgrade @eslint/js@8.40.0 (#17156) (Milos Djermanovic)
|
||||||
|
* [`50fed1d`](https://github.com/eslint/eslint/commit/50fed1da4449ad7ecbb558294438273cfce603d4) chore: package.json update for @eslint/js release (ESLint Jenkins)
|
||||||
|
* [`f076e54`](https://github.com/eslint/eslint/commit/f076e54ecdb0fae70d9b43ad6888606097beef97) fix: Ensure FlatESLint#findConfigFile() doesn't throw. (#17151) (Nicholas C. Zakas)
|
||||||
|
* [`4c7a170`](https://github.com/eslint/eslint/commit/4c7a170b04c5a746e401bef7ce79766ff66a1168) chore: upgrade @eslint/eslintrc@2.0.3 (#17155) (Milos Djermanovic)
|
||||||
|
* [`e80b7cc`](https://github.com/eslint/eslint/commit/e80b7cce640b60c00802148dbb51d03c7223afa9) chore: upgrade espree@9.5.2 (#17154) (Milos Djermanovic)
|
||||||
|
* [`ce3ac91`](https://github.com/eslint/eslint/commit/ce3ac91b510576e2afba1657aa5f09e162b4ab07) chore: upgrade eslint-visitor-keys@3.4.1 (#17153) (Milos Djermanovic)
|
||||||
|
* [`5db7808`](https://github.com/eslint/eslint/commit/5db7808139c1f2172797285a0700f01644bda254) feat: improve flat config errors for invalid rule options and severities (#17140) (Josh Goldberg ✨)
|
||||||
|
* [`f5574dc`](https://github.com/eslint/eslint/commit/f5574dc739fcc74a7841217ba1f31cce02bee1ff) feat: Add findConfigFile() method to FlatESLint (#17142) (Nicholas C. Zakas)
|
||||||
|
* [`e52b98b`](https://github.com/eslint/eslint/commit/e52b98bf25d882da4efd5559ce5974b6697cf701) feat: add `sourceCode` property to the rule context (#17107) (Nitin Kumar)
|
||||||
|
* [`e980bf3`](https://github.com/eslint/eslint/commit/e980bf38cf441f2eb29c458b93df77dc0111b391) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`9094d79`](https://github.com/eslint/eslint/commit/9094d79fb42c0ebb6100426a3f2f851e8d42a0ee) chore: add `latest/` to `meta.docs.url` in all core rules (#17136) (Milos Djermanovic)
|
||||||
|
* [`1468f5b`](https://github.com/eslint/eslint/commit/1468f5b640cfa6fdd8a5ec895337f692def2780b) feat: add `physicalFilename` property to the rule context (#17111) (Nitin Kumar)
|
||||||
|
* [`0df4d4f`](https://github.com/eslint/eslint/commit/0df4d4f658c214e51310a986c03d44d34ceae3ec) feat: add `cwd` to rule context (#17106) (Nitin Kumar)
|
||||||
|
* [`52018f2`](https://github.com/eslint/eslint/commit/52018f21c19b3e461cae32843cddd17ed42f19cd) feat: add `filename` property to the rule context (#17108) (Nitin Kumar)
|
||||||
|
* [`559ff4e`](https://github.com/eslint/eslint/commit/559ff4e4bc54a8b6e6b54825d83c532d724204b3) feat: add new `omitLastInOneLineClassBody` option to the `semi` rule (#17105) (Nitin Kumar)
|
||||||
|
* [`e92a6fc`](https://github.com/eslint/eslint/commit/e92a6fc7ed2a427f5e95f4b3a1c21d71553c97ee) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`d85efad`](https://github.com/eslint/eslint/commit/d85efad655deacc0dc3fdbbace33307094c3b91b) perf: don't use `grapheme-splitter` on ASCII strings in key-spacing rule (#17122) (Milos Djermanovic)
|
||||||
|
* [`af5fe64`](https://github.com/eslint/eslint/commit/af5fe64c398c9bd4206c3c6c1ade81768b291031) docs: Fix custom rule schema docs (#17115) (Adam Jones)
|
||||||
|
* [`4a352a9`](https://github.com/eslint/eslint/commit/4a352a957ba9e721bec9f6f403b419a22b0ec423) docs: explain how to include predefined globals (#17114) (Marcus Wyatt)
|
||||||
|
* [`5ea15d9`](https://github.com/eslint/eslint/commit/5ea15d92ee358e8f3f652c94c019cac96aaec651) docs: add mastodon link in readme (#17110) (唯然)
|
||||||
|
|
||||||
|
v8.39.0 - April 21, 2023
|
||||||
|
|
||||||
|
* [`60a6f26`](https://github.com/eslint/eslint/commit/60a6f2694deb4aa1c54de2a28d0357cddfd16644) chore: upgrade @eslint/js@8.39.0 (#17102) (Milos Djermanovic)
|
||||||
|
* [`d5ba5c0`](https://github.com/eslint/eslint/commit/d5ba5c0a85e7a10777761f5d46c104ab7f25845b) chore: package.json update for @eslint/js release (ESLint Jenkins)
|
||||||
|
* [`6987dc5`](https://github.com/eslint/eslint/commit/6987dc59e46f4e345d0d6c20c1f2c6846bbd7acc) docs: Fix formatting in Custom Rules docs (#17097) (Milos Djermanovic)
|
||||||
|
* [`4ee92e5`](https://github.com/eslint/eslint/commit/4ee92e5cbdeba6fea2147901ce926de16946958a) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`3f7af9f`](https://github.com/eslint/eslint/commit/3f7af9f408625dbc486af914706d34c4b483b5ba) feat: Implement `SourceCode#markVariableAsUsed()` (#17086) (Nicholas C. Zakas)
|
||||||
|
* [`d8e9887`](https://github.com/eslint/eslint/commit/d8e9887c2c384d24d586d08ee9ae2ada79bd234c) docs: Custom Rules cleanup/expansion (#16906) (Ben Perlmutter)
|
||||||
|
* [`f57eff2`](https://github.com/eslint/eslint/commit/f57eff20f5789408e95061f1af5354bb9b4f4784) ci: run tests on Node.js v20 (#17093) (Nitin Kumar)
|
||||||
|
* [`1fea279`](https://github.com/eslint/eslint/commit/1fea2797801a82a2718814c83dad641dab092bcc) docs: Clarify how to add to tsc agenda (#17084) (Nicholas C. Zakas)
|
||||||
|
* [`970ef1c`](https://github.com/eslint/eslint/commit/970ef1c868235a58297682513842f1256cdfbd03) docs: Update triage board location (Nicholas C. Zakas)
|
||||||
|
* [`9d1b8fc`](https://github.com/eslint/eslint/commit/9d1b8fc60cc31f12618e58c10a2669506b7ce9bf) perf: Binary search in token store `utils.search` (#17066) (Francesco Trotta)
|
||||||
|
* [`07a4435`](https://github.com/eslint/eslint/commit/07a4435a0c08cb63ebf11b71f735bac20318829b) chore: Add request for minimal repro to bug report (#17081) (Nicholas C. Zakas)
|
||||||
|
* [`eac4943`](https://github.com/eslint/eslint/commit/eac4943ba2e4edb3dbfea0470e5d4b15a4926c40) refactor: remove unnecessary use of `SourceCode#getAncestors` in rules (#17075) (Milos Djermanovic)
|
||||||
|
* [`6d8bffd`](https://github.com/eslint/eslint/commit/6d8bffdf45d50e272dc45e6d2d05b4a737514468) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`0a7b60a`](https://github.com/eslint/eslint/commit/0a7b60a9d5621dbbc1a8a8adda3b7c2060c779ca) chore: update description of `SourceCode#getDeclaredVariables` (#17072) (Milos Djermanovic)
|
||||||
|
* [`6e2df71`](https://github.com/eslint/eslint/commit/6e2df71cc390252aaca212abe3dc0467fe397450) chore: remove unnecessary references to the LICENSE file (#17071) (Milos Djermanovic)
|
||||||
|
|
||||||
|
v8.38.0 - April 7, 2023
|
||||||
|
|
||||||
|
* [`59ed060`](https://github.com/eslint/eslint/commit/59ed06041d4670781956221086ea0fca6683788d) chore: upgrade @eslint/js@8.38.0 (#17069) (Milos Djermanovic)
|
||||||
|
* [`88c0898`](https://github.com/eslint/eslint/commit/88c08984ec259ac22d839397c06beec8ef213120) chore: package.json update for @eslint/js release (ESLint Jenkins)
|
||||||
|
* [`7162d34`](https://github.com/eslint/eslint/commit/7162d34df9a66c817c3bd4aafd3a03d226b58dd5) docs: Mention new config system is complete (#17068) (Nicholas C. Zakas)
|
||||||
|
* [`a1d561d`](https://github.com/eslint/eslint/commit/a1d561d18ed653b56bddbfb1bab1ebe957293563) feat: Move getDeclaredVariables and getAncestors to SourceCode (#17059) (Nicholas C. Zakas)
|
||||||
|
* [`0fd6bb2`](https://github.com/eslint/eslint/commit/0fd6bb213ad2de77543c936eda21501653182e52) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`c83531c`](https://github.com/eslint/eslint/commit/c83531c1a6026675f36aa9e33fef14458043974a) docs: Update/remove external links, eg. point to `eslint-community` (#17061) (Pelle Wessman)
|
||||||
|
* [`cf682d2`](https://github.com/eslint/eslint/commit/cf682d249f04a6a304407d5b9ddbbc4a9714dd62) refactor: simplify new-parens rule schema (#17060) (MHO)
|
||||||
|
* [`a3aa6f5`](https://github.com/eslint/eslint/commit/a3aa6f5f146534ed7999ebf8930c524a4871ec0b) docs: Clarify `no-div-regex` rule docs (#17051) (Francesco Trotta)
|
||||||
|
* [`0dde022`](https://github.com/eslint/eslint/commit/0dde02211268394bcbc2b0beef55ea2409b6f55d) ci: bump actions/add-to-project from 0.4.1 to 0.5.0 (#17055) (dependabot[bot])
|
||||||
|
* [`b0f11cf`](https://github.com/eslint/eslint/commit/b0f11cf977a4180bf7c3042e7faeaaa067ffafd0) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`da8d52a`](https://github.com/eslint/eslint/commit/da8d52a9d4edd9b2016cd4a15cd78f1ddadf20c7) docs: Update the second object instance for the "no-new" rule (#17020) (Ahmadou Waly NDIAYE)
|
||||||
|
* [`518130a`](https://github.com/eslint/eslint/commit/518130ae79a16d7bf4d752c211ae88152cc5a6f0) docs: switch language based on current path (#16687) (Percy Ma)
|
||||||
|
* [`24206c4`](https://github.com/eslint/eslint/commit/24206c49a138d4390f815ae122ee12f564bc604b) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`1c1ece2`](https://github.com/eslint/eslint/commit/1c1ece26d1da61e523b83dda25353ec9379eb6c9) fix: do not report on `RegExp(...args)` in `require-unicode-regexp` (#17037) (Francesco Trotta)
|
||||||
|
|
||||||
|
v8.37.0 - March 28, 2023
|
||||||
|
|
||||||
|
* [`c67f299`](https://github.com/eslint/eslint/commit/c67f2992a743de4765bb6f11c12622e3651324b9) chore: upgrade @eslint/js@8.37.0 (#17033) (Milos Djermanovic)
|
||||||
|
* [`ee9ddbd`](https://github.com/eslint/eslint/commit/ee9ddbd63e262aed0052853760866c7a054af561) chore: package.json update for @eslint/js release (ESLint Jenkins)
|
||||||
|
* [`dddb475`](https://github.com/eslint/eslint/commit/dddb47528816cd7e2e737bfde108ed4d62e6a219) chore: upgrade @eslint/eslintrc@2.0.2 (#17032) (Milos Djermanovic)
|
||||||
|
* [`522431e`](https://github.com/eslint/eslint/commit/522431e5206bac2fcb41c0d6dc98a84929203bee) chore: upgrade espree@9.5.1 (#17031) (Milos Djermanovic)
|
||||||
|
* [`f5f9a88`](https://github.com/eslint/eslint/commit/f5f9a88c79b32222c0331a9bac1c02571d953b69) chore: upgrade eslint-visitor-keys@3.4.0 (#17030) (Milos Djermanovic)
|
||||||
|
* [`75339df`](https://github.com/eslint/eslint/commit/75339df99418df4d7e05a77e42ed7e22eabcc9e0) docs: fix typos and missing info in id-match docs (#17029) (Ed Lucas)
|
||||||
|
* [`b6ab8b2`](https://github.com/eslint/eslint/commit/b6ab8b2a2ca8807baca121407f5bfb0a0a839427) feat: `require-unicode-regexp` add suggestions (#17007) (Josh Goldberg)
|
||||||
|
* [`4dd8d52`](https://github.com/eslint/eslint/commit/4dd8d524e0fc9e8e2019df13f8b968021600e85c) ci: bump actions/stale from 7 to 8 (#17026) (dependabot[bot])
|
||||||
|
* [`619f3fd`](https://github.com/eslint/eslint/commit/619f3fd17324c7b71bf17e02047d0c6dc7e5109e) fix: correctly handle `null` default config in `RuleTester` (#17023) (Brad Zacher)
|
||||||
|
* [`ec2d830`](https://github.com/eslint/eslint/commit/ec2d8307850dd039e118c001416606e1e0342bc8) docs: Fix typos in the `semi` rule docs (#17012) (Andrii Lundiak)
|
||||||
|
* [`e39f28d`](https://github.com/eslint/eslint/commit/e39f28d8578a00f4da8d4ddad559547950128a0d) docs: add back to top button (#16979) (Tanuj Kanti)
|
||||||
|
* [`ad9dd6a`](https://github.com/eslint/eslint/commit/ad9dd6a933fd098a0d99c6a9aa059850535c23ee) chore: remove duplicate scss, (#17005) (Strek)
|
||||||
|
* [`10022b1`](https://github.com/eslint/eslint/commit/10022b1f4bda1ad89193512ecf18c2ee61db8202) feat: Copy getScope() to SourceCode (#17004) (Nicholas C. Zakas)
|
||||||
|
* [`1665c02`](https://github.com/eslint/eslint/commit/1665c029acb92bf8812267f1647ad1a7054cbcb4) feat: Use plugin metadata for flat config serialization (#16992) (Nicholas C. Zakas)
|
||||||
|
* [`b3634f6`](https://github.com/eslint/eslint/commit/b3634f695ddab6a82c0a9b1d8695e62b60d23366) feat: docs license (#17010) (Samuel Roldan)
|
||||||
|
* [`721c717`](https://github.com/eslint/eslint/commit/721c71782a7c11025689a1500e7690fb3794fcce) docs: Custom Processors cleanup and expansion (#16838) (Ben Perlmutter)
|
||||||
|
* [`1fbf118`](https://github.com/eslint/eslint/commit/1fbf1184fed57df02640aad4659afb54dc26a2e9) fix: `getFirstToken`/`getLastToken` on comment-only node (#16889) (Francesco Trotta)
|
||||||
|
* [`129e252`](https://github.com/eslint/eslint/commit/129e252132c7c476d7de17f40b54a333ddb2e6bb) fix: Fix typo in `logical-assignment-operators` rule description (#17000) (Francesco Trotta)
|
||||||
|
* [`892e6e5`](https://github.com/eslint/eslint/commit/892e6e58c5a07a549d3104de3b6b5879797dc97f) feat: languageOptions.parser must be an object. (#16985) (Nicholas C. Zakas)
|
||||||
|
* [`ada6a3e`](https://github.com/eslint/eslint/commit/ada6a3e6e3607523958f35e1260537630ec0e976) ci: unpin Node 19 (#16993) (Milos Djermanovic)
|
||||||
|
* [`c3da975`](https://github.com/eslint/eslint/commit/c3da975e69fde46f35338ce48528841a8dc1ffd2) chore: Remove triage label from template (#16990) (Nicholas C. Zakas)
|
||||||
|
* [`d049f97`](https://github.com/eslint/eslint/commit/d049f974103e530ef76ede25af701635caf1f405) docs: 'How ESLint is Maintained' page (#16961) (Ben Perlmutter)
|
||||||
|
* [`5251a92`](https://github.com/eslint/eslint/commit/5251a921866e8d3b380dfe8db8a6e6ab97773d5e) docs: Describe guard options for guard-for-in (#16986) (alope107)
|
||||||
|
* [`69bc0e2`](https://github.com/eslint/eslint/commit/69bc0e2f4412998f9384600a100d7882ea4dd3f3) ci: pin Node 19 to 19.7.0 (#16987) (Milos Djermanovic)
|
||||||
|
* [`6157d81`](https://github.com/eslint/eslint/commit/6157d813e19b80481a46f8cbdf9eae18a55e5619) docs: Add example to guard-for-in docs. (#16983) (alope107)
|
||||||
|
* [`fd47998`](https://github.com/eslint/eslint/commit/fd47998af6efadcdf5ba93e0bd1f4c02d97d22b3) docs: update `Array.prototype.toSorted` specification link (#16982) (Milos Djermanovic)
|
||||||
|
* [`3e1cf6b`](https://github.com/eslint/eslint/commit/3e1cf6bfc5ebc29314ddbe462d6cb580e9ab085c) docs: Copy edits on Maintain ESLint docs (#16939) (Ben Perlmutter)
|
||||||
|
|
||||||
|
v8.36.0 - March 10, 2023
|
||||||
|
|
||||||
|
* [`602b111`](https://github.com/eslint/eslint/commit/602b11121910a97ab2bc4a95a46dd0ccd0a89309) chore: upgrade @eslint/js@8.36.0 (#16978) (Milos Djermanovic)
|
||||||
|
* [`43c2345`](https://github.com/eslint/eslint/commit/43c2345c27024aeab6127e6bbfd55c8b70bd317e) chore: package.json update for @eslint/js release (ESLint Jenkins)
|
||||||
|
* [`00afb84`](https://github.com/eslint/eslint/commit/00afb84e5039874c8745a45c953fceaf0c71c454) chore: upgrade @eslint/eslintrc@2.0.1 (#16977) (Milos Djermanovic)
|
||||||
|
* [`698c5aa`](https://github.com/eslint/eslint/commit/698c5aad50e628ff00281dbc786e42de79834035) chore: upgrade espree@9.5.0 (#16976) (Milos Djermanovic)
|
||||||
|
* [`b98fdd4`](https://github.com/eslint/eslint/commit/b98fdd413a3b07b262bfce6f704c1c1bb8582770) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`c89a485`](https://github.com/eslint/eslint/commit/c89a485c49450532ee3db74f2638429f1f37d0dd) feat: Add `checkJSDoc` option to multiline-comment-style (#16807) (Laurent Cozic)
|
||||||
|
* [`f5f5e11`](https://github.com/eslint/eslint/commit/f5f5e11bd5fd3daab9ccae41e270739c836c305e) feat: Serialize parsers/processors in flat config (#16944) (Nicholas C. Zakas)
|
||||||
|
* [`caf08ce`](https://github.com/eslint/eslint/commit/caf08ce0cc74917f7c0eec92d25fd784dc33ac4d) docs: fix estree link in custom formatters docs (#16967) (Milos Djermanovic)
|
||||||
|
* [`75acdd2`](https://github.com/eslint/eslint/commit/75acdd21c5ce7024252e9d41ed77d2f30587caac) chore: lint more js files in docs (#16964) (Milos Djermanovic)
|
||||||
|
* [`3398431`](https://github.com/eslint/eslint/commit/3398431574b903757bc78b08c8ed36b7b9fce8eb) docs: Custom Parsers cleanup/expansion (#16887) (Ben Perlmutter)
|
||||||
|
* [`19d3531`](https://github.com/eslint/eslint/commit/19d3531d9b54e1004318d28f9a6e18305c5bcc18) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`4799297`](https://github.com/eslint/eslint/commit/4799297ea582c81fd1e5623d32a7ddf7a7f3a126) feat: use @eslint-community dependencies (#16784) (Michaël De Boey)
|
||||||
|
* [`b09a512`](https://github.com/eslint/eslint/commit/b09a512107249a4eb19ef5a37b0bd672266eafdb) docs: detect and fix broken links (#16837) (Nitin Kumar)
|
||||||
|
* [`92c1943`](https://github.com/eslint/eslint/commit/92c1943ba73ea01e87086236e8736539b0eed558) fix: correctly iterate files matched by glob patterns (#16831) (Nitin Kumar)
|
||||||
|
* [`89d9844`](https://github.com/eslint/eslint/commit/89d9844b3151f09b5b21b6eeeda671009ec301e9) ci: bump actions/add-to-project from 0.4.0 to 0.4.1 (#16943) (dependabot[bot])
|
||||||
|
|
||||||
|
v8.35.0 - February 26, 2023
|
||||||
|
|
||||||
|
* [`cdcbe12`](https://github.com/eslint/eslint/commit/cdcbe127de20cbcc4e24131a808c13b1024e61a2) chore: upgrade @eslint/js@8.35.0 (#16935) (Brandon Mills)
|
||||||
|
* [`c954c34`](https://github.com/eslint/eslint/commit/c954c349c0c2f88919614efc95e1368c245582fd) chore: package.json update for @eslint/js release (ESLint Jenkins)
|
||||||
|
* [`5a517da`](https://github.com/eslint/eslint/commit/5a517da8e55f6de28e9c028c5627fa7d82945969) chore: package.json update for @eslint/js release (ESLint Jenkins)
|
||||||
|
* [`9f10926`](https://github.com/eslint/eslint/commit/9f10926d76be7cf675721b29bd5030e85cb4ab30) chore: upgrade @eslint/eslintrc@2.0.0 (#16928) (Milos Djermanovic)
|
||||||
|
* [`8e34a04`](https://github.com/eslint/eslint/commit/8e34a04e3a4395bce59bc6acadf84281abc11d18) feat: add `afterHashbangComment` option to `lines-around-comment` rule (#16920) (SUZUKI Sosuke)
|
||||||
|
* [`c8c0c71`](https://github.com/eslint/eslint/commit/c8c0c715a2964cc1859b99f9d4f542675094d1d5) feat: Move all and recommended configs into package. (#16844) (Nicholas C. Zakas)
|
||||||
|
* [`f9f195e`](https://github.com/eslint/eslint/commit/f9f195ef12deb114fb86763010a23ea0cb4c78d1) docs: Plugin docs cleanup & expansion (#16862) (Ben Perlmutter)
|
||||||
|
* [`df809fd`](https://github.com/eslint/eslint/commit/df809fdedc5fc92df4be8340e28baedbde605b4f) docs: Custom Formatters page cleanup/expansion (#16886) (Ben Perlmutter)
|
||||||
|
* [`0700d1b`](https://github.com/eslint/eslint/commit/0700d1b14659bf39b1a08f082c44c9084cf676a8) docs: Add PostCSS/Autoprefixer/CSSNano (#16502) (Nick Schonning)
|
||||||
|
* [`da728fa`](https://github.com/eslint/eslint/commit/da728fae6c4e5fdda74195e84d45d67ad5cafc45) ci: use LTS node version in workflows (#16907) (Nitin Kumar)
|
||||||
|
* [`7b9e9bf`](https://github.com/eslint/eslint/commit/7b9e9bf78bedb009fe2813308ede1f46502c3890) docs: support unicode anchors (#16782) (Percy Ma)
|
||||||
|
* [`5fbc0bf`](https://github.com/eslint/eslint/commit/5fbc0bffdd9f84feb43296eb502d1e484fb323f2) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`c57b4f3`](https://github.com/eslint/eslint/commit/c57b4f3dc6383e452120381204ee4a7c874225a0) perf: upgrade to esquery@1.4.2 (#16901) (Milos Djermanovic)
|
||||||
|
* [`9698bc5`](https://github.com/eslint/eslint/commit/9698bc5cdec1bbee567a6a489da82e87fe65d019) fix: pin esquery v1.4.0 (fixes #16896) (#16897) (唯然)
|
||||||
|
* [`67865a0`](https://github.com/eslint/eslint/commit/67865a064cc1a4e320030299edc1cfdd1f9ac3b8) docs: Remove mention of mailing list (#16869) (Amaresh S M)
|
||||||
|
* [`43af24a`](https://github.com/eslint/eslint/commit/43af24a88b939a62880c37d1332b02f677d82f16) docs: Add explanation of when to use 'warn' severity (#16882) (Nicholas C. Zakas)
|
||||||
|
* [`71f6f0d`](https://github.com/eslint/eslint/commit/71f6f0dcd574320ee71c3eb1f313841899bdf260) feat: report more cases with `??` in no-constant-binary-expression (#16826) (Daiki Nishikawa)
|
||||||
|
* [`ed2999b`](https://github.com/eslint/eslint/commit/ed2999b38b4d61f5c278301738e294012d5d3c9e) docs: Shareable configs page edits and expansion (#16824) (Ben Perlmutter)
|
||||||
|
* [`2780635`](https://github.com/eslint/eslint/commit/27806358b5e1c4d37b63b1c61595e86ff03b5b42) docs: fix typos (#16884) (Lioness100)
|
||||||
|
* [`5bdaae2`](https://github.com/eslint/eslint/commit/5bdaae205c3a0089ea338b382df59e21d5b06436) docs: Ways to Extend ESLint page (#16861) (Ben Perlmutter)
|
||||||
|
* [`9122f07`](https://github.com/eslint/eslint/commit/9122f0764031dc36970df715bc5e16973890e18d) chore: Update stale bot settings (#16870) (Nicholas C. Zakas)
|
||||||
|
|
||||||
|
v8.34.0 - February 10, 2023
|
||||||
|
|
||||||
|
* [`f0a9883`](https://github.com/eslint/eslint/commit/f0a988384ea1a262150e70d83abd8a5e50c46fa7) docs: split rules documentation (#16797) (Ben Perlmutter)
|
||||||
|
* [`923f61d`](https://github.com/eslint/eslint/commit/923f61d8fc82d83b912c6ba95abb5a509c4d7b52) fix: false positive with assignment in `no-extra-parens` (#16872) (Francesco Trotta)
|
||||||
|
* [`9dbe06d`](https://github.com/eslint/eslint/commit/9dbe06d0ad875e6d5964497e2975e8d789e763d0) chore: add `type` property to array-element-newline schema (#16877) (MHO)
|
||||||
|
* [`a061527`](https://github.com/eslint/eslint/commit/a061527a0332f0edf559acfc2902a327cae098d9) chore: Remove unused functions (#16868) (Nicholas C. Zakas)
|
||||||
|
* [`67aa37b`](https://github.com/eslint/eslint/commit/67aa37b583f059226b9c959672400f04ed6a56b5) docs: fix typo in command-line-interface.md (#16871) (Kevin Rouchut)
|
||||||
|
* [`337f7ed`](https://github.com/eslint/eslint/commit/337f7ed96131d873be7ae6b010739476d0ad15e9) docs: fix width of language input (#16849) (Tanuj Kanti)
|
||||||
|
* [`9b2fcf7`](https://github.com/eslint/eslint/commit/9b2fcf7e928fc92ac6d43617bdee1bda250b7491) feat: `array-callback-return` supports `Array.prototype.toSorted` (#16845) (SUZUKI Sosuke)
|
||||||
|
* [`71349a1`](https://github.com/eslint/eslint/commit/71349a1f709baa361bd656a7ce4a7d35d857a9a8) docs: Configure a Parser page (#16803) (Ben Perlmutter)
|
||||||
|
* [`de7e925`](https://github.com/eslint/eslint/commit/de7e925d03764f3681269b30bb60b92ee463c10f) docs: remove extra line numbers in example (#16848) (jonz94)
|
||||||
|
* [`ad38d77`](https://github.com/eslint/eslint/commit/ad38d77102d6fe30cfa92c831174f178bb35c88b) docs: Update README (GitHub Actions Bot)
|
||||||
|
|
||||||
|
v8.33.0 - January 28, 2023
|
||||||
|
|
||||||
|
* [`17f4be2`](https://github.com/eslint/eslint/commit/17f4be2b66deb81f4e9ffb3d6bdfb79f3fcf85a2) docs: Fix examples in no-multiple-empty-lines rule (#16835) (jonz94)
|
||||||
|
* [`9c7cfe3`](https://github.com/eslint/eslint/commit/9c7cfe33c4a39cf2c23529afe02030ea7f8acf70) docs: 'Source Code' content in 'Set up Development Environment' page (#16780) (Ben Perlmutter)
|
||||||
|
* [`ede5c64`](https://github.com/eslint/eslint/commit/ede5c6475469a905da4f559ab55f0ee73168a9d7) docs: Custom processors page (#16802) (Ben Perlmutter)
|
||||||
|
* [`2620614`](https://github.com/eslint/eslint/commit/2620614f525de13f2e3ab0a7cd92abe89dae4897) docs: Code of Conduct page (#16781) (Ben Perlmutter)
|
||||||
|
* [`50a8efd`](https://github.com/eslint/eslint/commit/50a8efd957c70c9978a8ed25744a24193b00e078) docs: report a sec vulnerability page (#16808) (Ben Perlmutter)
|
||||||
|
* [`2cc7954`](https://github.com/eslint/eslint/commit/2cc7954cdb1fed44e8a5d3c9b3ea1deceadb5e00) feat: add `restrictDefaultExports` option to no-restricted-exports rule (#16785) (Nitin Kumar)
|
||||||
|
* [`ed60afd`](https://github.com/eslint/eslint/commit/ed60afd4450e769a975447178299446f4439d926) docs: Update page titles, section landing pages, and side TOC (#16760) (Ben Perlmutter)
|
||||||
|
* [`333c712`](https://github.com/eslint/eslint/commit/333c71243537966930e9ab8178bc98c37949b5f2) docs: add background to code-path-diagrams for dark-mode (#16822) (Tanuj Kanti)
|
||||||
|
* [`f5f7b9b`](https://github.com/eslint/eslint/commit/f5f7b9b8b512f5c6a5b4a1037f81bb3f5a7311e0) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`2aa4f5f`](https://github.com/eslint/eslint/commit/2aa4f5fb2fdb1c4a1734093c225e5c6251b0ee0f) docs: no-constant-condition: Add multi-comparison example (#16776) (Sebastian Simon)
|
||||||
|
* [`40287db`](https://github.com/eslint/eslint/commit/40287dbe7407934a69805f02ece07491778c3694) docs: Remove Google Group icon (#16779) (Nicholas C. Zakas)
|
||||||
|
* [`ea10ca5`](https://github.com/eslint/eslint/commit/ea10ca5b7b5bd8f6e6daf030ece9a3a82f10994c) docs: 'a .eslint' -> 'an .eslint' for consistency (#16809) (Ben Perlmutter)
|
||||||
|
* [`3be0748`](https://github.com/eslint/eslint/commit/3be07488ee7b6a9591d169be9648fbd36b32105e) docs: add example for nodejs lintText api (#16789) (Siva K)
|
||||||
|
* [`ce4f5ff`](https://github.com/eslint/eslint/commit/ce4f5ff30590df053a539c8e8e2597838e038a36) docs: Replace removed related rules with a valid rule (#16800) (Ville Saalo)
|
||||||
|
|
||||||
|
v8.32.0 - January 14, 2023
|
||||||
|
|
||||||
|
* [`17b65ad`](https://github.com/eslint/eslint/commit/17b65ad10d653bb05077f21d8b1f79bee96e38d8) docs: IA Update page URL move (#16665) (Ben Perlmutter)
|
||||||
|
* [`b4f8329`](https://github.com/eslint/eslint/commit/b4f8329164d7b293a1557e05b987d2a685fe1d30) fix: ignore directives for no-fallthrough (#16757) (gfyoung)
|
||||||
|
* [`5981296`](https://github.com/eslint/eslint/commit/5981296d5c7c86228ad766009901191fdd87d5a4) docs: fix theme switcher button (#16752) (Sam Chen)
|
||||||
|
* [`6669413`](https://github.com/eslint/eslint/commit/66694136b67277c050bd27f60050779687a88c9f) docs: deploy prerelease docs under the `/docs/next/` path (#16541) (Nitin Kumar)
|
||||||
|
* [`2952d6e`](https://github.com/eslint/eslint/commit/2952d6ed95811ce0971b6855d66fb7a9767a7b72) chore: sync templates/*.md files with issue templates (#16758) (gfyoung)
|
||||||
|
* [`78ecfe0`](https://github.com/eslint/eslint/commit/78ecfe0e52c0e5780fefc8dc9a98864e48de6637) docs: use inline code for rule options name (#16768) (Percy Ma)
|
||||||
|
* [`3e34418`](https://github.com/eslint/eslint/commit/3e34418b31664decfb2337de798feafbf985b66c) chore: Add new issues to triage project (#16740) (Nicholas C. Zakas)
|
||||||
|
* [`fc2ea59`](https://github.com/eslint/eslint/commit/fc2ea598aee97beb6d768866da1ee4f63775f0c9) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`fc20f24`](https://github.com/eslint/eslint/commit/fc20f242a2ac073b5af6d5fca67e07a175f36c3b) feat: add suggestions for redundant wrapping in prefer-regex-literals (#16658) (YeonJuan)
|
||||||
|
* [`762a872`](https://github.com/eslint/eslint/commit/762a8727fb3b5619cff900826053b643ca5f1162) docs: Update README (GitHub Actions Bot)
|
||||||
|
|
||||||
|
v8.31.0 - December 31, 2022
|
||||||
|
|
||||||
|
* [`65d4e24`](https://github.com/eslint/eslint/commit/65d4e24c36367cd63f0eba7371820e0e81dae7aa) chore: Upgrade @eslint/eslintrc@1.4.1 (#16729) (Brandon Mills)
|
||||||
|
* [`35439f1`](https://github.com/eslint/eslint/commit/35439f1572e1a8888f7feb6c5e51a15b5582495d) fix: correct syntax error in `prefer-arrow-callback` autofix (#16722) (Francesco Trotta)
|
||||||
|
* [`87b2470`](https://github.com/eslint/eslint/commit/87b247058ed520061fe1a146b7f0e7072a94990d) fix: new instance of FlatESLint should load latest config file version (#16608) (Milos Djermanovic)
|
||||||
|
* [`8d93081`](https://github.com/eslint/eslint/commit/8d93081a717f6e8b8cb60c3075cc1d7e4e655e6b) chore: fix CI failure (#16721) (Sam Chen)
|
||||||
|
* [`4339dc4`](https://github.com/eslint/eslint/commit/4339dc462d78888fe2e10acdfacd6f57245ce6ae) docs: Update README (GitHub Actions Bot)
|
||||||
|
* [`8f17247`](https://github.com/eslint/eslint/commit/8f17247a93240ff8a08980d8e06352e4ff4e8fe3) chore: Set up automatic updating of README (#16717) (Nicholas C. Zakas)
|
||||||
|
* [`4e4049c`](https://github.com/eslint/eslint/commit/4e4049c5fa355b2091afc8948690fcd7b1c1e6df) docs: optimize code block structure (#16669) (Sam Chen)
|
||||||
|
* [`54a7ade`](https://github.com/eslint/eslint/commit/54a7ade5d8e6f59554afeb9202ba6143f8afdf57) docs: do not escape code blocks of formatters examples (#16719) (Sam Chen)
|
||||||
|
* [`52c7c73`](https://github.com/eslint/eslint/commit/52c7c73c052e1ec2528c6b4af78181bc30cf8cdd) feat: check assignment patterns in no-underscore-dangle (#16693) (Milos Djermanovic)
|
||||||
|
* [`e5ecfef`](https://github.com/eslint/eslint/commit/e5ecfefa1c952195a3a8371f5953cc655d844079) docs: Add function call example for no-undefined (#16712) (Elliot Huffman)
|
||||||
|
* [`a3262f0`](https://github.com/eslint/eslint/commit/a3262f0a6305d2a721fac137a60c62c019b26aa4) docs: Add mastodon link (#16638) (Amaresh S M)
|
||||||
|
* [`4cd87cb`](https://github.com/eslint/eslint/commit/4cd87cb3c52412277577ba00c4fbb1aec36acc8c) ci: bump actions/stale from 6 to 7 (#16713) (dependabot[bot])
|
||||||
|
* [`a14ccf9`](https://github.com/eslint/eslint/commit/a14ccf91af1122e419710f58ef494980fc4894b3) docs: clarify files property (#16709) (Sam Chen)
|
||||||
|
* [`3b29eb1`](https://github.com/eslint/eslint/commit/3b29eb14e00182614c986d8498b483a9917976e7) docs: fix npm link (#16710) (Abdullah Osama)
|
||||||
|
* [`fd20c75`](https://github.com/eslint/eslint/commit/fd20c75b1059c54d598c0abaf63e7d7a80f04f32) chore: sort package.json scripts in alphabetical order (#16705) (Darius Dzien)
|
||||||
|
* [`a638673`](https://github.com/eslint/eslint/commit/a638673ee6e94344c46d12dfc988adeb3783f817) docs: fix search bar focus on `Esc` (#16700) (Shanmughapriyan S)
|
||||||
|
* [`f62b722`](https://github.com/eslint/eslint/commit/f62b722251858a5dfb157591910edbaaeb4a966f) docs: country flag missing in windows (#16698) (Shanmughapriyan S)
|
||||||
|
* [`4d27ec6`](https://github.com/eslint/eslint/commit/4d27ec6019847afabeebf592dddc014e9220057c) docs: display zh-hans in the docs language switcher (#16686) (Percy Ma)
|
||||||
|
* [`8bda20e`](https://github.com/eslint/eslint/commit/8bda20e8276c6ba17d31842fcdd63ba65476fbbd) docs: remove manually maintained anchors (#16685) (Percy Ma)
|
||||||
|
* [`b401cde`](https://github.com/eslint/eslint/commit/b401cde47d44746ff91b8feced3fb3a4e32c0e12) feat: add options to check destructuring in no-underscore-dangle (#16006) (Morten Kaltoft)
|
||||||
|
* [`b68440f`](https://github.com/eslint/eslint/commit/b68440ff2b8322fc00373792701169205c94ed94) docs: User Guide Getting Started expansion (#16596) (Ben Perlmutter)
|
||||||
|
* [`30d0daf`](https://github.com/eslint/eslint/commit/30d0daf55e85a412995f6d69f47cab3fb591f2c3) feat: group properties with values in parentheses in `key-spacing` (#16677) (Francesco Trotta)
|
||||||
|
* [`10a5c78`](https://github.com/eslint/eslint/commit/10a5c7839370219c79f44d4206cbd7c28a72bad5) chore: update ignore patterns in `eslint.config.js` (#16678) (Milos Djermanovic)
|
||||||
|
|
||||||
|
v8.30.0 - December 16, 2022
|
||||||
|
|
||||||
|
* [`f2c4737`](https://github.com/eslint/eslint/commit/f2c47372420f050ad8f2300271345de1c1232635) chore: upgrade @eslint/eslintrc@1.4.0 (#16675) (Milos Djermanovic)
|
||||||
|
* [`1a327aa`](https://github.com/eslint/eslint/commit/1a327aae57f1b68c96b27cc1bd57f8198d5a3a7c) fix: Ensure flat config unignores work consistently like eslintrc (#16579) (Nicholas C. Zakas)
|
||||||
|
* [`075ef2c`](https://github.com/eslint/eslint/commit/075ef2cf315e75b51b671c40ce9a97c66b2e4b50) feat: add suggestion for no-return-await (#16637) (Daniel Bartholomae)
|
||||||
|
* [`ba74253`](https://github.com/eslint/eslint/commit/ba74253e8bd63e9e163bbee0540031be77e39253) chore: standardize npm script names per #14827 (#16315) (Patrick McElhaney)
|
||||||
|
* [`6a8cd94`](https://github.com/eslint/eslint/commit/6a8cd94ed08983c70ca7d72dc6e360770a743405) docs: Clarify Discord info in issue template config (#16663) (Nicholas C. Zakas)
|
||||||
|
* [`0d9af4c`](https://github.com/eslint/eslint/commit/0d9af4c5674809be993439c766dcd9d7f65fcec9) ci: fix npm v9 problem with `file:` (#16664) (Milos Djermanovic)
|
||||||
|
* [`7190d98`](https://github.com/eslint/eslint/commit/7190d98ff40023f24b0c6a98319ae8a82c99ff5b) feat: update globals (#16654) (Sébastien Règne)
|
||||||
|
* [`ad44344`](https://github.com/eslint/eslint/commit/ad44344ef6fdeac7217eb83bc54a230382c0da5e) docs: CLI documentation standardization (#16563) (Ben Perlmutter)
|
||||||
|
* [`90c9219`](https://github.com/eslint/eslint/commit/90c9219181e0aadcae7224602d2988186d457113) refactor: migrate off deprecated function-style rules in all tests (#16618) (Bryan Mishkin)
|
||||||
|
* [`9b8bb72`](https://github.com/eslint/eslint/commit/9b8bb72c49a453086954b06a5d7dd390731b1975) fix: autofix recursive functions in no-var (#16611) (Milos Djermanovic)
|
||||||
|
* [`293573e`](https://github.com/eslint/eslint/commit/293573eb530d161d2a5b01efd9d3de49dadea022) docs: fix broken line numbers (#16606) (Sam Chen)
|
||||||
|
* [`fa2c64b`](https://github.com/eslint/eslint/commit/fa2c64be10d5854fb586c20957737d7d2da1975a) docs: use relative links for internal links (#16631) (Percy Ma)
|
||||||
|
* [`75276c9`](https://github.com/eslint/eslint/commit/75276c9bc7c4bc013fc6bdf277353c979934d73b) docs: reorder options in no-unused-vars (#16625) (Milos Djermanovic)
|
||||||
|
* [`7276fe5`](https://github.com/eslint/eslint/commit/7276fe5776f03fb90e575ed63a9b1a6766993e42) docs: Fix anchor in URL (#16628) (Karl Horky)
|
||||||
|
* [`6bef135`](https://github.com/eslint/eslint/commit/6bef1350e692c818c55c6d2074c12506e98cdf4f) docs: don't apply layouts to html formatter example (#16591) (Tanuj Kanti)
|
||||||
|
* [`dfc7ec1`](https://github.com/eslint/eslint/commit/dfc7ec11b11b56daaa10e8e6d08c5cddfc8c2c59) docs: Formatters page updates (#16566) (Ben Perlmutter)
|
||||||
|
* [`8ba124c`](https://github.com/eslint/eslint/commit/8ba124cfd8aaf01d14ccbcb1654798624948fb0a) docs: update the `prefer-const` example (#16607) (Pavel)
|
||||||
|
* [`e6cb05a`](https://github.com/eslint/eslint/commit/e6cb05aa35bafb9e88f161ad1fa6b01942a7c13c) docs: fix css leaking (#16603) (Sam Chen)
|
||||||
|
|
||||||
|
v8.29.0 - December 2, 2022
|
||||||
|
|
||||||
|
* [`0311d81`](https://github.com/eslint/eslint/commit/0311d81834d675b8ae7cc92a460b37115edc4018) docs: Configuring Plugins page intro, page tweaks, and rename (#16534) (Ben Perlmutter)
|
||||||
|
* [`57089b1`](https://github.com/eslint/eslint/commit/57089b1ede624452bc94404b6e60d01d48cfd468) docs: add a property assignment example for camelcase rule (#16605) (Milos Djermanovic)
|
||||||
|
* [`b6ab030`](https://github.com/eslint/eslint/commit/b6ab030897d2e8b314b33a6502346a4ac45bb8da) docs: add docs codeowners (#16601) (Strek)
|
||||||
|
* [`7628403`](https://github.com/eslint/eslint/commit/7628403a57d9d9b4e2cb2b36309170900f58832e) chore: add discord channel link (#16590) (Amaresh S M)
|
||||||
|
* [`49a07c5`](https://github.com/eslint/eslint/commit/49a07c52c5af7e98d161ff4acd44bbbe0aa6383b) feat: add `allowParensAfterCommentPattern` option to no-extra-parens (#16561) (Nitin Kumar)
|
||||||
|
* [`6380c87`](https://github.com/eslint/eslint/commit/6380c87c563be5dc78ce0ddd5c7409aaf71692bb) docs: fix sitemap and feed (#16592) (Milos Djermanovic)
|
||||||
|
* [`e6a865d`](https://github.com/eslint/eslint/commit/e6a865d70aed9e1c07be712e40c38da1a5dda849) feat: `prefer-named-capture-group` add suggestions (#16544) (Josh Goldberg)
|
||||||
|
* [`ade621d`](https://github.com/eslint/eslint/commit/ade621dd12fcd3b65644bb3468248cc040db756c) docs: perf debounce the search query (#16586) (Shanmughapriyan S)
|
||||||
|
* [`a91332b`](https://github.com/eslint/eslint/commit/a91332b8bd9adfa2aa8110071bdf73f56d400050) feat: In no-invalid-regexp validate flags also for non-literal patterns (#16583) (trosos)
|
||||||
|
* [`fbcf3ab`](https://github.com/eslint/eslint/commit/fbcf3abd54dd20aec3c695cacece56493633c97f) docs: fix searchbar clear button (#16585) (Shanmughapriyan S)
|
||||||
|
* [`f894035`](https://github.com/eslint/eslint/commit/f89403553b31d24f4fc841424cc7dcb8c3ef689f) docs: HTTPS link to yeoman.io (#16582) (Christian Oliff)
|
||||||
|
* [`de12b26`](https://github.com/eslint/eslint/commit/de12b266f2aa6f063d0af888b8f0de41d09ec33f) docs: Update configuration file pages (#16509) (Ben Perlmutter)
|
||||||
|
* [`f5808cb`](https://github.com/eslint/eslint/commit/f5808cb51529174a67b4938223f06435ad6d5118) chore: fix rule doc headers check (#16564) (Milos Djermanovic)
|
||||||
|
* [`1ae9f20`](https://github.com/eslint/eslint/commit/1ae9f2067442434c6ccc6b41703624b302d17c67) docs: update correct code examples for `no-extra-parens` rule (#16560) (Nitin Kumar)
|
||||||
|
|
||||||
|
v8.28.0 - November 18, 2022
|
||||||
|
|
||||||
|
* [`34c05a7`](https://github.com/eslint/eslint/commit/34c05a779ada3142995392ae12978461900088df) docs: Language Options page intro and tweaks (#16511) (Ben Perlmutter)
|
||||||
|
* [`3e66387`](https://github.com/eslint/eslint/commit/3e663873c97773ab1ecdff54aaa122075d5bb389) docs: add intro and edit ignoring files page (#16510) (Ben Perlmutter)
|
||||||
|
* [`436f712`](https://github.com/eslint/eslint/commit/436f712843360f98b2bd63256bf0c4f77013b54c) docs: fix Header UI inconsistency (#16464) (Tanuj Kanti)
|
||||||
|
* [`f743816`](https://github.com/eslint/eslint/commit/f74381696703d8eed0e175d42f96904a3d1cb4cb) docs: switch to wrench emoji for auto-fixable rules (#16545) (Bryan Mishkin)
|
||||||
|
* [`bc0547e`](https://github.com/eslint/eslint/commit/bc0547eb149a1e04211826662d2d798fb331983d) docs: improve styles for versions and languages page (#16553) (Nitin Kumar)
|
||||||
|
* [`6070f58`](https://github.com/eslint/eslint/commit/6070f58d802d77c6c781c6bc1f554eef8b3d8f68) docs: clarify esquery issue workaround (#16556) (Milos Djermanovic)
|
||||||
|
* [`b48e4f8`](https://github.com/eslint/eslint/commit/b48e4f89c59bd1c5408e3db492a0e95a402820bd) docs: Command Line Interface intro and tweaks (#16535) (Ben Perlmutter)
|
||||||
|
* [`b92b30f`](https://github.com/eslint/eslint/commit/b92b30f93db64314827305b552cbb832c63fa949) docs: Add Rules page intro and content tweaks (#16523) (Ben Perlmutter)
|
||||||
|
* [`1769b42`](https://github.com/eslint/eslint/commit/1769b423392512db4adf1eff75896c1ac0c3606b) docs: Integrations page introduction (#16548) (Ben Perlmutter)
|
||||||
|
* [`63bce44`](https://github.com/eslint/eslint/commit/63bce44e7b6326e1e94fc7f6283df8de7bbac273) feat: add `ignoreClassFieldInitialValues` option to no-magic-numbers (#16539) (Milos Djermanovic)
|
||||||
|
* [`c50ae4f`](https://github.com/eslint/eslint/commit/c50ae4f840d1ee9dc7b80a46c887398c0ec0a67c) fix: Ensure that dot files are found with globs. (#16550) (Nicholas C. Zakas)
|
||||||
|
* [`a8d0a57`](https://github.com/eslint/eslint/commit/a8d0a57cbc29a917258df41d3254ecd29bcf61ab) docs: make table of contents sticky on desktop (#16506) (Sam Chen)
|
||||||
|
* [`9432b67`](https://github.com/eslint/eslint/commit/9432b67f76ddd7b8a73d37e8a041a9ff25822f0c) fix: throw error for first unmatched pattern (#16533) (Milos Djermanovic)
|
||||||
|
* [`8385ecd`](https://github.com/eslint/eslint/commit/8385ecdbbe342211e20aebe76fa7affe8ec04c33) feat: multiline properties in rule `key-spacing` with option `align` (#16532) (Francesco Trotta)
|
||||||
|
* [`a4e89db`](https://github.com/eslint/eslint/commit/a4e89dbe85589dab982885872dc206e090c27b3c) feat: `no-obj-calls` support `Intl` (#16543) (Sosuke Suzuki)
|
||||||
|
* [`a01315a`](https://github.com/eslint/eslint/commit/a01315a7d8f3a70468b7a644fde01d6983778c6b) docs: fix route of japanese translation site (#16542) (Tanuj Kanti)
|
||||||
|
* [`e94a4a9`](https://github.com/eslint/eslint/commit/e94a4a95ee301b0344d3292c37a0b29d8e18ab30) chore: Add tests to verify #16038 is fixed (#16538) (Nicholas C. Zakas)
|
||||||
|
* [`0515628`](https://github.com/eslint/eslint/commit/05156285396eba9ce3d3a0990a8c89d5bc229636) docs: use emoji instead of svg for deprecated rule (#16536) (Bryan Mishkin)
|
||||||
|
* [`e76c382`](https://github.com/eslint/eslint/commit/e76c3827727b48c16af8467c02c31160e5595d83) fix: allow `* 1` when followed by `/` in no-implicit-coercion (#16522) (Milos Djermanovic)
|
||||||
|
* [`68f1288`](https://github.com/eslint/eslint/commit/68f12882fbaeda8ffb26425d42d261346ff5af51) docs: set default layouts (#16484) (Percy Ma)
|
||||||
|
* [`e13f194`](https://github.com/eslint/eslint/commit/e13f194f89f591730aa955f7b62192c7e8296069) chore: stricter validation of `meta.docs.description` in core rules (#16529) (Milos Djermanovic)
|
||||||
|
* [`776827a`](https://github.com/eslint/eslint/commit/776827a1748da88a25e7903bd794f5439de922b5) docs: init config about specifying shared configs (#16483) (Percy Ma)
|
||||||
|
* [`72dbfbc`](https://github.com/eslint/eslint/commit/72dbfbc0c45d2b9d19b21c6a5a6b4ca71403ffbf) chore: use `pkg` parameter in `getNpmPackageVersion` (#16525) (webxmsj)
|
||||||
|
* [`5c39425`](https://github.com/eslint/eslint/commit/5c39425fc55ecc0b97bbd07ac22654c0eb4f789c) docs: fix broken link to plugins (#16520) (Ádám T. Nagy)
|
||||||
|
* [`c97c789`](https://github.com/eslint/eslint/commit/c97c7897686ac4dc2828537d6a017f3c99f7d905) docs: Add missing no-new-native-nonconstructor docs code fence (#16503) (Brandon Mills)
|
||||||
|
|
||||||
|
v8.27.0 - November 6, 2022
|
||||||
|
|
||||||
|
* [`f14587c`](https://github.com/eslint/eslint/commit/f14587c42bb0fe6ec89529aede045a488083d6ee) feat: new `no-new-native-nonconstructor` rule (#16368) (Sosuke Suzuki)
|
||||||
|
* [`978799b`](https://github.com/eslint/eslint/commit/978799bd5c76fecf4ce8f17d89ad6c9f436c3228) feat: add new rule `no-empty-static-block` (#16325) (Sosuke Suzuki)
|
||||||
|
* [`ce93b42`](https://github.com/eslint/eslint/commit/ce93b429bf917640473dd7e26b49bba993c68ce4) docs: Stylelint property-no-unknown (#16497) (Nick Schonning)
|
||||||
|
* [`d2cecb4`](https://github.com/eslint/eslint/commit/d2cecb4ad2a6d33444cf0288a863c43acb3b468a) docs: Stylelint declaration-block-no-shorthand-property-overrides (#16498) (Nick Schonning)
|
||||||
|
* [`0a92805`](https://github.com/eslint/eslint/commit/0a92805d7713118866e519b0ff2a61c5d6238ad9) docs: stylelint color-hex-case (#16496) (Nick Schonning)
|
||||||
|
* [`c3ce521`](https://github.com/eslint/eslint/commit/c3ce5212f672d95dde3465d7d3c4bf99ff665f8b) fix: Ensure unmatched glob patterns throw an error (#16462) (Nicholas C. Zakas)
|
||||||
|
* [`74a5af4`](https://github.com/eslint/eslint/commit/74a5af487ac7296a46a8078e585f00df72b63d83) docs: fix stylelint error (#16491) (Milos Djermanovic)
|
||||||
|
* [`69216ee`](https://github.com/eslint/eslint/commit/69216ee69c7172e847b64e0e934b5121a34d0ea3) feat: no-empty suggest to add comment in empty BlockStatement (#16470) (Nitin Kumar)
|
||||||
|
* [`324db1a`](https://github.com/eslint/eslint/commit/324db1a11e43ba9d954dc522763faea19129ce6a) docs: explicit stylelint color related rules (#16465) (Nick Schonning)
|
||||||
|
* [`94dc4f1`](https://github.com/eslint/eslint/commit/94dc4f19ba49fe2358f8bcc2fc3555d222766755) docs: use Stylelint for HTML files (#16468) (Nick Schonning)
|
||||||
|
* [`cc6128d`](https://github.com/eslint/eslint/commit/cc6128db4f489c3ab80fff2f9dbeea313e72208d) docs: enable stylelint declaration-block-no-duplicate-properties (#16466) (Nick Schonning)
|
||||||
|
* [`d03a8bf`](https://github.com/eslint/eslint/commit/d03a8bf8978bd330aeb951f18cc92bf1ad24eeec) docs: Add heading to justification explanation (#16430) (Maritaria)
|
||||||
|
* [`886a038`](https://github.com/eslint/eslint/commit/886a0386897f96d2da95eba8c52bd893fcbf7e86) fix: handle files with unspecified path in `getRulesMetaForResults` (#16437) (Francesco Trotta)
|
||||||
|
* [`319f0a5`](https://github.com/eslint/eslint/commit/319f0a5491598825bbd528c6d1fc12771056a74c) feat: use `context.languageOptions.ecmaVersion` in core rules (#16458) (Milos Djermanovic)
|
||||||
|
* [`8a15968`](https://github.com/eslint/eslint/commit/8a159686f9d497262d573dd601855ce28362199b) docs: add Stylelint configuration and cleanup (#16379) (Nick Schonning)
|
||||||
|
* [`9b0a469`](https://github.com/eslint/eslint/commit/9b0a469d1e4650c1d9da26239357e715b11b2d97) docs: note commit messages don't support scope (#16435) (Andy Edwards)
|
||||||
|
* [`1581405`](https://github.com/eslint/eslint/commit/15814057fd69319b3744bdea5db2455f85d2e74f) docs: improve context.getScope() docs (#16417) (Ben Perlmutter)
|
||||||
|
* [`b797149`](https://github.com/eslint/eslint/commit/b7971496e9b44add405ca0360294f5c3be85b540) docs: update formatters template (#16454) (Milos Djermanovic)
|
||||||
|
* [`5ac4de9`](https://github.com/eslint/eslint/commit/5ac4de911f712cb3a5a16eb7a4063eee09dfc97c) docs: fix link to formatters on the Core Concepts page (#16455) (Vladislav)
|
||||||
|
* [`33313ef`](https://github.com/eslint/eslint/commit/33313ef56258a6a96b00a3e70025b94bd2f2fe9f) docs: core-concepts: fix link to semi rule (#16453) (coderaiser)
|
||||||
|
|
||||||
|
v8.26.0 - October 21, 2022
|
||||||
|
|
||||||
|
* [`df77409`](https://github.com/eslint/eslint/commit/df7740967ffab2915974c7b310ac76ea2915ac2d) fix: use `baseConfig` constructor option in FlatESLint (#16432) (Milos Djermanovic)
|
||||||
|
* [`33668ee`](https://github.com/eslint/eslint/commit/33668ee9d22e1988ba03e07fb547738bdb21dc0e) fix: Ensure that glob patterns are matched correctly. (#16449) (Nicholas C. Zakas)
|
||||||
|
* [`651649b`](https://github.com/eslint/eslint/commit/651649b12797594a86c0d659d6a0d1cdbda6f57b) docs: Core concepts page (#16399) (Ben Perlmutter)
|
||||||
|
* [`4715787`](https://github.com/eslint/eslint/commit/4715787724a71494ba0bb0c5fe4639570bb6985b) feat: check `Object.create()` in getter-return (#16420) (Yuki Hirasawa)
|
||||||
|
* [`e917a9a`](https://github.com/eslint/eslint/commit/e917a9a2e555d398c64b985fc933d44a42c958f0) ci: add node v19 (#16443) (Koichi ITO)
|
||||||
|
* [`740b208`](https://github.com/eslint/eslint/commit/740b20826fadc5322ea5547c1ba41793944e571d) fix: ignore messages without a `ruleId` in `getRulesMetaForResults` (#16409) (Francesco Trotta)
|
||||||
|
* [`8f9759e`](https://github.com/eslint/eslint/commit/8f9759e2a94586357d85fac902e038fabdba79a7) fix: `--ignore-pattern` in flat config mode should be relative to `cwd` (#16425) (Milos Djermanovic)
|
||||||
|
* [`325ad37`](https://github.com/eslint/eslint/commit/325ad375a52d1c7b8b8fd23943350c91781366a2) fix: make `getRulesMetaForResults` return a plain object in trivial case (#16438) (Francesco Trotta)
|
||||||
|
* [`a2810bc`](https://github.com/eslint/eslint/commit/a2810bc485d9f1123a86b60702fcaa51e19d71a3) fix: Ensure that directories can be unignored. (#16436) (Nicholas C. Zakas)
|
||||||
|
* [`631cf72`](https://github.com/eslint/eslint/commit/631cf72e82f316a2cc08770e5c81b858637ab04a) docs: note --ignore-path not supported with flat config (#16434) (Andy Edwards)
|
||||||
|
* [`1692840`](https://github.com/eslint/eslint/commit/1692840a2f763737a4891419dc304db4ebedab5d) docs: fix syntax in examples for new config files (#16427) (Milos Djermanovic)
|
||||||
|
* [`28d1902`](https://github.com/eslint/eslint/commit/28d190264017dbaa29f2ab218f73b623143cd1af) feat: `no-implicit-globals` supports `exported` block comment (#16343) (Sosuke Suzuki)
|
||||||
|
* [`35916ad`](https://github.com/eslint/eslint/commit/35916ad9bfc07dab63361721df1bd7f21e43e094) fix: Ensure unignore and reignore work correctly in flat config. (#16422) (Nicholas C. Zakas)
|
||||||
|
* [`4b70b91`](https://github.com/eslint/eslint/commit/4b70b91a6e28669ab8e2a4ce2a6d9ed40be20fa7) chore: Add VS Code issues link (#16423) (Nicholas C. Zakas)
|
||||||
|
* [`e940be7`](https://github.com/eslint/eslint/commit/e940be7a83d0caea15b64c1e1c2785a6540e2641) feat: Use ESLINT_USE_FLAT_CONFIG environment variable for flat config (#16356) (Tomer Aberbach)
|
||||||
|
* [`d336cfc`](https://github.com/eslint/eslint/commit/d336cfc9145a72bf8730250ee1e331a135e6ee2c) docs: Document extending plugin with new config (#16394) (Ben Perlmutter)
|
||||||
|
* [`dd0c58f`](https://github.com/eslint/eslint/commit/dd0c58f0f34d24331ae55139af39cf2747125f5e) feat: Swap out Globby for custom globbing solution. (#16369) (Nicholas C. Zakas)
|
||||||
|
* [`232d291`](https://github.com/eslint/eslint/commit/232d2916ac5e44db55c2ffbd2f3b37ad70037b7b) chore: suppress a Node.js deprecation warning (#16398) (Koichi ITO)
|
||||||
|
|
||||||
|
v8.25.0 - October 7, 2022
|
||||||
|
|
||||||
|
* [`1f78594`](https://github.com/eslint/eslint/commit/1f785944f61c97996445e48cb74fc300142e7310) chore: upgrade @eslint/eslintrc@1.3.3 (#16397) (Milos Djermanovic)
|
||||||
|
* [`173e820`](https://github.com/eslint/eslint/commit/173e82040895ad53b2d9940bfb3fb67a0478f00b) feat: Pass --max-warnings value to formatters (#16348) (Brandon Mills)
|
||||||
|
* [`8476a9b`](https://github.com/eslint/eslint/commit/8476a9b8b81164887cdf38a21d431b75ff2956b1) chore: Remove CODEOWNERS (#16375) (Nick Schonning)
|
||||||
|
* [`720ff75`](https://github.com/eslint/eslint/commit/720ff75beb9f4fdcf2a185fcb8020cf78483fdeb) chore: use "ci" for Dependabot commit message (#16377) (Nick Schonning)
|
||||||
|
* [`90c6028`](https://github.com/eslint/eslint/commit/90c602802b6e330b79c42f282e9a615c583e32d7) docs: Conflicting fixes (#16366) (Ben Perlmutter)
|
||||||
|
* [`5a3fe70`](https://github.com/eslint/eslint/commit/5a3fe70c5261acbf115fa5f47231cbc4ac62c1bc) docs: Add VS to integrations page (#16381) (Maria José Solano)
|
||||||
|
* [`6964cb1`](https://github.com/eslint/eslint/commit/6964cb1e0f073b236cb3288b9d8be495336bbf29) feat: remove support for ignore files in FlatESLint (#16355) (Milos Djermanovic)
|
||||||
|
* [`49bd1e5`](https://github.com/eslint/eslint/commit/49bd1e5669b34fd7e0f4a3cf42009866980d7e15) docs: remove unused link definitions (#16376) (Nick Schonning)
|
||||||
|
* [`42f5479`](https://github.com/eslint/eslint/commit/42f547948f284f1c67799f237dfeb86fc400c7c7) chore: bump actions/stale from 5 to 6 (#16350) (dependabot[bot])
|
||||||
|
* [`3bd380d`](https://github.com/eslint/eslint/commit/3bd380d3ea7e88ade4905ec0b240c866ab79a69d) docs: typo cleanups for docs (#16374) (Nick Schonning)
|
||||||
|
* [`b3a0837`](https://github.com/eslint/eslint/commit/b3a08376cfb61275a7557d6d166b6116f36e5ac2) docs: remove duplicate words (#16378) (Nick Schonning)
|
||||||
|
* [`a682562`](https://github.com/eslint/eslint/commit/a682562458948f74a227be60a80e10e7a3753124) docs: add `BigInt` to `new-cap` docs (#16362) (Sosuke Suzuki)
|
||||||
|
* [`1cc4b3a`](https://github.com/eslint/eslint/commit/1cc4b3a8f82a7945dcd8c59550b6a906a0fabbb4) feat: `id-length` counts graphemes instead of code units (#16321) (Sosuke Suzuki)
|
||||||
|
* [`f6d57fb`](https://github.com/eslint/eslint/commit/f6d57fb657c2f4e8e0140ad057da34c935482972) docs: Update docs README (#16352) (Ben Perlmutter)
|
||||||
|
* [`e5e9e27`](https://github.com/eslint/eslint/commit/e5e9e271da58361bda16f7abc8f367ccc6f91510) chore: remove `jsdoc` dev dependency (#16344) (Milos Djermanovic)
|
||||||
|
* [`7214347`](https://github.com/eslint/eslint/commit/721434705bd569e33911e25d2688e33f10898d52) docs: fix logical-assignment-operators option typo (#16346) (Jonathan Wilsson)
|
||||||
|
|
||||||
|
v8.24.0 - September 23, 2022
|
||||||
|
|
||||||
|
* [`131e646`](https://github.com/eslint/eslint/commit/131e646e227b9aca3937fe287343bf2c3df408af) chore: Upgrade @humanwhocodes/config-array for perf (#16339) (Nicholas C. Zakas)
|
||||||
|
* [`2c152ff`](https://github.com/eslint/eslint/commit/2c152ff0fb709b99e62c19ecd2c95689efacbe4c) docs: note false positive `Object.getOwnPropertyNames` in prefer-reflect (#16317) (AnnAngela)
|
||||||
|
* [`bf7bd88`](https://github.com/eslint/eslint/commit/bf7bd885a92046a6b6bcbcaaa1e78e9f2c4b482f) docs: fix warn severity description for new config files (#16324) (Nitin Kumar)
|
||||||
|
* [`504fe59`](https://github.com/eslint/eslint/commit/504fe59b0e0f4f5a2afb6a69aaed5cb4ca631012) perf: switch from object spread to `Object.assign` when merging globals (#16311) (Milos Djermanovic)
|
||||||
|
* [`1729f9e`](https://github.com/eslint/eslint/commit/1729f9ea4d7b2945b2b701d72027fd4aace954cf) feat: account for `sourceType: "commonjs"` in the strict rule (#16308) (Milos Djermanovic)
|
||||||
|
* [`b0d72c9`](https://github.com/eslint/eslint/commit/b0d72c96b2a9cde7a5798c2b08ec4e70683c6aca) feat: add rule logical-assignment-operators (#16102) (fnx)
|
||||||
|
* [`f02bcd9`](https://github.com/eslint/eslint/commit/f02bcd91bf89b6c167d5346a36677fdb854f0c05) feat: `array-callback-return` support `findLast` and `findLastIndex` (#16314) (Sosuke Suzuki)
|
||||||
|
* [`8cc0bbe`](https://github.com/eslint/eslint/commit/8cc0bbe440dc5e6af6ef02f00d0514a40ca07c24) docs: use more clean link syntax (#16309) (Percy Ma)
|
||||||
|
* [`6ba269e`](https://github.com/eslint/eslint/commit/6ba269ed673f965d081287b769c12beeb5f98887) docs: fix typo (#16288) (jjangga0214)
|
||||||
|
|
||||||
v8.23.1 - September 12, 2022
|
v8.23.1 - September 12, 2022
|
||||||
|
|
||||||
* [`b719893`](https://github.com/eslint/eslint/commit/b71989388a921886caa4c6cb48729bbf60c46100) fix: Upgrade eslintrc to stop redefining plugins (#16297) (Brandon Mills)
|
* [`b719893`](https://github.com/eslint/eslint/commit/b71989388a921886caa4c6cb48729bbf60c46100) fix: Upgrade eslintrc to stop redefining plugins (#16297) (Brandon Mills)
|
||||||
|
@ -10,18 +10,18 @@ This project adheres to the [Open JS Foundation Code of Conduct](https://eslint.
|
|||||||
|
|
||||||
Before filing an issue, please be sure to read the guidelines for what you're reporting:
|
Before filing an issue, please be sure to read the guidelines for what you're reporting:
|
||||||
|
|
||||||
* [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs)
|
* [Report Bugs](https://eslint.org/docs/latest/contribute/report-bugs)
|
||||||
* [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules)
|
* [Propose a New Rule](https://eslint.org/docs/latest/contribute/propose-new-rule)
|
||||||
* [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes)
|
* [Propose a Rule Change](https://eslint.org/docs/latest/contribute/propose-rule-change)
|
||||||
* [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes)
|
* [Request a Change](https://eslint.org/docs/latest/contribute/request-change)
|
||||||
|
|
||||||
To report a security vulnerability in ESLint, please use our [HackerOne program](https://hackerone.com/eslint).
|
To report a security vulnerability in ESLint, please use our [HackerOne program](https://hackerone.com/eslint).
|
||||||
|
|
||||||
## Contributing Code
|
## Contributing Code
|
||||||
|
|
||||||
In order to submit code or documentation to an ESLint project, you’ll be asked to sign our CLA when you send your first pull request. (Read more about the Open JS Foundation CLA process at <https://cla.openjsf.org/>.) Also, please read over the [Pull Request Guidelines](https://eslint.org/docs/developer-guide/contributing/pull-requests).
|
In order to submit code or documentation to an ESLint project, you’ll be asked to sign our CLA when you send your first pull request. (Read more about the Open JS Foundation CLA process at <https://cla.openjsf.org/>.) Also, please read over the [Pull Request Guidelines](https://eslint.org/docs/latest/contribute/pull-requests).
|
||||||
|
|
||||||
## Full Documentation
|
## Full Documentation
|
||||||
|
|
||||||
Our full contribution guidelines can be found at:
|
Our full contribution guidelines can be found at:
|
||||||
<https://eslint.org/docs/developer-guide/contributing/>
|
<https://eslint.org/docs/latest/contribute/>
|
||||||
|
@ -15,6 +15,7 @@ const checker = require("npm-license"),
|
|||||||
fs = require("fs"),
|
fs = require("fs"),
|
||||||
glob = require("glob"),
|
glob = require("glob"),
|
||||||
marked = require("marked"),
|
marked = require("marked"),
|
||||||
|
matter = require("gray-matter"),
|
||||||
markdownlint = require("markdownlint"),
|
markdownlint = require("markdownlint"),
|
||||||
os = require("os"),
|
os = require("os"),
|
||||||
path = require("path"),
|
path = require("path"),
|
||||||
@ -166,7 +167,7 @@ function generateBlogPost(releaseInfo, prereleaseMajorVersion) {
|
|||||||
*/
|
*/
|
||||||
function generateFormatterExamples(formatterInfo) {
|
function generateFormatterExamples(formatterInfo) {
|
||||||
const output = ejs.render(cat("./templates/formatter-examples.md.ejs"), formatterInfo);
|
const output = ejs.render(cat("./templates/formatter-examples.md.ejs"), formatterInfo);
|
||||||
const outputDir = path.join(DOCS_SRC_DIR, "user-guide/formatters/"),
|
const outputDir = path.join(DOCS_SRC_DIR, "use/formatters/"),
|
||||||
filename = path.join(outputDir, "index.md"),
|
filename = path.join(outputDir, "index.md"),
|
||||||
htmlFilename = path.join(outputDir, "html-formatter-example.html");
|
htmlFilename = path.join(outputDir, "html-formatter-example.html");
|
||||||
|
|
||||||
@ -344,9 +345,18 @@ function generatePrerelease(prereleaseId) {
|
|||||||
*/
|
*/
|
||||||
function publishRelease() {
|
function publishRelease() {
|
||||||
ReleaseOps.publishRelease();
|
ReleaseOps.publishRelease();
|
||||||
|
const releaseInfo = JSON.parse(cat(".eslint-release-info.json"));
|
||||||
|
const isPreRelease = /[a-z]/u.test(releaseInfo.version);
|
||||||
|
|
||||||
// push to latest branch to trigger docs deploy
|
/*
|
||||||
exec("git push origin HEAD:latest -f");
|
* for a pre-release, push to the "next" branch to trigger docs deploy
|
||||||
|
* for a release, push to the "latest" branch to trigger docs deploy
|
||||||
|
*/
|
||||||
|
if (isPreRelease) {
|
||||||
|
exec("git push origin HEAD:next -f");
|
||||||
|
} else {
|
||||||
|
exec("git push origin HEAD:latest -f");
|
||||||
|
}
|
||||||
|
|
||||||
publishSite();
|
publishSite();
|
||||||
}
|
}
|
||||||
@ -446,8 +456,9 @@ function lintMarkdown(files) {
|
|||||||
*/
|
*/
|
||||||
function getFormatterResults() {
|
function getFormatterResults() {
|
||||||
const stripAnsi = require("strip-ansi");
|
const stripAnsi = require("strip-ansi");
|
||||||
|
const formattersMetadata = require("./lib/cli-engine/formatters/formatters-meta.json");
|
||||||
|
|
||||||
const formatterFiles = fs.readdirSync("./lib/cli-engine/formatters/"),
|
const formatterFiles = fs.readdirSync("./lib/cli-engine/formatters/").filter(fileName => !fileName.includes("formatters-meta.json")),
|
||||||
rules = {
|
rules = {
|
||||||
"no-else-return": "warn",
|
"no-else-return": "warn",
|
||||||
indent: ["warn", 4],
|
indent: ["warn", 4],
|
||||||
@ -488,7 +499,8 @@ function getFormatterResults() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
data.formatterResults[name] = {
|
data.formatterResults[name] = {
|
||||||
result: stripAnsi(formattedOutput)
|
result: stripAnsi(formattedOutput),
|
||||||
|
description: formattersMetadata.find(formatter => formatter.name === name).description
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
@ -518,11 +530,11 @@ target.lint = function([fix = false] = []) {
|
|||||||
* when analyzing `require()` calls from CJS modules in the `docs` directory. Since our release process does not run `npm install`
|
* when analyzing `require()` calls from CJS modules in the `docs` directory. Since our release process does not run `npm install`
|
||||||
* in the `docs` directory, linting would fail and break the release. Also, working on the main `eslint` package does not require
|
* in the `docs` directory, linting would fail and break the release. Also, working on the main `eslint` package does not require
|
||||||
* installing dependencies declared in `docs/package.json`, so most contributors will not have `docs/node_modules` locally.
|
* installing dependencies declared in `docs/package.json`, so most contributors will not have `docs/node_modules` locally.
|
||||||
* Therefore, we add `--ignore-pattern docs` to exclude linting the `docs` directory from this command.
|
* Therefore, we add `--ignore-pattern "docs/**"` to exclude linting the `docs` directory from this command.
|
||||||
* There is a separate command `target.lintDocsJS` for linting JavaScript files in the `docs` directory.
|
* There is a separate command `target.lintDocsJS` for linting JavaScript files in the `docs` directory.
|
||||||
*/
|
*/
|
||||||
echo("Validating JavaScript files");
|
echo("Validating JavaScript files");
|
||||||
lastReturn = exec(`${ESLINT}${fix ? "--fix" : ""} . --ignore-pattern docs`);
|
lastReturn = exec(`${ESLINT}${fix ? "--fix" : ""} . --ignore-pattern "docs/**"`);
|
||||||
if (lastReturn.code !== 0) {
|
if (lastReturn.code !== 0) {
|
||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
@ -545,7 +557,7 @@ target.lintDocsJS = function([fix = false] = []) {
|
|||||||
let errors = 0;
|
let errors = 0;
|
||||||
|
|
||||||
echo("Validating JavaScript files in the docs directory");
|
echo("Validating JavaScript files in the docs directory");
|
||||||
const lastReturn = exec(`${ESLINT}${fix ? "--fix" : ""} docs/.eleventy.js`);
|
const lastReturn = exec(`${ESLINT}${fix ? "--fix" : ""} docs`);
|
||||||
|
|
||||||
if (lastReturn.code !== 0) {
|
if (lastReturn.code !== 0) {
|
||||||
errors++;
|
errors++;
|
||||||
@ -629,7 +641,6 @@ target.karma = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
target.test = function() {
|
target.test = function() {
|
||||||
target.lint();
|
|
||||||
target.checkRuleFiles();
|
target.checkRuleFiles();
|
||||||
target.mocha();
|
target.mocha();
|
||||||
target.karma();
|
target.karma();
|
||||||
@ -707,7 +718,8 @@ target.checkRuleFiles = function() {
|
|||||||
const basename = path.basename(filename, ".js");
|
const basename = path.basename(filename, ".js");
|
||||||
const docFilename = `docs/src/rules/${basename}.md`;
|
const docFilename = `docs/src/rules/${basename}.md`;
|
||||||
const docText = cat(docFilename);
|
const docText = cat(docFilename);
|
||||||
const docMarkdown = marked.lexer(docText, { gfm: true, silent: false });
|
const docTextWithoutFrontmatter = matter(String(docText)).content;
|
||||||
|
const docMarkdown = marked.lexer(docTextWithoutFrontmatter, { gfm: true, silent: false });
|
||||||
const ruleCode = cat(filename);
|
const ruleCode = cat(filename);
|
||||||
const knownHeaders = ["Rule Details", "Options", "Environments", "Examples", "Known Limitations", "When Not To Use It", "Compatibility"];
|
const knownHeaders = ["Rule Details", "Options", "Environments", "Examples", "Known Limitations", "When Not To Use It", "Compatibility"];
|
||||||
|
|
||||||
@ -823,16 +835,16 @@ target.checkRuleFiles = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check eslint:recommended
|
// check eslint:recommended
|
||||||
const recommended = require("./conf/eslint-recommended");
|
const recommended = require("./packages/js").configs.recommended;
|
||||||
|
|
||||||
if (ruleDef.meta.docs.recommended) {
|
if (ruleDef.meta.docs.recommended) {
|
||||||
if (recommended.rules[basename] !== "error") {
|
if (recommended.rules[basename] !== "error") {
|
||||||
console.error(`Missing rule from eslint:recommended (./conf/eslint-recommended.js): ${basename}. If you just made a rule recommended then add an entry for it in this file.`);
|
console.error(`Missing rule from eslint:recommended (./packages/js/src/configs/eslint-recommended.js): ${basename}. If you just made a rule recommended then add an entry for it in this file.`);
|
||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (basename in recommended.rules) {
|
if (basename in recommended.rules) {
|
||||||
console.error(`Extra rule in eslint:recommended (./conf/eslint-recommended.js): ${basename}. If you just added a rule then don't add an entry for it in this file.`);
|
console.error(`Extra rule in eslint:recommended (./packages/js/src/configs/eslint-recommended.js): ${basename}. If you just added a rule then don't add an entry for it in this file.`);
|
||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
112
eslint/README.md
112
eslint/README.md
@ -10,14 +10,14 @@
|
|||||||
# ESLint
|
# ESLint
|
||||||
|
|
||||||
[Website](https://eslint.org) |
|
[Website](https://eslint.org) |
|
||||||
[Configuring](https://eslint.org/docs/user-guide/configuring) |
|
[Configure ESLint](https://eslint.org/docs/latest/use/configure) |
|
||||||
[Rules](https://eslint.org/docs/rules/) |
|
[Rules](https://eslint.org/docs/rules/) |
|
||||||
[Contributing](https://eslint.org/docs/developer-guide/contributing) |
|
[Contribute to ESLint](https://eslint.org/docs/latest/contribute) |
|
||||||
[Reporting Bugs](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) |
|
[Report Bugs](https://eslint.org/docs/latest/contribute/report-bugs) |
|
||||||
[Code of Conduct](https://eslint.org/conduct) |
|
[Code of Conduct](https://eslint.org/conduct) |
|
||||||
[Twitter](https://twitter.com/geteslint) |
|
[Twitter](https://twitter.com/geteslint) |
|
||||||
[Mailing List](https://groups.google.com/group/eslint) |
|
[Discord](https://eslint.org/chat) |
|
||||||
[Chat Room](https://eslint.org/chat)
|
[Mastodon](https://fosstodon.org/@eslint)
|
||||||
|
|
||||||
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions:
|
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions:
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
|
|||||||
2. [Configuration](#configuration)
|
2. [Configuration](#configuration)
|
||||||
3. [Code of Conduct](#code-of-conduct)
|
3. [Code of Conduct](#code-of-conduct)
|
||||||
4. [Filing Issues](#filing-issues)
|
4. [Filing Issues](#filing-issues)
|
||||||
5. [Frequently Asked Questions](#faq)
|
5. [Frequently Asked Questions](#frequently-asked-questions)
|
||||||
6. [Releases](#releases)
|
6. [Releases](#releases)
|
||||||
7. [Security Policy](#security-policy)
|
7. [Security Policy](#security-policy)
|
||||||
8. [Semantic Versioning Policy](#semantic-versioning-policy)
|
8. [Semantic Versioning Policy](#semantic-versioning-policy)
|
||||||
@ -41,7 +41,7 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
|
|||||||
12. [Sponsors](#sponsors)
|
12. [Sponsors](#sponsors)
|
||||||
13. [Technology Sponsors](#technology-sponsors)
|
13. [Technology Sponsors](#technology-sponsors)
|
||||||
|
|
||||||
## <a name="installation-and-usage"></a>Installation and Usage
|
## Installation and Usage
|
||||||
|
|
||||||
Prerequisites: [Node.js](https://nodejs.org/) (`^12.22.0`, `^14.17.0`, or `>=16.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
|
Prerequisites: [Node.js](https://nodejs.org/) (`^12.22.0`, `^14.17.0`, or `>=16.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
|
||||||
|
|
||||||
@ -57,9 +57,9 @@ After that, you can run ESLint on any file or directory like this:
|
|||||||
./node_modules/.bin/eslint yourfile.js
|
./node_modules/.bin/eslint yourfile.js
|
||||||
```
|
```
|
||||||
|
|
||||||
## <a name="configuration"></a>Configuration
|
## Configuration
|
||||||
|
|
||||||
After running `npm init @eslint/config`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
|
After running `npm init @eslint/config`, you'll have an `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@ -76,28 +76,28 @@ The names `"semi"` and `"quotes"` are the names of [rules](https://eslint.org/do
|
|||||||
* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
|
* `"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)
|
* `"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](https://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/latest/use/configure)).
|
||||||
|
|
||||||
## <a name="code-of-conduct"></a>Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
ESLint adheres to the [JS Foundation Code of Conduct](https://eslint.org/conduct).
|
ESLint adheres to the [JS Foundation Code of Conduct](https://eslint.org/conduct).
|
||||||
|
|
||||||
## <a name="filing-issues"></a>Filing Issues
|
## Filing Issues
|
||||||
|
|
||||||
Before filing an issue, please be sure to read the guidelines for what you're reporting:
|
Before filing an issue, please be sure to read the guidelines for what you're reporting:
|
||||||
|
|
||||||
* [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs)
|
* [Bug Report](https://eslint.org/docs/latest/contribute/report-bugs)
|
||||||
* [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules)
|
* [Propose a New Rule](https://eslint.org/docs/latest/contribute/propose-new-rule)
|
||||||
* [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes)
|
* [Proposing a Rule Change](https://eslint.org/docs/latest/contribute/propose-rule-change)
|
||||||
* [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes)
|
* [Request a Change](https://eslint.org/docs/latest/contribute/request-change)
|
||||||
|
|
||||||
## <a name="faq"></a>Frequently Asked Questions
|
## Frequently Asked Questions
|
||||||
|
|
||||||
### I'm using JSCS, should I migrate to ESLint?
|
### I'm using JSCS, should I migrate to ESLint?
|
||||||
|
|
||||||
Yes. [JSCS has reached end of life](https://eslint.org/blog/2016/07/jscs-end-of-life) and is no longer supported.
|
Yes. [JSCS has reached end of life](https://eslint.org/blog/2016/07/jscs-end-of-life) and is no longer supported.
|
||||||
|
|
||||||
We have prepared a [migration guide](https://eslint.org/docs/user-guide/migrating-from-jscs) to help you convert your JSCS settings to an ESLint configuration.
|
We have prepared a [migration guide](https://eslint.org/docs/latest/use/migrating-from-jscs) to help you convert your JSCS settings to an ESLint configuration.
|
||||||
|
|
||||||
We are now at or near 100% compatibility with JSCS. If you try ESLint and believe we are not yet compatible with a JSCS rule/configuration, please create an issue (mentioning that it is a JSCS compatibility issue) and we will evaluate it as per our normal process.
|
We are now at or near 100% compatibility with JSCS. If you try ESLint and believe we are not yet compatible with a JSCS rule/configuration, please create an issue (mentioning that it is a JSCS compatibility issue) and we will evaluate it as per our normal process.
|
||||||
|
|
||||||
@ -113,11 +113,11 @@ No, ESLint does both traditional linting (looking for problematic patterns) and
|
|||||||
|
|
||||||
### Does ESLint support JSX?
|
### Does ESLint support JSX?
|
||||||
|
|
||||||
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.
|
Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/latest/use/configure)). 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 ECMAScript versions does ESLint support?
|
### What ECMAScript versions does ESLint support?
|
||||||
|
|
||||||
ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring).
|
ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/latest/use/configure).
|
||||||
|
|
||||||
### What about experimental features?
|
### What about experimental features?
|
||||||
|
|
||||||
@ -125,11 +125,11 @@ ESLint's parser only officially supports the latest final ECMAScript standard. W
|
|||||||
|
|
||||||
In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser) and [@babel/eslint-plugin](https://www.npmjs.com/package/@babel/eslint-plugin) to use any option available in Babel.
|
In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser) and [@babel/eslint-plugin](https://www.npmjs.com/package/@babel/eslint-plugin) 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](https://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/latest/contribute). Until then, please use the appropriate parser and plugin(s) for your experimental feature.
|
||||||
|
|
||||||
### Where to ask for help?
|
### Where to ask for help?
|
||||||
|
|
||||||
Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://eslint.org/chat).
|
Open a [discussion](https://github.com/eslint/eslint/discussions) or stop by our [Discord server](https://eslint.org/chat).
|
||||||
|
|
||||||
### Why doesn't ESLint lock dependency versions?
|
### Why doesn't ESLint lock dependency versions?
|
||||||
|
|
||||||
@ -141,15 +141,15 @@ We intentionally don't lock dependency versions so that we have the latest compa
|
|||||||
|
|
||||||
The Twilio blog has a [deeper dive](https://www.twilio.com/blog/lockfiles-nodejs) to learn more.
|
The Twilio blog has a [deeper dive](https://www.twilio.com/blog/lockfiles-nodejs) to learn more.
|
||||||
|
|
||||||
## <a name="releases"></a>Releases
|
## Releases
|
||||||
|
|
||||||
We have scheduled releases every two weeks on Friday or Saturday. You can follow a [release issue](https://github.com/eslint/eslint/issues?q=is%3Aopen+is%3Aissue+label%3Arelease) for updates about the scheduling of any particular release.
|
We have scheduled releases every two weeks on Friday or Saturday. You can follow a [release issue](https://github.com/eslint/eslint/issues?q=is%3Aopen+is%3Aissue+label%3Arelease) for updates about the scheduling of any particular release.
|
||||||
|
|
||||||
## <a name="security-policy"></a>Security Policy
|
## Security Policy
|
||||||
|
|
||||||
ESLint takes security seriously. We work hard to ensure that ESLint is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md).
|
ESLint takes security seriously. We work hard to ensure that ESLint is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md).
|
||||||
|
|
||||||
## <a name="semantic-versioning-policy"></a>Semantic Versioning Policy
|
## Semantic Versioning Policy
|
||||||
|
|
||||||
ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint:
|
ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint:
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ ESLint follows [semantic versioning](https://semver.org). However, due to the na
|
|||||||
|
|
||||||
According to our policy, any minor update may report more linting errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds.
|
According to our policy, any minor update may report more linting errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds.
|
||||||
|
|
||||||
## <a name="stylistic-rule-updates"></a>Stylistic Rule Updates
|
## Stylistic Rule Updates
|
||||||
|
|
||||||
Stylistic rules are frozen according to [our policy](https://eslint.org/blog/2020/05/changes-to-rules-policies) on how we evaluate new rules and rule changes.
|
Stylistic rules are frozen according to [our policy](https://eslint.org/blog/2020/05/changes-to-rules-policies) on how we evaluate new rules and rule changes.
|
||||||
This means:
|
This means:
|
||||||
@ -191,11 +191,11 @@ This means:
|
|||||||
* **New ECMAScript features**: We will also make sure stylistic rules are compatible with new ECMAScript features.
|
* **New ECMAScript features**: We will also make sure stylistic rules are compatible with new ECMAScript features.
|
||||||
* **New options**: We will **not** add any new options to stylistic rules unless an option is the only way to fix a bug or support a newly-added ECMAScript feature.
|
* **New options**: We will **not** add any new options to stylistic rules unless an option is the only way to fix a bug or support a newly-added ECMAScript feature.
|
||||||
|
|
||||||
## <a name="license"></a>License
|
## License
|
||||||
|
|
||||||
[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_large)
|
[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_large)
|
||||||
|
|
||||||
## <a name="team"></a>Team
|
## Team
|
||||||
|
|
||||||
These folks keep the project moving and are resources for help.
|
These folks keep the project moving and are resources for help.
|
||||||
|
|
||||||
@ -213,11 +213,6 @@ The people who manage releases, review feature requests, and meet regularly to e
|
|||||||
Nicholas C. Zakas
|
Nicholas C. Zakas
|
||||||
</a>
|
</a>
|
||||||
</td><td align="center" valign="top" width="11%">
|
</td><td align="center" valign="top" width="11%">
|
||||||
<a href="https://github.com/btmills">
|
|
||||||
<img src="https://github.com/btmills.png?s=75" width="75" height="75"><br />
|
|
||||||
Brandon Mills
|
|
||||||
</a>
|
|
||||||
</td><td align="center" valign="top" width="11%">
|
|
||||||
<a href="https://github.com/mdjermanovic">
|
<a href="https://github.com/mdjermanovic">
|
||||||
<img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75"><br />
|
<img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75"><br />
|
||||||
Milos Djermanovic
|
Milos Djermanovic
|
||||||
@ -245,53 +240,54 @@ Nitin Kumar
|
|||||||
The people who review and fix bugs and help triage issues.
|
The people who review and fix bugs and help triage issues.
|
||||||
|
|
||||||
<table><tbody><tr><td align="center" valign="top" width="11%">
|
<table><tbody><tr><td align="center" valign="top" width="11%">
|
||||||
<a href="https://github.com/brettz9">
|
|
||||||
<img src="https://github.com/brettz9.png?s=75" width="75" height="75"><br />
|
|
||||||
Brett Zamir
|
|
||||||
</a>
|
|
||||||
</td><td align="center" valign="top" width="11%">
|
|
||||||
<a href="https://github.com/bmish">
|
<a href="https://github.com/bmish">
|
||||||
<img src="https://github.com/bmish.png?s=75" width="75" height="75"><br />
|
<img src="https://github.com/bmish.png?s=75" width="75" height="75"><br />
|
||||||
Bryan Mishkin
|
Bryan Mishkin
|
||||||
</a>
|
</a>
|
||||||
</td><td align="center" valign="top" width="11%">
|
</td><td align="center" valign="top" width="11%">
|
||||||
<a href="https://github.com/SaraSoueidan">
|
<a href="https://github.com/fasttime">
|
||||||
<img src="https://github.com/SaraSoueidan.png?s=75" width="75" height="75"><br />
|
<img src="https://github.com/fasttime.png?s=75" width="75" height="75"><br />
|
||||||
Sara Soueidan
|
Francesco Trotta
|
||||||
|
</a>
|
||||||
|
</td></tr></tbody></table>
|
||||||
|
|
||||||
|
### Website Team
|
||||||
|
|
||||||
|
Team members who focus specifically on eslint.org
|
||||||
|
|
||||||
|
<table><tbody><tr><td align="center" valign="top" width="11%">
|
||||||
|
<a href="https://github.com/amareshsm">
|
||||||
|
<img src="https://github.com/amareshsm.png?s=75" width="75" height="75"><br />
|
||||||
|
Amaresh S M
|
||||||
</a>
|
</a>
|
||||||
</td><td align="center" valign="top" width="11%">
|
</td><td align="center" valign="top" width="11%">
|
||||||
<a href="https://github.com/g-plane">
|
<a href="https://github.com/harish-sethuraman">
|
||||||
<img src="https://github.com/g-plane.png?s=75" width="75" height="75"><br />
|
<img src="https://github.com/harish-sethuraman.png?s=75" width="75" height="75"><br />
|
||||||
Pig Fang
|
Strek
|
||||||
</a>
|
</a>
|
||||||
</td><td align="center" valign="top" width="11%">
|
</td><td align="center" valign="top" width="11%">
|
||||||
<a href="https://github.com/anikethsaha">
|
<a href="https://github.com/kecrily">
|
||||||
<img src="https://github.com/anikethsaha.png?s=75" width="75" height="75"><br />
|
<img src="https://github.com/kecrily.png?s=75" width="75" height="75"><br />
|
||||||
Anix
|
Percy Ma
|
||||||
</a>
|
|
||||||
</td><td align="center" valign="top" width="11%">
|
|
||||||
<a href="https://github.com/yeonjuan">
|
|
||||||
<img src="https://github.com/yeonjuan.png?s=75" width="75" height="75"><br />
|
|
||||||
YeonJuan
|
|
||||||
</a>
|
</a>
|
||||||
</td></tr></tbody></table>
|
</td></tr></tbody></table>
|
||||||
|
|
||||||
<!--teamend-->
|
<!--teamend-->
|
||||||
|
|
||||||
## <a name="sponsors"></a>Sponsors
|
## Sponsors
|
||||||
|
|
||||||
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://opencollective.com/eslint) to get your logo on our README and website.
|
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://opencollective.com/eslint) to get your logo on our README and website.
|
||||||
|
|
||||||
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
|
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
|
||||||
<!--sponsorsstart-->
|
<!--sponsorsstart-->
|
||||||
<h3>Platinum Sponsors</h3>
|
<h3>Platinum Sponsors</h3>
|
||||||
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="undefined"></a></p><h3>Gold Sponsors</h3>
|
<p><a href="#"><img src="https://images.opencollective.com/2021-frameworks-fund/logo.png" alt="Chrome Frameworks Fund" height="undefined"></a> <a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="undefined"></a></p><h3>Gold Sponsors</h3>
|
||||||
<p><a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="96"></a></p><h3>Silver Sponsors</h3>
|
<p><a href="https://engineering.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a></p><h3>Silver Sponsors</h3>
|
||||||
<p><a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a></p><h3>Bronze Sponsors</h3>
|
<p><a href="https://sentry.io"><img src="https://avatars.githubusercontent.com/u/1396951?v=4" alt="Sentry" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="64"></a></p><h3>Bronze Sponsors</h3>
|
||||||
<p><a href="https://launchdarkly.com"><img src="https://images.opencollective.com/launchdarkly/574bb9e/logo.png" alt="launchdarkly" height="32"></a> <a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://www.ignitionapp.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Ignition" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774?v=4" alt="HeroCoders" height="32"></a></p>
|
<p><a href="https://www.vedonlyontibonukset.com/pitkavetovihjeet"><img src="https://images.opencollective.com/pitkavetovihjeet/0131f1d/logo.png" alt="Ilmaiset Pitkävetovihjeet" height="32"></a> <a href="https://paydaysay.com/"><img src="https://images.opencollective.com/payday-say-organization/9cd2467/logo.png" alt="PayDay Say" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://transloadit.com/"><img src="https://avatars.githubusercontent.com/u/125754?v=4" alt="Transloadit" height="32"></a> <a href="https://www.ignitionapp.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Ignition" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774?v=4" alt="HeroCoders" height="32"></a> <a href="https://quickbookstoolhub.com"><img src="https://avatars.githubusercontent.com/u/95090305?u=e5bc398ef775c9ed19f955c675cdc1fb6abf01df&v=4" alt="QuickBooks Tool hub" height="32"></a></p>
|
||||||
<!--sponsorsend-->
|
<!--sponsorsend-->
|
||||||
|
|
||||||
## <a name="technology-sponsors"></a>Technology Sponsors
|
## Technology Sponsors
|
||||||
|
|
||||||
* Site search ([eslint.org](https://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)
|
||||||
* Hosting for ([eslint.org](https://eslint.org)) is sponsored by [Netlify](https://www.netlify.com)
|
* Hosting for ([eslint.org](https://eslint.org)) is sponsored by [Netlify](https://www.netlify.com)
|
||||||
|
@ -6,12 +6,12 @@
|
|||||||
],
|
],
|
||||||
"deprecated": {
|
"deprecated": {
|
||||||
"name": "Deprecated",
|
"name": "Deprecated",
|
||||||
"description": "These rules have been deprecated in accordance with the <a href=\"/docs/user-guide/rule-deprecation\">deprecation policy</a>, and replaced by newer rules:",
|
"description": "These rules have been deprecated in accordance with the <a href=\"{{ '/use/rule-deprecation' | url }}\">deprecation policy</a>, and replaced by newer rules:",
|
||||||
"rules": []
|
"rules": []
|
||||||
},
|
},
|
||||||
"removed": {
|
"removed": {
|
||||||
"name": "Removed",
|
"name": "Removed",
|
||||||
"description": "These rules from older versions of ESLint (before the <a href=\"/docs/user-guide/rule-deprecation\">deprecation policy</a> existed) have been replaced by newer rules:",
|
"description": "These rules from older versions of ESLint (before the <a href=\"{{ '/use/rule-deprecation' | url }}\">deprecation policy</a> existed) have been replaced by newer rules:",
|
||||||
"rules": [
|
"rules": [
|
||||||
{ "removed": "generator-star", "replacedBy": ["generator-star-spacing"] },
|
{ "removed": "generator-star", "replacedBy": ["generator-star-spacing"] },
|
||||||
{ "removed": "global-strict", "replacedBy": ["strict"] },
|
{ "removed": "global-strict", "replacedBy": ["strict"] },
|
||||||
|
@ -10,7 +10,7 @@ const Image = require("@11ty/eleventy-img");
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const { slug } = require("github-slugger");
|
const { slug } = require("github-slugger");
|
||||||
const yaml = require("js-yaml");
|
const yaml = require("js-yaml");
|
||||||
|
const { highlighter, lineNumberPlugin } = require("./src/_plugins/md-syntax-highlighter");
|
||||||
const {
|
const {
|
||||||
DateTime
|
DateTime
|
||||||
} = require("luxon");
|
} = require("luxon");
|
||||||
@ -25,8 +25,9 @@ module.exports = function(eleventyConfig) {
|
|||||||
* it's easier to see if URLs are broken.
|
* it's easier to see if URLs are broken.
|
||||||
*
|
*
|
||||||
* When a release is published, HEAD is pushed to the "latest" branch.
|
* When a release is published, HEAD is pushed to the "latest" branch.
|
||||||
* Netlify deploys that branch as well, and in that case, we want the
|
* When a pre-release is published, HEAD is pushed to the "next" branch.
|
||||||
* docs to be loaded from /docs/latest on eslint.org.
|
* Netlify deploys those branches as well, and in that case, we want the
|
||||||
|
* docs to be loaded from /docs/latest or /docs/next on eslint.org.
|
||||||
*
|
*
|
||||||
* The path prefix is turned off for deploy previews so we can properly
|
* The path prefix is turned off for deploy previews so we can properly
|
||||||
* see changes before deployed.
|
* see changes before deployed.
|
||||||
@ -38,6 +39,8 @@ module.exports = function(eleventyConfig) {
|
|||||||
pathPrefix = "/";
|
pathPrefix = "/";
|
||||||
} else if (process.env.BRANCH === "latest") {
|
} else if (process.env.BRANCH === "latest") {
|
||||||
pathPrefix = "/docs/latest/";
|
pathPrefix = "/docs/latest/";
|
||||||
|
} else if (process.env.BRANCH === "next") {
|
||||||
|
pathPrefix = "/docs/next/";
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -49,6 +52,7 @@ module.exports = function(eleventyConfig) {
|
|||||||
|
|
||||||
eleventyConfig.addGlobalData("site_name", siteName);
|
eleventyConfig.addGlobalData("site_name", siteName);
|
||||||
eleventyConfig.addGlobalData("GIT_BRANCH", process.env.BRANCH);
|
eleventyConfig.addGlobalData("GIT_BRANCH", process.env.BRANCH);
|
||||||
|
eleventyConfig.addGlobalData("HEAD", process.env.BRANCH === "main");
|
||||||
eleventyConfig.addGlobalData("NOINDEX", process.env.BRANCH !== "latest");
|
eleventyConfig.addGlobalData("NOINDEX", process.env.BRANCH !== "latest");
|
||||||
eleventyConfig.addDataExtension("yml", contents => yaml.load(contents));
|
eleventyConfig.addDataExtension("yml", contents => yaml.load(contents));
|
||||||
|
|
||||||
@ -60,23 +64,12 @@ module.exports = function(eleventyConfig) {
|
|||||||
|
|
||||||
eleventyConfig.addFilter("jsonify", variable => JSON.stringify(variable));
|
eleventyConfig.addFilter("jsonify", variable => JSON.stringify(variable));
|
||||||
|
|
||||||
/**
|
|
||||||
* Takes in a string and converts to a slug
|
|
||||||
* @param {string} text text to be converted into slug
|
|
||||||
* @returns {string} slug to be used as anchors
|
|
||||||
*/
|
|
||||||
function slugify(text) {
|
|
||||||
return slug(text.replace(/[<>()[\]{}]/gu, ""))
|
|
||||||
// eslint-disable-next-line no-control-regex -- used regex from https://github.com/eslint/archive-website/blob/master/_11ty/plugins/markdown-plugins.js#L37
|
|
||||||
.replace(/[^\u{00}-\u{FF}]/gu, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
eleventyConfig.addFilter("slugify", str => {
|
eleventyConfig.addFilter("slugify", str => {
|
||||||
if (!str) {
|
if (!str) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return slugify(str);
|
return slug(str);
|
||||||
});
|
});
|
||||||
|
|
||||||
eleventyConfig.addFilter("URIencode", str => {
|
eleventyConfig.addFilter("URIencode", str => {
|
||||||
@ -145,7 +138,8 @@ module.exports = function(eleventyConfig) {
|
|||||||
|
|
||||||
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
||||||
eleventyConfig.addPlugin(syntaxHighlight, {
|
eleventyConfig.addPlugin(syntaxHighlight, {
|
||||||
alwaysWrapLineHighlights: true
|
alwaysWrapLineHighlights: true,
|
||||||
|
templateFormats: ["liquid", "njk"]
|
||||||
});
|
});
|
||||||
eleventyConfig.addPlugin(pluginRss);
|
eleventyConfig.addPlugin(pluginRss);
|
||||||
eleventyConfig.addPlugin(pluginTOC, {
|
eleventyConfig.addPlugin(pluginTOC, {
|
||||||
@ -186,30 +180,32 @@ module.exports = function(eleventyConfig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const markdownIt = require("markdown-it");
|
const markdownIt = require("markdown-it");
|
||||||
|
const md = markdownIt({ html: true, linkify: true, typographer: true, highlight: (str, lang) => highlighter(md, str, lang) })
|
||||||
|
.use(markdownItAnchor, {
|
||||||
|
slugify: s => slug(s)
|
||||||
|
})
|
||||||
|
.use(markdownItContainer, "img-container", {})
|
||||||
|
.use(markdownItContainer, "correct", {})
|
||||||
|
.use(markdownItContainer, "incorrect", {})
|
||||||
|
.use(markdownItContainer, "warning", {
|
||||||
|
render(tokens, idx) {
|
||||||
|
return generateAlertMarkup("warning", tokens, idx);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.use(markdownItContainer, "tip", {
|
||||||
|
render(tokens, idx) {
|
||||||
|
return generateAlertMarkup("tip", tokens, idx);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.use(markdownItContainer, "important", {
|
||||||
|
render(tokens, idx) {
|
||||||
|
return generateAlertMarkup("important", tokens, idx);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.use(lineNumberPlugin)
|
||||||
|
.disable("code");
|
||||||
|
|
||||||
eleventyConfig.setLibrary("md",
|
eleventyConfig.setLibrary("md", md);
|
||||||
markdownIt({ html: true, linkify: true, typographer: true })
|
|
||||||
.use(markdownItAnchor, {
|
|
||||||
slugify
|
|
||||||
})
|
|
||||||
.use(markdownItContainer, "correct", {})
|
|
||||||
.use(markdownItContainer, "incorrect", {})
|
|
||||||
.use(markdownItContainer, "warning", {
|
|
||||||
render(tokens, idx) {
|
|
||||||
return generateAlertMarkup("warning", tokens, idx);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.use(markdownItContainer, "tip", {
|
|
||||||
render(tokens, idx) {
|
|
||||||
return generateAlertMarkup("tip", tokens, idx);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.use(markdownItContainer, "important", {
|
|
||||||
render(tokens, idx) {
|
|
||||||
return generateAlertMarkup("important", tokens, idx);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.disable("code"));
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Shortcodes
|
// Shortcodes
|
||||||
@ -247,7 +243,7 @@ module.exports = function(eleventyConfig) {
|
|||||||
|
|
||||||
eleventyConfig.addShortcode("fixable", () => `
|
eleventyConfig.addShortcode("fixable", () => `
|
||||||
<div class="rule-category">
|
<div class="rule-category">
|
||||||
<span class="rule-category__icon">🛠 <span class="visually-hidden">Fixable</span></span>
|
<span class="rule-category__icon">🔧 <span class="visually-hidden">Fixable</span></span>
|
||||||
<p class="rule-category__description">
|
<p class="rule-category__description">
|
||||||
if some problems reported by the rule are automatically fixable by the <code>--fix</code> command line option
|
if some problems reported by the rule are automatically fixable by the <code>--fix</code> command line option
|
||||||
</p>
|
</p>
|
||||||
@ -452,7 +448,7 @@ module.exports = function(eleventyConfig) {
|
|||||||
* URLs with a file extension, like main.css, main.js, sitemap.xml, etc. should not be rewritten
|
* URLs with a file extension, like main.css, main.js, sitemap.xml, etc. should not be rewritten
|
||||||
*/
|
*/
|
||||||
eleventyConfig.setBrowserSyncConfig({
|
eleventyConfig.setBrowserSyncConfig({
|
||||||
middleware: (req, res, next) => {
|
middleware(req, res, next) {
|
||||||
if (!/(?:\.[a-zA-Z][^/]*|\/)$/u.test(req.url)) {
|
if (!/(?:\.[a-zA-Z][^/]*|\/)$/u.test(req.url)) {
|
||||||
req.url += ".html";
|
req.url += ".html";
|
||||||
}
|
}
|
||||||
|
33
eslint/docs/.stylelintrc.json
Normal file
33
eslint/docs/.stylelintrc.json
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"extends": ["stylelint-config-standard-scss"],
|
||||||
|
"rules": {
|
||||||
|
"alpha-value-notation": "number",
|
||||||
|
"at-rule-empty-line-before": null,
|
||||||
|
"color-function-notation": "legacy",
|
||||||
|
"custom-property-empty-line-before": null,
|
||||||
|
"custom-property-pattern": null,
|
||||||
|
"declaration-block-no-duplicate-properties": [true, {
|
||||||
|
"ignore": ["consecutive-duplicates-with-different-values"]
|
||||||
|
}],
|
||||||
|
"declaration-block-no-redundant-longhand-properties": null,
|
||||||
|
"hue-degree-notation": "number",
|
||||||
|
"indentation": 4,
|
||||||
|
"max-line-length": null,
|
||||||
|
"no-descending-specificity": null,
|
||||||
|
"number-leading-zero": null,
|
||||||
|
"number-no-trailing-zeros": null,
|
||||||
|
"selector-class-pattern": null,
|
||||||
|
"value-keyword-case": null
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"**/*.html"
|
||||||
|
],
|
||||||
|
"extends": ["stylelint-config-html/html", "stylelint-config-standard"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ignoreFiles": [
|
||||||
|
"_site/**"
|
||||||
|
]
|
||||||
|
}
|
@ -1,11 +1,25 @@
|
|||||||
# ESLint Documentation
|
# ESLint Documentation
|
||||||
|
|
||||||
|
## Install Dependencies
|
||||||
|
|
||||||
|
Install the necessary dependencies for the documentation site by running this
|
||||||
|
from the `docs` folder:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
## Run Locally
|
## Run Locally
|
||||||
|
|
||||||
|
Run this from the `docs` folder:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Once the script finishes building the documentation site, you can visit it at
|
||||||
|
<http://localhost:2023>.
|
||||||
|
|
||||||
## Scripts
|
## Scripts
|
||||||
|
|
||||||
To update the links data file, run this from the root folder (not the `docs` folder):
|
To update the links data file, run this from the root folder (not the `docs` folder):
|
||||||
@ -25,3 +39,7 @@ To autofix JS files, run this from the root folder (not the `docs` folder):
|
|||||||
```shell
|
```shell
|
||||||
npm run fix:docsjs
|
npm run fix:docsjs
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
© OpenJS Foundation and ESLint contributors, [www.openjsf.org](https://www.openjsf.org/). Content licensed under [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/).
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "docs-eslint",
|
"name": "docs-eslint",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "8.23.1",
|
"version": "8.41.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
@ -10,12 +10,17 @@
|
|||||||
"files": [],
|
"files": [],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"images": "imagemin '_site/assets/images' --out-dir='_site/assets/images'",
|
"images": "imagemin '_site/assets/images' --out-dir='_site/assets/images'",
|
||||||
"watch:sass": "sass --watch --poll src/assets/scss:src/assets/css",
|
"watch:postcss": "postcss src/assets/css -d src/assets/css --watch --poll",
|
||||||
|
"watch:sass": "sass --watch --poll src/assets/scss:src/assets/css --no-source-map",
|
||||||
"watch:eleventy": "eleventy --serve --port=2023",
|
"watch:eleventy": "eleventy --serve --port=2023",
|
||||||
"build:sass": "sass --style=compressed src/assets/scss:src/assets/css --no-source-map",
|
"build:postcss": "postcss src/assets/css -d src/assets/css",
|
||||||
|
"build:sass": "sass src/assets/scss:src/assets/css --no-source-map",
|
||||||
"build:eleventy": "npx @11ty/eleventy",
|
"build:eleventy": "npx @11ty/eleventy",
|
||||||
"start": "npm-run-all build:sass --parallel watch:*",
|
"start": "npm-run-all build:sass build:postcss --parallel watch:*",
|
||||||
"build": "npm-run-all build:sass build:eleventy images"
|
"build": "npm-run-all build:sass build:postcss build:eleventy images",
|
||||||
|
"lint:scss": "stylelint \"**/*.{scss,html}\"",
|
||||||
|
"lint:links": "cross-env NODE_OPTIONS=--max-old-space-size=4096 node tools/validate-links.js",
|
||||||
|
"lint:fix:scss": "npm run lint:scss -- --fix"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@11ty/eleventy": "^1.0.1",
|
"@11ty/eleventy": "^1.0.1",
|
||||||
@ -23,13 +28,18 @@
|
|||||||
"@11ty/eleventy-navigation": "^0.3.2",
|
"@11ty/eleventy-navigation": "^0.3.2",
|
||||||
"@11ty/eleventy-plugin-rss": "^1.1.1",
|
"@11ty/eleventy-plugin-rss": "^1.1.1",
|
||||||
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2",
|
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2",
|
||||||
|
"@munter/tap-render": "^0.2.0",
|
||||||
"@types/markdown-it": "^12.2.3",
|
"@types/markdown-it": "^12.2.3",
|
||||||
"algoliasearch": "^4.12.1",
|
"algoliasearch": "^4.12.1",
|
||||||
|
"autoprefixer": "^10.4.13",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"cssnano": "^5.1.14",
|
||||||
"dom-parser": "^0.1.6",
|
"dom-parser": "^0.1.6",
|
||||||
"eleventy-plugin-nesting-toc": "^1.3.0",
|
"eleventy-plugin-nesting-toc": "^1.3.0",
|
||||||
"eleventy-plugin-page-assets": "^0.3.0",
|
"eleventy-plugin-page-assets": "^0.3.0",
|
||||||
"eleventy-plugin-reading-time": "^0.0.1",
|
"eleventy-plugin-reading-time": "^0.0.1",
|
||||||
"github-slugger": "^1.4.0",
|
"github-slugger": "^1.5.0",
|
||||||
|
"hyperlink": "^5.0.4",
|
||||||
"imagemin": "^8.0.1",
|
"imagemin": "^8.0.1",
|
||||||
"imagemin-cli": "^7.0.0",
|
"imagemin-cli": "^7.0.0",
|
||||||
"js-yaml": "^3.14.1",
|
"js-yaml": "^3.14.1",
|
||||||
@ -39,10 +49,22 @@
|
|||||||
"markdown-it-container": "^3.0.0",
|
"markdown-it-container": "^3.0.0",
|
||||||
"netlify-cli": "^10.3.1",
|
"netlify-cli": "^10.3.1",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
|
"postcss-cli": "^10.0.0",
|
||||||
|
"postcss-html": "^1.5.0",
|
||||||
|
"prismjs": "^1.29.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"sass": "^1.52.1"
|
"sass": "^1.52.1",
|
||||||
|
"stylelint": "^14.13.0",
|
||||||
|
"stylelint-config-html": "^1.1.0",
|
||||||
|
"stylelint-config-standard": "^29.0.0",
|
||||||
|
"stylelint-config-standard-scss": "^5.0.0",
|
||||||
|
"tap-spot": "^1.1.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
}
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"defaults",
|
||||||
|
"IE 11"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
9
eslint/docs/postcss.config.js
Normal file
9
eslint/docs/postcss.config.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
plugins: [
|
||||||
|
require("autoprefixer"),
|
||||||
|
require("cssnano")
|
||||||
|
],
|
||||||
|
map: false
|
||||||
|
};
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"version": "7.26.0"
|
"version": "7.26.0",
|
||||||
|
"showNextVersion": false
|
||||||
}
|
}
|
||||||
|
@ -698,5 +698,26 @@
|
|||||||
"logo": "https://eslint.org/apple-touch-icon.png",
|
"logo": "https://eslint.org/apple-touch-icon.png",
|
||||||
"title": "Interesting bugs caught by no-constant-binary-expression - ESLint - Pluggable JavaScript Linter",
|
"title": "Interesting bugs caught by no-constant-binary-expression - ESLint - Pluggable JavaScript Linter",
|
||||||
"description": "A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease."
|
"description": "A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease."
|
||||||
|
},
|
||||||
|
"https://github.com/tc39/proposal-class-static-block": {
|
||||||
|
"domain": "github.com",
|
||||||
|
"url": "https://github.com/tc39/proposal-class-static-block",
|
||||||
|
"logo": "https://github.com/fluidicon.png",
|
||||||
|
"title": "GitHub - tc39/proposal-class-static-block: ECMAScript class static initialization blocks",
|
||||||
|
"description": "ECMAScript class static initialization blocks. Contribute to tc39/proposal-class-static-block development by creating an account on GitHub."
|
||||||
|
},
|
||||||
|
"https://tc39.es/ecma262/#sec-symbol-constructor": {
|
||||||
|
"domain": "tc39.es",
|
||||||
|
"url": "https://tc39.es/ecma262/#sec-symbol-constructor",
|
||||||
|
"logo": "https://tc39.es/ecma262/img/favicon.ico",
|
||||||
|
"title": "ECMAScript® 2023 Language Specification",
|
||||||
|
"description": null
|
||||||
|
},
|
||||||
|
"https://tc39.es/ecma262/#sec-bigint-constructor": {
|
||||||
|
"domain": "tc39.es",
|
||||||
|
"url": "https://tc39.es/ecma262/#sec-bigint-constructor",
|
||||||
|
"logo": "https://tc39.es/ecma262/img/favicon.ico",
|
||||||
|
"title": "ECMAScript® 2023 Language Specification",
|
||||||
|
"description": null
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -7,9 +7,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"flag": "🇯🇵",
|
"flag": "🇯🇵",
|
||||||
"code": "jp",
|
"code": "ja",
|
||||||
"name": "Japanese - 日本語",
|
"name": "Japanese - 日本語",
|
||||||
"url": "https://jp.eslint.org"
|
"url": "https://ja.eslint.org"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"flag": "🇫🇷",
|
"flag": "🇫🇷",
|
||||||
|
1
eslint/docs/src/_data/layout.js
Normal file
1
eslint/docs/src/_data/layout.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
module.exports = "doc.html";
|
@ -2,21 +2,18 @@
|
|||||||
"github": "https://github.com/eslint/eslint",
|
"github": "https://github.com/eslint/eslint",
|
||||||
"twitter": "https://twitter.com/geteslint",
|
"twitter": "https://twitter.com/geteslint",
|
||||||
"chat": "https://eslint.org/chat",
|
"chat": "https://eslint.org/chat",
|
||||||
"group": "https://groups.google.com/group/eslint",
|
"mastodon": "https://fosstodon.org/@eslint",
|
||||||
|
|
||||||
"blog": "/blog",
|
"blog": "/blog",
|
||||||
"docs": "/docs/latest/",
|
"docs": "/docs/latest/",
|
||||||
"playground": "/play",
|
"playground": "/play",
|
||||||
"getStarted": "/docs/latest/user-guide/getting-started",
|
"getStarted": "/docs/latest/use/getting-started",
|
||||||
"sponsors": "/sponsors",
|
"sponsors": "/sponsors",
|
||||||
"branding": "/branding",
|
"branding": "/branding",
|
||||||
"store": "https://eslint.threadless.com",
|
"store": "https://eslint.threadless.com",
|
||||||
"team": "/team",
|
"team": "/team",
|
||||||
|
"configuring": "https://eslint.org/docs/latest/use/configure/",
|
||||||
"configuring": "https://eslint.org/docs/user-guide/configuring/",
|
"fixProblems": "https://eslint.org/docs/latest/use/command-line-interface#fix-problems",
|
||||||
"fixProblems": "https://eslint.org/docs/user-guide/command-line-interface#fixing-problems",
|
|
||||||
|
|
||||||
"donate": "/donate",
|
"donate": "/donate",
|
||||||
"openCollective": "https://opencollective.com/eslint",
|
"openCollective": "https://opencollective.com/eslint",
|
||||||
"githubSponsors": "https://github.com/sponsors/eslint"
|
"githubSponsors": "https://github.com/sponsors/eslint"
|
||||||
}
|
}
|
@ -304,7 +304,10 @@
|
|||||||
"wrap-iife": "0.0.9",
|
"wrap-iife": "0.0.9",
|
||||||
"wrap-regex": "0.1.0",
|
"wrap-regex": "0.1.0",
|
||||||
"yield-star-spacing": "2.0.0-alpha-1",
|
"yield-star-spacing": "2.0.0-alpha-1",
|
||||||
"yoda": "0.7.1"
|
"yoda": "0.7.1",
|
||||||
|
"logical-assignment-operators": "8.24.0",
|
||||||
|
"no-empty-static-block": "8.27.0",
|
||||||
|
"no-new-native-nonconstructor": "8.27.0"
|
||||||
},
|
},
|
||||||
"removed": {
|
"removed": {
|
||||||
"generator-star": "1.0.0-rc-1",
|
"generator-star": "1.0.0-rc-1",
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "for-direction",
|
"name": "for-direction",
|
||||||
"description": "Enforce \"for\" loop update clause moving the counter in the right direction.",
|
"description": "Enforce \"for\" loop update clause moving the counter in the right direction",
|
||||||
"recommended": true,
|
"recommended": true,
|
||||||
"fixable": false,
|
"fixable": false,
|
||||||
"hasSuggestions": false
|
"hasSuggestions": false
|
||||||
@ -229,6 +229,13 @@
|
|||||||
"fixable": false,
|
"fixable": false,
|
||||||
"hasSuggestions": true
|
"hasSuggestions": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "no-new-native-nonconstructor",
|
||||||
|
"description": "Disallow `new` operators with global non-constructor functions",
|
||||||
|
"recommended": false,
|
||||||
|
"fixable": false,
|
||||||
|
"hasSuggestions": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "no-new-symbol",
|
"name": "no-new-symbol",
|
||||||
"description": "Disallow `new` operators with the `Symbol` object",
|
"description": "Disallow `new` operators with the `Symbol` object",
|
||||||
@ -579,6 +586,13 @@
|
|||||||
"fixable": false,
|
"fixable": false,
|
||||||
"hasSuggestions": false
|
"hasSuggestions": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "logical-assignment-operators",
|
||||||
|
"description": "Require or disallow logical assignment operator shorthand",
|
||||||
|
"recommended": false,
|
||||||
|
"fixable": true,
|
||||||
|
"hasSuggestions": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "max-classes-per-file",
|
"name": "max-classes-per-file",
|
||||||
"description": "Enforce a maximum number of classes per file",
|
"description": "Enforce a maximum number of classes per file",
|
||||||
@ -707,7 +721,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "no-div-regex",
|
"name": "no-div-regex",
|
||||||
"description": "Disallow division operators explicitly at the beginning of regular expressions",
|
"description": "Disallow equal signs explicitly at the beginning of regular expressions",
|
||||||
"recommended": false,
|
"recommended": false,
|
||||||
"fixable": true,
|
"fixable": true,
|
||||||
"hasSuggestions": false
|
"hasSuggestions": false
|
||||||
@ -724,7 +738,7 @@
|
|||||||
"description": "Disallow empty block statements",
|
"description": "Disallow empty block statements",
|
||||||
"recommended": true,
|
"recommended": true,
|
||||||
"fixable": false,
|
"fixable": false,
|
||||||
"hasSuggestions": false
|
"hasSuggestions": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "no-empty-function",
|
"name": "no-empty-function",
|
||||||
@ -733,6 +747,13 @@
|
|||||||
"fixable": false,
|
"fixable": false,
|
||||||
"hasSuggestions": false
|
"hasSuggestions": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "no-empty-static-block",
|
||||||
|
"description": "Disallow empty static blocks",
|
||||||
|
"recommended": false,
|
||||||
|
"fixable": false,
|
||||||
|
"hasSuggestions": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "no-eq-null",
|
"name": "no-eq-null",
|
||||||
"description": "Disallow `null` comparisons without type-checking operators",
|
"description": "Disallow `null` comparisons without type-checking operators",
|
||||||
@ -1046,7 +1067,7 @@
|
|||||||
"description": "Disallow unnecessary `return await`",
|
"description": "Disallow unnecessary `return await`",
|
||||||
"recommended": false,
|
"recommended": false,
|
||||||
"fixable": false,
|
"fixable": false,
|
||||||
"hasSuggestions": false
|
"hasSuggestions": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "no-script-url",
|
"name": "no-script-url",
|
||||||
@ -1277,7 +1298,7 @@
|
|||||||
"description": "Enforce using named capture group in regular expression",
|
"description": "Enforce using named capture group in regular expression",
|
||||||
"recommended": false,
|
"recommended": false,
|
||||||
"fixable": false,
|
"fixable": false,
|
||||||
"hasSuggestions": false
|
"hasSuggestions": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "prefer-numeric-literals",
|
"name": "prefer-numeric-literals",
|
||||||
@ -1295,7 +1316,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "prefer-object-spread",
|
"name": "prefer-object-spread",
|
||||||
"description": "Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.",
|
"description": "Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead",
|
||||||
"recommended": false,
|
"recommended": false,
|
||||||
"fixable": true,
|
"fixable": true,
|
||||||
"hasSuggestions": false
|
"hasSuggestions": false
|
||||||
@ -1361,7 +1382,7 @@
|
|||||||
"description": "Enforce the use of `u` flag on RegExp",
|
"description": "Enforce the use of `u` flag on RegExp",
|
||||||
"recommended": false,
|
"recommended": false,
|
||||||
"fixable": false,
|
"fixable": false,
|
||||||
"hasSuggestions": false
|
"hasSuggestions": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "require-yield",
|
"name": "require-yield",
|
||||||
@ -1872,7 +1893,7 @@
|
|||||||
],
|
],
|
||||||
"deprecated": {
|
"deprecated": {
|
||||||
"name": "Deprecated",
|
"name": "Deprecated",
|
||||||
"description": "These rules have been deprecated in accordance with the <a href=\"/docs/user-guide/rule-deprecation\">deprecation policy</a>, and replaced by newer rules:",
|
"description": "These rules have been deprecated in accordance with the <a href=\"{{ '/use/rule-deprecation' | url }}\">deprecation policy</a>, and replaced by newer rules:",
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
"name": "callback-return",
|
"name": "callback-return",
|
||||||
@ -1988,7 +2009,7 @@
|
|||||||
},
|
},
|
||||||
"removed": {
|
"removed": {
|
||||||
"name": "Removed",
|
"name": "Removed",
|
||||||
"description": "These rules from older versions of ESLint (before the <a href=\"/docs/user-guide/rule-deprecation\">deprecation policy</a> existed) have been replaced by newer rules:",
|
"description": "These rules from older versions of ESLint (before the <a href=\"{{ '/use/rule-deprecation' | url }}\">deprecation policy</a> existed) have been replaced by newer rules:",
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
"removed": "generator-star",
|
"removed": "generator-star",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -74,8 +74,8 @@ footer:
|
|||||||
title: Social Media
|
title: Social Media
|
||||||
twitter: Twitter
|
twitter: Twitter
|
||||||
chat: Discord
|
chat: Discord
|
||||||
mailing_list: Google Group
|
|
||||||
github: GitHub
|
github: GitHub
|
||||||
|
mastodon: Mastodon
|
||||||
theme_switcher:
|
theme_switcher:
|
||||||
title: Theme Switcher
|
title: Theme Switcher
|
||||||
light: Light
|
light: Light
|
||||||
@ -85,8 +85,9 @@ footer:
|
|||||||
description: Selecting a language will take you to the ESLint website in that language.
|
description: Selecting a language will take you to the ESLint website in that language.
|
||||||
change_language: Change Language
|
change_language: Change Language
|
||||||
language: Language
|
language: Language
|
||||||
|
latest: Latest
|
||||||
copyright: >
|
copyright: >
|
||||||
© OpenJS Foundation and ESLint contributors, <a href="https://www.openjsf.org">www.openjsf.org</a>
|
© OpenJS Foundation and ESLint contributors, <a href="https://www.openjsf.org">www.openjsf.org</a>. Content licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
|
||||||
links:
|
links:
|
||||||
open_jsf: The OpenJS Foundation
|
open_jsf: The OpenJS Foundation
|
||||||
terms: Terms of Use
|
terms: Terms of Use
|
||||||
|
116
eslint/docs/src/_data/sites/zh-hans.yml
Normal file
116
eslint/docs/src/_data/sites/zh-hans.yml
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Simplified Chinese Site Details
|
||||||
|
# The documentation site that is hosted at zh-hans.eslint.org/docs
|
||||||
|
# Author: Percy Ma
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Global Settings
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
language:
|
||||||
|
code: zh-hans
|
||||||
|
flag: 🇨🇳
|
||||||
|
name: 简体中文
|
||||||
|
locale: zh-hans
|
||||||
|
hostname: zh-hans.eslint.org
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Analytics
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
google_analytics:
|
||||||
|
code: "G-6ELXTK7GZR"
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Ads
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
carbon_ads:
|
||||||
|
serve: ""
|
||||||
|
placement: ""
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Shared
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
shared:
|
||||||
|
get_started: 开始
|
||||||
|
become_a_sponsor: 捐赠
|
||||||
|
eslint_logo_alt: ESLint 图标
|
||||||
|
description: >
|
||||||
|
插件化、可配置的 JavaScript 代码检查工具,让你轻松地提高代码质量。
|
||||||
|
title_format: PAGE_TITLE - ESLint - 插件化的 JavaScript 代码检查工具
|
||||||
|
skip_to_content: 跳转到正文
|
||||||
|
donate: 捐赠
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Navigation
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
navigation:
|
||||||
|
- text: 团队
|
||||||
|
link: team
|
||||||
|
- text: 博客
|
||||||
|
link: blog
|
||||||
|
- text: 文档
|
||||||
|
link: docs
|
||||||
|
- text: 商店
|
||||||
|
link: store
|
||||||
|
target: _blank
|
||||||
|
- text: 演练场
|
||||||
|
link: playground
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Footer
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
footer:
|
||||||
|
title: 准备修复你的 JavaScript 代码了吗?
|
||||||
|
description: 从 npm 安装或捐赠开始。
|
||||||
|
secondary: 次要
|
||||||
|
social_icons:
|
||||||
|
title: 社交媒体
|
||||||
|
twitter: Twitter
|
||||||
|
chat: Discord
|
||||||
|
github: GitHub
|
||||||
|
theme_switcher:
|
||||||
|
title: 主题切换
|
||||||
|
light: 浅色
|
||||||
|
dark: 深色
|
||||||
|
language_switcher:
|
||||||
|
title: 语言切换
|
||||||
|
description: 切换到你所选择语言版本对应的 ESLint 网站。
|
||||||
|
change_language: 更改语言
|
||||||
|
language: 语言
|
||||||
|
latest: 最新
|
||||||
|
copyright: >
|
||||||
|
© OpenJS Foundation and ESLint contributors, <a href="https://www.openjsf.org">www.openjsf.org</a>. Content licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
|
||||||
|
links:
|
||||||
|
open_jsf: OpenJS 基金会
|
||||||
|
terms: 使用条款
|
||||||
|
privacy: 隐私策略
|
||||||
|
bylaws: OpenJS 基金会章程
|
||||||
|
trademark: 商标策略
|
||||||
|
trademark_list: 商标列表
|
||||||
|
cookies: Cookie 策略
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# 404 Page
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
404_page:
|
||||||
|
title: 404 错误
|
||||||
|
subtitle: 页面未找到
|
||||||
|
description: 对不起,你正在寻找的页面不存在或已被移动。
|
||||||
|
actions:
|
||||||
|
back_to_home: 回到主页
|
||||||
|
browse_docs: 浏览文档
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Edit link
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
edit_link:
|
||||||
|
start_with: https://github.com/eslint/eslint/edit/main/docs/
|
||||||
|
text: 编辑此页
|
@ -14,9 +14,13 @@
|
|||||||
<select name="language selector" id="language-select" aria-describedby="language-infobox"
|
<select name="language selector" id="language-select" aria-describedby="language-infobox"
|
||||||
class="c-custom-select switcher__select">
|
class="c-custom-select switcher__select">
|
||||||
{% for key, other_site in sites %}
|
{% for key, other_site in sites %}
|
||||||
<option value="{{ other_site.language.code }}" data-url="https://{{ other_site.hostname }}" {% if
|
<option
|
||||||
site.language.code==other_site.language.code %} selected {% endif %}>
|
value="{{ other_site.language.code }}"
|
||||||
|
data-url="https://{{ other_site.hostname }}/docs/latest{{ page.url | prettyURL }}"
|
||||||
|
{% if site.language.code==other_site.language.code %}selected{% endif %}
|
||||||
|
>
|
||||||
{{ other_site.language.flag }} {{ other_site.language.name }}
|
{{ other_site.language.flag }} {{ other_site.language.name }}
|
||||||
|
{% if site.language.code!=other_site.language.code or GIT_BRANCH=="latest" %}({{ other_site.footer.language_switcher.latest }}){% endif %}
|
||||||
</option>
|
</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
[data-theme="dark"] #logo-center {
|
[data-theme="dark"] #logo-center {
|
||||||
opacity: 60%;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<svg class="brand-logo" width="203" height="58" viewBox="0 0 203 58" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="ESLint logo">
|
<svg class="brand-logo" width="203" height="58" viewBox="0 0 203 58" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="ESLint logo">
|
||||||
|
@ -12,8 +12,11 @@
|
|||||||
<span class="label__text">Version</span>
|
<span class="label__text">Version</span>
|
||||||
</label>
|
</label>
|
||||||
<select name="version selector" id="nav-version-select" aria-describedby="nav-version-infobox" class="c-custom-select switcher__select auto-switcher">
|
<select name="version selector" id="nav-version-select" aria-describedby="nav-version-infobox" class="c-custom-select switcher__select auto-switcher">
|
||||||
<option value="HEAD" data-url="/docs/head/" {% if GIT_BRANCH !="latest" %}selected{% endif %}>HEAD</option>
|
<option value="HEAD" data-url="/docs/head/" {% if HEAD %}selected{% endif %}>HEAD</option>
|
||||||
<option value="{{ eslintVersion }}" data-url="/docs/latest/" {% if GIT_BRANCH=="latest" %}selected{% endif %}>v{{ eslintVersion }}</option>
|
{% if config.showNextVersion == true %}
|
||||||
|
<option value="NEXT" data-url="/docs/next/" {% if GIT_BRANCH == "next" %}selected{% endif %}>NEXT</option>
|
||||||
|
{% endif %}
|
||||||
|
<option value="{{ eslintVersion }}" data-url="/docs/latest/" {% if GIT_BRANCH == "latest" %}selected{% endif %}>v{{ eslintVersion }}</option>
|
||||||
{% for version in versions.items %}
|
{% for version in versions.items %}
|
||||||
<option value="{{ version.number }}"
|
<option value="{{ version.number }}"
|
||||||
data-url="{{ version.url }}">
|
data-url="{{ version.url }}">
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
<div class="rule-category">
|
<div class="rule-category">
|
||||||
<span class="rule-category__icon">✅ <span class="visually-hidden">Recommended</span></span>
|
<span class="rule-category__icon">✅ <span class="visually-hidden">Recommended</span></span>
|
||||||
<p class="rule-category__description">
|
<p class="rule-category__description">
|
||||||
The <code>"extends": "eslint:recommended"</code> property in a <a href="../user-guide/configuring/configuration-files#extending-configuration-files">configuration file</a> enables this rule
|
The <code>"extends": "eslint:recommended"</code> property in a <a href="../use/configure/configuration-files#extending-configuration-files">configuration file</a> enables this rule
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- if params.fixable -%}
|
{%- if params.fixable -%}
|
||||||
<div class="rule-category">
|
<div class="rule-category">
|
||||||
<span class="rule-category__icon">🛠 <span class="visually-hidden">Fixable</span></span>
|
<span class="rule-category__icon">🔧 <span class="visually-hidden">Fixable</span></span>
|
||||||
<p class="rule-category__description">
|
<p class="rule-category__description">
|
||||||
Some problems reported by this rule are automatically fixable by the <code>--fix</code> <a href="../user-guide/command-line-interface#--fix">command line</a> option
|
Some problems reported by this rule are automatically fixable by the <code>--fix</code> <a href="../use/command-line-interface#--fix">command line</a> option
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<div class="rule-category">
|
<div class="rule-category">
|
||||||
<span class="rule-category__icon">💡 <span class="visually-hidden">hasSuggestions</span></span>
|
<span class="rule-category__icon">💡 <span class="visually-hidden">hasSuggestions</span></span>
|
||||||
<p class="rule-category__description">
|
<p class="rule-category__description">
|
||||||
Some problems reported by this rule are manually fixable by editor <a href="../developer-guide/working-with-rules#providing-suggestions">suggestions</a>
|
Some problems reported by this rule are manually fixable by editor <a href="../extend/custom-rules#providing-suggestions">suggestions</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
{%- macro fixable() -%}
|
{%- macro fixable() -%}
|
||||||
<div class="rule-category">
|
<div class="rule-category">
|
||||||
<span class="rule-category__icon">🛠 <span class="visually-hidden">Fixable</span></span>
|
<span class="rule-category__icon">🔧 <span class="visually-hidden">Fixable</span></span>
|
||||||
<p class="rule-category__description">
|
<p class="rule-category__description">
|
||||||
if some problems reported by the rule are automatically fixable by the <code>--fix</code> command line option
|
if some problems reported by the rule are automatically fixable by the <code>--fix</code> command line option
|
||||||
</p>
|
</p>
|
||||||
|
@ -29,11 +29,7 @@
|
|||||||
<div class="rule__categories">
|
<div class="rule__categories">
|
||||||
<span class="visually-hidden">Categories:</span>
|
<span class="visually-hidden">Categories:</span>
|
||||||
{%- if (params.deprecated) or (params.removed) -%}
|
{%- if (params.deprecated) or (params.removed) -%}
|
||||||
<p class="rule__categories__type">
|
<p class="rule__categories__type">❌</p>
|
||||||
<svg width="24" height="24" viewBox="12 12 20 20" fill="none" aria-hidden="true" focusable="false" style="position: relative; right: -1px;">
|
|
||||||
<path d="M28.5 16L16.5 28M16.5 16L28.5 28" stroke="#F63D68" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
||||||
</svg>
|
|
||||||
</p>
|
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
<p class="rule__categories__type" {% if params.categories.recommended == false %}aria-hidden="true" {%- endif -%}>
|
<p class="rule__categories__type" {% if params.categories.recommended == false %}aria-hidden="true" {%- endif -%}>
|
||||||
✅ <span class="visually-hidden">Extends</span>
|
✅ <span class="visually-hidden">Extends</span>
|
||||||
@ -41,7 +37,7 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
<p class="rule__categories__type" {% if params.categories.fixable == false %}aria-hidden="true" {%- endif -%}>
|
<p class="rule__categories__type" {% if params.categories.fixable == false %}aria-hidden="true" {%- endif -%}>
|
||||||
🛠 <span class="visually-hidden">Fix</span>
|
🔧 <span class="visually-hidden">Fix</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="rule__categories__type" {% if params.categories.hasSuggestions == false %}aria-hidden="true" {%- endif -%}>
|
<p class="rule__categories__type" {% if params.categories.hasSuggestions == false %}aria-hidden="true" {%- endif -%}>
|
||||||
💡 <span class="visually-hidden">Suggestions</span>
|
💡 <span class="visually-hidden">Suggestions</span>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<h2 id="eslint-social-label" hidden>{{ site.footer.social_icons.title }}</h2>
|
<h2 id="eslint-social-label" hidden>{{ site.footer.social_icons.title }}</h2>
|
||||||
<ul role="list">
|
<ul role="list">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ links.twitter }}" target="_blank">
|
<a href="{{ links.twitter }}" rel="noopener noreferrer" target="_blank">
|
||||||
<svg width="24" height="25" viewBox="0 0 24 25" class="c-icon" role="img"
|
<svg width="24" height="25" viewBox="0 0 24 25" class="c-icon" role="img"
|
||||||
aria-label="{{ site.footer.social_icons.twitter }}">
|
aria-label="{{ site.footer.social_icons.twitter }}">
|
||||||
<path
|
<path
|
||||||
@ -12,17 +12,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ links.group }}" target="_blank">
|
<a href="{{ links.github }}" rel="noopener noreferrer" target="_blank">
|
||||||
<svg width="24" height="25" viewBox="0 0 24 25" class="c-icon" role="img"
|
|
||||||
aria-label="{{ site.footer.social_icons.mailing_list }}">
|
|
||||||
<path
|
|
||||||
d="M23.5072 9.92762H12.0522V14.8366H18.5442C17.5072 18.1096 14.9442 19.2006 12.0002 19.2006C10.8597 19.202 9.73567 18.9283 8.7235 18.4026C7.71133 17.877 6.84089 17.1149 6.18603 16.1812C5.53116 15.2474 5.11119 14.1695 4.96174 13.0388C4.8123 11.9081 4.93779 10.758 5.32758 9.68619C5.71736 8.61435 6.35993 7.65234 7.20078 6.88179C8.04162 6.11123 9.05593 5.55486 10.1576 5.25989C11.2594 4.96491 12.416 4.94004 13.5293 5.18736C14.6427 5.43469 15.68 5.94693 16.5532 6.68062L20.1202 3.28062C18.6835 1.95814 16.9458 1.00625 15.0578 0.507551C13.1698 0.0088549 11.1887 -0.0215774 9.28633 0.418895C7.38395 0.859367 5.61779 1.75744 4.14115 3.03516C2.6645 4.31289 1.52197 5.93167 0.812711 7.75102C0.103454 9.57037 -0.151101 11.5353 0.0711364 13.4753C0.293374 15.4154 0.98569 17.2718 2.088 18.8837C3.19032 20.4955 4.66932 21.814 6.39666 22.7247C8.124 23.6354 10.0475 24.1108 12.0002 24.1096C18.6172 24.1096 24.6002 19.7456 23.5072 9.92762Z"
|
|
||||||
fill="currentColor" />
|
|
||||||
</svg>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="{{ links.github }}" target="_blank">
|
|
||||||
<svg width="25" height="24" viewBox="0 0 25 24" class="c-icon" role="img"
|
<svg width="25" height="24" viewBox="0 0 25 24" class="c-icon" role="img"
|
||||||
aria-label="{{ site.footer.social_icons.github }}">
|
aria-label="{{ site.footer.social_icons.github }}">
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
@ -32,7 +22,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ links.chat }}" target="_blank">
|
<a href="{{ links.chat }}" rel="noopener noreferrer" target="_blank">
|
||||||
<svg width="24" height="25" viewBox="0 0 24 25" class="c-icon" role="img"
|
<svg width="24" height="25" viewBox="0 0 24 25" class="c-icon" role="img"
|
||||||
aria-label="{{ site.footer.social_icons.chat }}">
|
aria-label="{{ site.footer.social_icons.chat }}">
|
||||||
<g clip-path="url(#clip0_256:2722)">
|
<g clip-path="url(#clip0_256:2722)">
|
||||||
@ -52,6 +42,13 @@
|
|||||||
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ links.mastodon }}" rel="noopener noreferrer" target="_blank">
|
||||||
|
<svg width="24" height="25" viewBox="0 0 216.4144 232.00976" class="c-icon" role="img" aria-label="{{ site.footer.social_icons.mastodon }}">
|
||||||
|
<path fill="currentColor" d="M211.80734 139.0875c-3.18125 16.36625-28.4925 34.2775-57.5625 37.74875-15.15875 1.80875-30.08375 3.47125-45.99875 2.74125-26.0275-1.1925-46.565-6.2125-46.565-6.2125 0 2.53375.15625 4.94625.46875 7.2025 3.38375 25.68625 25.47 27.225 46.39125 27.9425 21.11625.7225 39.91875-5.20625 39.91875-5.20625l.8675 19.09s-14.77 7.93125-41.08125 9.39c-14.50875.7975-32.52375-.365-53.50625-5.91875C9.23234 213.82 1.40609 165.31125.20859 116.09125c-.365-14.61375-.14-28.39375-.14-39.91875 0-50.33 32.97625-65.0825 32.97625-65.0825C49.67234 3.45375 78.20359.2425 107.86484 0h.72875c29.66125.2425 58.21125 3.45375 74.8375 11.09 0 0 32.975 14.7525 32.975 65.0825 0 0 .41375 37.13375-4.59875 62.915" />
|
||||||
|
<path fill="var(--lighter-background-color)" d="M177.50984 80.077v60.94125h-24.14375v-59.15c0-12.46875-5.24625-18.7975-15.74-18.7975-11.6025 0-17.4175 7.5075-17.4175 22.3525v32.37625H96.20734V85.42325c0-14.845-5.81625-22.3525-17.41875-22.3525-10.49375 0-15.74 6.32875-15.74 18.7975v59.15H38.90484V80.077c0-12.455 3.17125-22.3525 9.54125-29.675 6.56875-7.3225 15.17125-11.07625 25.85-11.07625 12.355 0 21.71125 4.74875 27.8975 14.2475l6.01375 10.08125 6.015-10.08125c6.185-9.49875 15.54125-14.2475 27.8975-14.2475 10.6775 0 19.28 3.75375 25.85 11.07625 6.36875 7.3225 9.54 17.22 9.54 29.675" />
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -12,7 +12,10 @@
|
|||||||
<span class="label__text">Version</span>
|
<span class="label__text">Version</span>
|
||||||
</label>
|
</label>
|
||||||
<select name="version selector" id="version-select" aria-describedby="version-infobox" class="c-custom-select switcher__select auto-switcher">
|
<select name="version selector" id="version-select" aria-describedby="version-infobox" class="c-custom-select switcher__select auto-switcher">
|
||||||
<option value="HEAD" data-url="/docs/head/" {% if GIT_BRANCH != "latest" %}selected{% endif %}>HEAD</option>
|
<option value="HEAD" data-url="/docs/head/" {% if HEAD %}selected{% endif %}>HEAD</option>
|
||||||
|
{% if config.showNextVersion == true %}
|
||||||
|
<option value="NEXT" data-url="/docs/next/" {% if GIT_BRANCH=="next" %}selected{% endif %}>NEXT</option>
|
||||||
|
{% endif %}
|
||||||
<option value="{{ eslintVersion }}" data-url="/docs/latest/" {% if GIT_BRANCH == "latest" %}selected{% endif %}>v{{ eslintVersion }}</option>
|
<option value="{{ eslintVersion }}" data-url="/docs/latest/" {% if GIT_BRANCH == "latest" %}selected{% endif %}>v{{ eslintVersion }}</option>
|
||||||
{% for version in versions.items %}
|
{% for version in versions.items %}
|
||||||
<option value="{{ version.number }}"
|
<option value="{{ version.number }}"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ config.lang }}" class="no-js">
|
<html lang="{{ config.lang }}" class="no-js" id="site_top">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
@ -24,7 +24,7 @@
|
|||||||
<title>{{ page_title }}</title>
|
<title>{{ page_title }}</title>
|
||||||
<meta name="description" content="{{ page_desc }}">
|
<meta name="description" content="{{ page_desc }}">
|
||||||
<link rel="canonical" href="{{ page_url }}">
|
<link rel="canonical" href="{{ page_url }}">
|
||||||
|
|
||||||
<!-- https://github.com/eslint/eslint/issues/15844 -->
|
<!-- https://github.com/eslint/eslint/issues/15844 -->
|
||||||
<base href="{{ relative_page_url }}">
|
<base href="{{ relative_page_url }}">
|
||||||
|
|
||||||
@ -76,7 +76,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
/* Overrides for funky punctuators */
|
/* Overrides for funky punctuators */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Mono Punctuators";
|
font-family: "Mono Punctuators";
|
||||||
@ -85,12 +84,13 @@
|
|||||||
unicode-range: U+40, U+7B, U+7D, U+28, U+29;
|
unicode-range: U+40, U+7B, U+7D, U+28, U+29;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Space Grotesk for headings */
|
/* Space Grotesk for headings */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Space Grotesk";
|
font-family: "Space Grotesk";
|
||||||
src: url("{{ '/assets/fonts/SpaceGrotesk-Medium-subset.woff2' | url }}") format("woff2"),
|
src:
|
||||||
url("{{ '/assets/fonts/SpaceGrotesk-Medium-subset.zopfli.woff' | url }}") format("woff");
|
url("{{ '/assets/fonts/SpaceGrotesk-Medium-subset.woff2' | url }}") format("woff2"),
|
||||||
|
url("{{ '/assets/fonts/SpaceGrotesk-Medium-subset.zopfli.woff' | url }}") format("woff");
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@ -98,9 +98,10 @@
|
|||||||
/* Inter for body text */
|
/* Inter for body text */
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Inter";
|
font-family: Inter;
|
||||||
src: url("{{ '/assets/fonts/Inter-Regular-subset.woff2' | url }}") format("woff2"),
|
src:
|
||||||
url("{{ '/assets/fonts/Inter-Regular-subset.zopfli.woff' | url }}") format("woff");
|
url("{{ '/assets/fonts/Inter-Regular-subset.woff2' | url }}") format("woff2"),
|
||||||
|
url("{{ '/assets/fonts/Inter-Regular-subset.zopfli.woff' | url }}") format("woff");
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
@ -109,11 +110,19 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Space Mono";
|
font-family: "Space Mono";
|
||||||
src: url("{{ '/assets/fonts/SpaceMono-Regular-subset.woff2' | url }}") format("woff2"),
|
src:
|
||||||
url("{{ '/assets/fonts/SpaceMono-Regular-subset.zopfli.woff' | url }}") format("woff");
|
url("{{ '/assets/fonts/SpaceMono-Regular-subset.woff2' | url }}") format("woff2"),
|
||||||
|
url("{{ '/assets/fonts/SpaceMono-Regular-subset.zopfli.woff' | url }}") format("woff");
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Country Flags for Windows */
|
||||||
|
@font-face {
|
||||||
|
font-family: "Twemoji Country Flags";
|
||||||
|
unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
|
||||||
|
src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2") format("woff2");
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
if ("fonts" in document) {
|
if ("fonts" in document) {
|
||||||
@ -136,7 +145,7 @@
|
|||||||
<script src="https://unpkg.com/anchor-js@4.3.1/anchor.min.js"></script>
|
<script src="https://unpkg.com/anchor-js@4.3.1/anchor.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="{{ hook }} docs">
|
<body class="{{ hook }}">
|
||||||
<a href="#main" class="c-btn c-btn--primary" id="skip-link">Skip to main content</a>
|
<a href="#main" class="c-btn c-btn--primary" id="skip-link">Skip to main content</a>
|
||||||
|
|
||||||
{{ content | safe }}
|
{{ content | safe }}
|
||||||
@ -145,6 +154,7 @@
|
|||||||
<script src="{{ '/assets/js/focus-visible.js' | url }}"></script>
|
<script src="{{ '/assets/js/focus-visible.js' | url }}"></script>
|
||||||
<script src="{{ '/assets/js/main.js' | url }}"></script>
|
<script src="{{ '/assets/js/main.js' | url }}"></script>
|
||||||
<script src="{{ '/assets/js/tabs.js' | url }}"></script>
|
<script src="{{ '/assets/js/tabs.js' | url }}"></script>
|
||||||
|
<script src="{{ '/assets/js/scroll-up-btn.js' | url }}"></script>
|
||||||
{% include 'partials/analytics.html' %}
|
{% include 'partials/analytics.html' %}
|
||||||
|
|
||||||
{%- if hook == "component-library" -%}
|
{%- if hook == "component-library" -%}
|
||||||
|
@ -102,6 +102,9 @@ layout: base.html
|
|||||||
{% include "partials/docs-footer.html" %}
|
{% include "partials/docs-footer.html" %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<a id="scroll-up-btn" href="#site_top">
|
||||||
|
<svg fill="none" height="24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" width="24"><line x1="12" x2="12" y1="19" y2="5"/><polyline points="5 12 12 5 19 12"/></svg>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="{{ '/assets/js/tabs.js' | url }}"></script>
|
<script src="{{ '/assets/js/tabs.js' | url }}"></script>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
<ul class="versions-list">
|
<ul class="versions-list">
|
||||||
<li><a href="/docs/head/" {% if GIT_BRANCH != "latest" %} data-current="true" {% endif %}>HEAD</a></li>
|
<li><a href="/docs/head/" {% if HEAD %} data-current="true" {% endif %}>HEAD</a></li>
|
||||||
|
{% if config.showNextVersion == true %}
|
||||||
|
<li><a href="/docs/next/" {% if GIT_BRANCH == "next" %} data-current="true" {% endif %}>NEXT</a></li>
|
||||||
|
{% endif %}
|
||||||
<li><a href="/docs/latest/" {% if GIT_BRANCH == "latest" %} data-current="true" {% endif %}>v{{ eslintVersion }}</a></li>
|
<li><a href="/docs/latest/" {% if GIT_BRANCH == "latest" %} data-current="true" {% endif %}>v{{ eslintVersion }}</a></li>
|
||||||
{%- for version in versions.items -%}
|
{%- for version in versions.items -%}
|
||||||
<li><a href="{{ version.url }}">v{{ version.number }}</a></li>
|
<li><a href="{{ version.url }}">v{{ version.number }}</a></li>
|
||||||
|
91
eslint/docs/src/_plugins/md-syntax-highlighter.js
Normal file
91
eslint/docs/src/_plugins/md-syntax-highlighter.js
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
/**
|
||||||
|
* MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2019-present, Yuxi (Evan) You
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @typedef {import("markdown-it")} MarkdownIt */
|
||||||
|
|
||||||
|
const Prism = require("prismjs");
|
||||||
|
const loadLanguages = require("prismjs/components/");
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {MarkdownIt} md markdown-it
|
||||||
|
* @param {string} str code
|
||||||
|
* @param {string} lang code language
|
||||||
|
* @returns {string} highlighted result wrapped in pre
|
||||||
|
*/
|
||||||
|
const highlighter = function (md, str, lang) {
|
||||||
|
let result = "";
|
||||||
|
if (lang) {
|
||||||
|
try {
|
||||||
|
loadLanguages([lang]);
|
||||||
|
result = Prism.highlight(str, Prism.languages[lang], lang);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(lang, err);
|
||||||
|
// we still want to wrap the result later
|
||||||
|
result = md.utils.escapeHtml(str);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result = md.utils.escapeHtml(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
return `<pre class="language-${lang}"><code>${result}</code></pre>`;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* modified from https://github.com/vuejs/vitepress/blob/main/src/node/markdown/plugins/lineNumbers.ts
|
||||||
|
* @param {MarkdownIt} md
|
||||||
|
* @license MIT License. See file header.
|
||||||
|
*/
|
||||||
|
const lineNumberPlugin = (md) => {
|
||||||
|
const fence = md.renderer.rules.fence;
|
||||||
|
md.renderer.rules.fence = (...args) => {
|
||||||
|
const [tokens, idx] = args;
|
||||||
|
const lang = tokens[idx].info.trim();
|
||||||
|
const rawCode = fence(...args);
|
||||||
|
const code = rawCode.slice(
|
||||||
|
rawCode.indexOf("<code>"),
|
||||||
|
rawCode.indexOf("</code>")
|
||||||
|
);
|
||||||
|
const lines = code.split("\n");
|
||||||
|
const lineNumbersCode = [...Array(lines.length - 1)]
|
||||||
|
.map(
|
||||||
|
(line, index) =>
|
||||||
|
`<span class="line-number">${index + 1}</span><br>`
|
||||||
|
)
|
||||||
|
.join("");
|
||||||
|
|
||||||
|
const lineNumbersWrapperCode = `<div class="line-numbers-wrapper" aria-hidden="true">${lineNumbersCode}</div>`;
|
||||||
|
|
||||||
|
const finalCode = rawCode
|
||||||
|
.replace(/<\/pre>\n/, `${lineNumbersWrapperCode}</pre>`)
|
||||||
|
.replace(/"(language-\S*?)"/, '"$1 line-numbers-mode"')
|
||||||
|
.replace(/<code>/, `<code class="language-${lang}">`)
|
||||||
|
|
||||||
|
return finalCode;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.highlighter = highlighter;
|
||||||
|
module.exports.lineNumberPlugin = lineNumberPlugin;
|
@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: About
|
title: About
|
||||||
layout: doc
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,3 +1,42 @@
|
|||||||
|
(function () {
|
||||||
|
// for sticky table of contents
|
||||||
|
const tocBody = document.querySelector(".docs-aside #js-toc-panel");
|
||||||
|
const options = {
|
||||||
|
root: null,
|
||||||
|
rootMargin: `0px 0px -90% 0px`,
|
||||||
|
threshold: 1.0,
|
||||||
|
};
|
||||||
|
const activeClassName = "active";
|
||||||
|
const observer = new IntersectionObserver((entries) => {
|
||||||
|
entries.forEach((entry) => {
|
||||||
|
if (entry.isIntersecting) {
|
||||||
|
const activeAnchor = tocBody.querySelector(
|
||||||
|
`a.${activeClassName}`
|
||||||
|
);
|
||||||
|
if (activeAnchor) {
|
||||||
|
activeAnchor.parentNode.classList.remove(activeClassName);
|
||||||
|
activeAnchor.classList.remove(activeClassName);
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextActiveAnchor = tocBody.querySelector(
|
||||||
|
`a[href="#${entry.target.id}"]`
|
||||||
|
);
|
||||||
|
if (nextActiveAnchor) {
|
||||||
|
nextActiveAnchor.parentNode.classList.add(activeClassName);
|
||||||
|
nextActiveAnchor.classList.add(activeClassName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, options);
|
||||||
|
if (window.matchMedia("(min-width: 1400px)").matches) {
|
||||||
|
document
|
||||||
|
.querySelectorAll(
|
||||||
|
"#main > div > h2[id], #main > div > h3[id], #main > div > h4[id]" // only h2, h3, h4 are shown in toc
|
||||||
|
)
|
||||||
|
.forEach((el) => observer.observe(el));
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var toc_trigger = document.getElementById("js-toc-label"),
|
var toc_trigger = document.getElementById("js-toc-label"),
|
||||||
toc = document.getElementById("js-toc-panel"),
|
toc = document.getElementById("js-toc-panel"),
|
||||||
@ -279,4 +318,4 @@ if (index) {
|
|||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
anchors.add(".docs-content h2:not(.c-toc__label), .docs-content h3, .docs-content h4");
|
anchors.add(".docs-content h2:not(.c-toc__label), .docs-content h3, .docs-content h4");
|
||||||
});
|
});
|
||||||
|
13
eslint/docs/src/assets/js/scroll-up-btn.js
Normal file
13
eslint/docs/src/assets/js/scroll-up-btn.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
(function () {
|
||||||
|
const scrollUpBtn = document.getElementById("scroll-up-btn");
|
||||||
|
|
||||||
|
if(window.innerWidth < 1400) {
|
||||||
|
window.addEventListener("scroll", function () {
|
||||||
|
if(document.body.scrollTop > 500 || document.documentElement.scrollTop > 500) {
|
||||||
|
scrollUpBtn.style.display = "flex";
|
||||||
|
} else {
|
||||||
|
scrollUpBtn.style.display = "none";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})();
|
@ -49,7 +49,6 @@ function clearSearchResults() {
|
|||||||
resultsElement.removeChild(resultsElement.firstChild);
|
resultsElement.removeChild(resultsElement.firstChild);
|
||||||
}
|
}
|
||||||
resultsElement.innerHTML = "";
|
resultsElement.innerHTML = "";
|
||||||
searchClearBtn.setAttribute('hidden', '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,13 +79,11 @@ function displaySearchResults(results) {
|
|||||||
`.trim();
|
`.trim();
|
||||||
list.append(listItem);
|
list.append(listItem);
|
||||||
}
|
}
|
||||||
searchClearBtn.removeAttribute('hidden');
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
resultsLiveRegion.innerHTML = "No results found.";
|
resultsLiveRegion.innerHTML = "No results found.";
|
||||||
resultsElement.innerHTML = "No results found.";
|
resultsElement.innerHTML = "No results found.";
|
||||||
resultsElement.setAttribute('data-results', 'false');
|
resultsElement.setAttribute('data-results', 'false');
|
||||||
searchClearBtn.setAttribute('hidden', '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -111,63 +108,85 @@ function maintainScrollVisibility(activeElement, scrollParent) {
|
|||||||
else if (isBelow) {
|
else if (isBelow) {
|
||||||
scrollParent.scrollTo(0, offsetTop - parentOffsetHeight + offsetHeight);
|
scrollParent.scrollTo(0, offsetTop - parentOffsetHeight + offsetHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Debounces the provided callback with a given delay.
|
||||||
|
* @param {Function} callback The callback that needs to be debounced.
|
||||||
|
* @param {Number} delay Time in ms that the timer should wait before the callback is executed.
|
||||||
|
* @returns {Function} Returns the new debounced function.
|
||||||
|
*/
|
||||||
|
function debounce(callback, delay) {
|
||||||
|
let timer;
|
||||||
|
return (...args) => {
|
||||||
|
if (timer) clearTimeout(timer);
|
||||||
|
timer = setTimeout(() => callback.apply(this, args), delay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const debouncedFetchSearchResults = debounce((query) => {
|
||||||
|
fetchSearchResults(query)
|
||||||
|
.then(displaySearchResults)
|
||||||
|
.catch(clearSearchResults);
|
||||||
|
}, 300);
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Event Handlers
|
// Event Handlers
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
// listen for input changes
|
// listen for input changes
|
||||||
if(searchInput)
|
if (searchInput)
|
||||||
searchInput.addEventListener('keyup', function (e) {
|
searchInput.addEventListener('keyup', function (e) {
|
||||||
const query = searchInput.value;
|
const query = searchInput.value;
|
||||||
|
|
||||||
if(query === searchQuery) return;
|
if (query === searchQuery) return;
|
||||||
|
|
||||||
if(query.length) searchClearBtn.removeAttribute('hidden');
|
if (query.length) searchClearBtn.removeAttribute('hidden');
|
||||||
else searchClearBtn.setAttribute('hidden', '');
|
else searchClearBtn.setAttribute('hidden', '');
|
||||||
|
|
||||||
if (query.length > 2) {
|
if (query.length > 2) {
|
||||||
fetchSearchResults(query)
|
|
||||||
.then(displaySearchResults)
|
|
||||||
.catch(clearSearchResults);
|
|
||||||
|
|
||||||
document.addEventListener('click', function(e) {
|
debouncedFetchSearchResults(query);
|
||||||
if(e.target !== resultsElement) clearSearchResults();
|
|
||||||
|
document.addEventListener('click', function (e) {
|
||||||
|
if (e.target !== resultsElement) clearSearchResults();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
clearSearchResults();
|
clearSearchResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
searchQuery = query
|
searchQuery = query
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if(searchClearBtn)
|
if (searchClearBtn)
|
||||||
searchClearBtn.addEventListener('click', function(e) {
|
searchClearBtn.addEventListener('click', function (e) {
|
||||||
searchInput.value = '';
|
searchInput.value = '';
|
||||||
searchInput.focus();
|
searchInput.focus();
|
||||||
clearSearchResults();
|
clearSearchResults();
|
||||||
|
searchClearBtn.setAttribute('hidden', '');
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('keydown', function (e) {
|
document.addEventListener('keydown', function (e) {
|
||||||
|
|
||||||
|
const searchResults = Array.from(document.querySelectorAll('.search-results__item'));
|
||||||
|
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
clearSearchResults();
|
if (searchResults.length) {
|
||||||
searchInput.focus();
|
clearSearchResults();
|
||||||
|
searchInput.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
|
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
searchInput.focus();
|
searchInput.focus();
|
||||||
document.querySelector('.search').scrollIntoView({ behaviour: "smooth", block: "start" });
|
document.querySelector('.search').scrollIntoView({ behavior: "smooth", block: "start" });
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchResults = Array.from(document.querySelectorAll('.search-results__item'));
|
|
||||||
if (!searchResults.length) return;
|
if (!searchResults.length) return;
|
||||||
|
|
||||||
switch (e.key) {
|
switch (e.key) {
|
||||||
@ -188,4 +207,3 @@ document.addEventListener('keydown', function (e) {
|
|||||||
maintainScrollVisibility(activeSearchResult, resultsElement);
|
maintainScrollVisibility(activeSearchResult, resultsElement);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
.hero-ad {
|
.hero-ad {
|
||||||
@media all and (max-width: 800px) {
|
@media all and (max-width: 800px) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#carbonads * {
|
#carbonads * {
|
||||||
@ -15,9 +15,9 @@
|
|||||||
padding: .6em;
|
padding: .6em;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 4px;
|
|
||||||
background-color: var(--body-background-color);
|
background-color: var(--body-background-color);
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: 4px;
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1);
|
box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1);
|
||||||
|
|
||||||
@ -31,8 +31,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.jumbotron #carbonads {
|
.jumbotron #carbonads {
|
||||||
border: solid 1px hsla(250, 20%, 50%, .6);
|
border: solid 1px hsla(250, 20%, 50%, 0.6);
|
||||||
background-color: hsla(0, 0%, 70%, .15);
|
background-color: hsla(0, 0%, 70%, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
#carbonads a {
|
#carbonads a {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
color: var(--color-rose-600);
|
color: var(--color-rose-600);
|
||||||
|
|
||||||
[data-theme="dark"] & {
|
[data-theme="dark"] & {
|
||||||
|
border: 1px solid var(--color-rose-300);
|
||||||
color: var(--color-rose-300);
|
color: var(--color-rose-300);
|
||||||
background-color: var(--color-rose-900);
|
background-color: var(--color-rose-900);
|
||||||
}
|
}
|
||||||
@ -27,6 +28,7 @@
|
|||||||
|
|
||||||
[data-theme="dark"] & {
|
[data-theme="dark"] & {
|
||||||
color: var(--color-warning-300);
|
color: var(--color-warning-300);
|
||||||
|
border: 1px solid var(--color-warning-300);
|
||||||
background-color: var(--color-warning-900);
|
background-color: var(--color-warning-900);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,24 +39,8 @@
|
|||||||
|
|
||||||
[data-theme="dark"] & {
|
[data-theme="dark"] & {
|
||||||
color: var(--color-success-300);
|
color: var(--color-success-300);
|
||||||
background-color: var(--color-success-900);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[data-theme="dark"] {
|
|
||||||
.alert {
|
|
||||||
&.alert--warning {
|
|
||||||
border: 1px solid var(--color-rose-300);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.alert--important {
|
|
||||||
border: 1px solid var(--color-warning-300);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.alert--tip {
|
|
||||||
border: 1px solid var(--color-success-300);
|
border: 1px solid var(--color-success-300);
|
||||||
|
background-color: var(--color-success-900);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,7 +87,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.alert__learn-more {
|
.alert__learn-more {
|
||||||
display: block;
|
display: block;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
@ -23,9 +23,7 @@ button {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
|
transition: background-color .2s linear, border-color .2s linear;
|
||||||
transition: background-color .2s linear,
|
|
||||||
border-color .2s linear;
|
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
@ -60,7 +60,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.index-js [aria-expanded="true"] .index-icon {
|
.index-js [aria-expanded="true"] .index-icon {
|
||||||
-ms-transform: rotate(180deg);
|
|
||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +142,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ham-top {
|
#ham-top {
|
||||||
|
|
||||||
transform: rotate(41deg);
|
transform: rotate(41deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
margin-block-end: 2rem;
|
margin-block-end: 2rem;
|
||||||
|
|
||||||
|
|
||||||
@media all and (min-width: 1024px) {
|
@media all and (min-width: 1024px) {
|
||||||
font-size: var(--step-0);
|
font-size: var(--step-0);
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
@ -50,7 +49,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.docs-nav-panel {
|
.docs-nav-panel {
|
||||||
@media all and (min-width: 1024px) {
|
@media all and (min-width: 1024px) {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -83,11 +81,9 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
margin-left: .5rem;
|
margin-left: .5rem;
|
||||||
margin-right: -10px;
|
margin-right: -10px;
|
||||||
|
|
||||||
margin-inline-start: .5rem;
|
margin-inline-start: .5rem;
|
||||||
margin-inline-end: -10px;
|
margin-inline-end: -10px;
|
||||||
|
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@ -118,7 +114,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ham-top {
|
#ham-top {
|
||||||
|
|
||||||
transform: rotate(41deg);
|
transform: rotate(41deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,8 +123,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media all and (min-width: 1024px) {
|
@media all and (min-width: 1024px) {
|
||||||
.docs-site-nav {
|
.docs-site-nav {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@ -151,5 +144,4 @@
|
|||||||
order: 1;
|
order: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,11 +36,15 @@
|
|||||||
padding: 0 calc(1rem + 1vw);
|
padding: 0 calc(1rem + 1vw);
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
max-width: 1700px;
|
||||||
|
|
||||||
|
@media all and (min-width: 1700px) {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero--homepage {
|
.hero--homepage {
|
||||||
|
|
||||||
.section-title {
|
.section-title {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
margin-block-end: 1.5rem;
|
margin-block-end: 1.5rem;
|
||||||
|
@ -79,7 +79,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ham-top {
|
#ham-top {
|
||||||
|
|
||||||
transform: rotate(41deg);
|
transform: rotate(41deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,11 +18,10 @@
|
|||||||
flex: 1 0 10ch;
|
flex: 1 0 10ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.switcher--language .switcher__select {
|
||||||
.switcher--language .switcher__select {
|
|
||||||
flex: 1 0 12rem;
|
flex: 1 0 12rem;
|
||||||
|
|
||||||
@media all and (max-width: 800px) {
|
@media all and (max-width: 799px) {
|
||||||
max-width: 250px;
|
max-width: 250px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,12 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-bottom: .5rem;
|
margin-bottom: .5rem;
|
||||||
margin-block-end: .5rem;
|
margin-block-end: .5rem;
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
transition: all .2s linear;
|
transition: all .2s linear;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--lighter-background-color);
|
background-color: var(--lighter-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.resource__image {
|
.resource__image {
|
||||||
@ -27,7 +25,6 @@
|
|||||||
display: block;
|
display: block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
// object-fit: cover;
|
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -38,7 +35,6 @@
|
|||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.resource__title { // a
|
.resource__title { // a
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: var(--headings-color);
|
color: var(--headings-color);
|
||||||
@ -51,7 +47,7 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
offset-inline-start: 0;
|
offset-inline-start: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
block-inline-start: 0;
|
offset-block-start: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
@ -13,24 +13,24 @@
|
|||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
|
|
||||||
@media screen and (min-width:768px){
|
@media screen and (min-width: 768px) {
|
||||||
&:not(:first-child)::after {
|
&:not(:first-child)::after {
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
border-left: 1px solid var(--divider-color);
|
border-left: 1px solid var(--divider-color);
|
||||||
left: 0px;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width:768px) and (max-width:1023px), screen and (min-width:1440px){
|
@media screen and (min-width: 768px) and (max-width: 1023px), screen and (min-width: 1440px) {
|
||||||
&:not(:first-child)::after {
|
&:not(:first-child)::after {
|
||||||
height: 70%;
|
height: 70%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width:1024px) and (max-width:1439px){
|
@media screen and (min-width: 1024px) and (max-width: 1439px) {
|
||||||
&:nth-child(2)::after {
|
&:nth-child(2)::after {
|
||||||
height: 70%;
|
height: 70%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -65,7 +65,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.rule {
|
.rule:not(.token) {
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
background-color: var(--lightest-background-color);
|
background-color: var(--lightest-background-color);
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -171,7 +171,6 @@ a.rule__name {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.related-rules__list__item {
|
.related-rules__list__item {
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
@ -194,7 +193,7 @@ a.rule__name {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
a.rule-list-item+a.rule-list-item::before {
|
a.rule-list-item + a.rule-list-item::before {
|
||||||
content: ",";
|
content: ",";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
[type="search"]::-webkit-search-cancel-button,
|
[type="search"]::-webkit-search-cancel-button,
|
||||||
[type="search"]::-webkit-search-decoration {
|
[type="search"]::-webkit-search-decoration {
|
||||||
-webkit-appearance: none;
|
|
||||||
appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
[type=search]::-ms-clear,
|
[type="search"]::-ms-clear,
|
||||||
[type=search]::-ms-reveal {
|
[type="search"]::-ms-reveal {
|
||||||
display: none;
|
display: none;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
@ -65,12 +64,11 @@
|
|||||||
.search .search-results {
|
.search .search-results {
|
||||||
font-size: .875rem;
|
font-size: .875rem;
|
||||||
background-color: var(--body-background-color);
|
background-color: var(--body-background-color);
|
||||||
position: relative;
|
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 0 0 var(--border-radius) var(--border-radius);
|
border-radius: 0 0 var(--border-radius) var(--border-radius);
|
||||||
border: 1px solid var(--divider-color);
|
border: 1px solid var(--divider-color);
|
||||||
position: rekative;
|
position: relative;
|
||||||
top: .25rem;
|
top: .25rem;
|
||||||
max-height: 400px;
|
max-height: 400px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
@ -84,6 +82,7 @@
|
|||||||
&[data-results="true"] {
|
&[data-results="true"] {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&[data-results="false"] {
|
&[data-results="false"] {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
@ -110,7 +109,7 @@
|
|||||||
background-color: var(--lightest-background-color);
|
background-color: var(--lightest-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus-within{
|
&:focus-within {
|
||||||
background-color: var(--lightest-background-color);
|
background-color: var(--lightest-background-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -121,7 +120,6 @@
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-family: var(--text-font);
|
font-family: var(--text-font);
|
||||||
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
display: block;
|
display: block;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
li {
|
li {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
@ -27,11 +27,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
border-radius: var(--border-radius) var(--border-radius) 0 0;
|
border-radius: var(--border-radius) var(--border-radius) 0 0;
|
||||||
|
transition: background-color .2s linear, border-color .2s linear;
|
||||||
transition: background-color .2s linear,
|
|
||||||
border-color .2s linear;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
@ -55,7 +51,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.c-tabs__tabpanel__title {
|
.c-tabs__tabpanel__title {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
margin-block-end: 1.5rem;
|
margin-block-end: 1.5rem;
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.theme-switcher-label.theme-switcher-label {
|
.theme-switcher-label.theme-switcher-label {
|
||||||
font-size: inherit;
|
|
||||||
color: inherit;
|
color: inherit;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-family: var(--text-font);
|
font-family: var(--text-font);
|
||||||
@ -21,7 +20,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.theme-switcher__button {
|
.theme-switcher__button {
|
||||||
flex: 0;
|
flex-wrap: wrap;
|
||||||
box-shadow: var(--shadow-xs);
|
box-shadow: var(--shadow-xs);
|
||||||
padding: .625rem .875rem;
|
padding: .625rem .875rem;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
@ -76,9 +75,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-switcher__button:hover {
|
|
||||||
.theme-switcher__icon {
|
|
||||||
color: var(--link-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,23 +1,43 @@
|
|||||||
.docs-toc {
|
.docs-toc {
|
||||||
margin: 2rem 0;
|
margin: 2rem 0;
|
||||||
}
|
|
||||||
|
|
||||||
.docs-toc {
|
|
||||||
.docs-aside & {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media all and (min-width: 1400px) {
|
@media all and (min-width: 1400px) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.docs-aside & {
|
.docs-aside & {
|
||||||
|
display: none;
|
||||||
|
|
||||||
@media all and (min-width: 1400px) {
|
@media all and (min-width: 1400px) {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.docs-aside {
|
||||||
|
// for sticky table of contents in sidebar
|
||||||
|
.docs-toc.c-toc {
|
||||||
|
background-color: var(--body-background-color);
|
||||||
|
@media all and (min-width: 1400px) {
|
||||||
|
position: sticky;
|
||||||
|
top: 20px;
|
||||||
|
overflow-y: auto; // show scrollbar when toc is higher than viewport
|
||||||
|
padding-right: 5px; // push scrollbar away from content
|
||||||
|
max-height: calc(100vh - 32px); // minus element's margin-top
|
||||||
|
a.active {
|
||||||
|
color: var(--link-color);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.c-toc ol li.active::before {
|
||||||
|
@media all and (min-width: 1400px) {
|
||||||
|
color: var(--link-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.c-toc {
|
.c-toc {
|
||||||
ol {
|
ol {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -100,13 +120,10 @@
|
|||||||
color: var(--color-neutral-400);
|
color: var(--color-neutral-400);
|
||||||
|
|
||||||
[aria-expanded="true"] & {
|
[aria-expanded="true"] & {
|
||||||
-ms-transform: rotate(180deg);
|
|
||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.c-toc__panel {
|
.c-toc__panel {
|
||||||
&[data-open="false"] {
|
&[data-open="false"] {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -10,13 +10,16 @@
|
|||||||
align-items: start;
|
align-items: start;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
|
|
||||||
padding-block-start: 0;
|
padding-block-start: 0;
|
||||||
padding-block-end: 0;
|
padding-block-end: 0;
|
||||||
|
max-width: 1700px;
|
||||||
|
|
||||||
@media all and (min-width: 1024px) {
|
@media all and (min-width: 1024px) {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
@media all and (min-width: 1700px) {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,11 +4,6 @@ html {
|
|||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
}
|
}
|
||||||
|
|
||||||
.docs {
|
|
||||||
max-width: 1700px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.docs-aside__content {
|
.docs-aside__content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
@ -18,12 +13,16 @@ html {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
max-width: 1700px;
|
||||||
|
|
||||||
@media all and (min-width: 1024px) {
|
@media all and (min-width: 1024px) {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: minmax(250px, 1fr) minmax(0, 3.5fr);
|
grid-template-columns: minmax(250px, 1fr) minmax(0, 3.5fr);
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
}
|
}
|
||||||
|
@media all and (min-width: 1700px) {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.docs-nav {
|
.docs-nav {
|
||||||
@ -31,8 +30,7 @@ html {
|
|||||||
grid-row: 1 / 2;
|
grid-row: 1 / 2;
|
||||||
padding-top: var(--space-l-xl);
|
padding-top: var(--space-l-xl);
|
||||||
padding-block-start: var(--space-l-xl);
|
padding-block-start: var(--space-l-xl);
|
||||||
font-size: .875rem;
|
font-size: 0.875rem;
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-auto-rows: max-content;
|
grid-auto-rows: max-content;
|
||||||
align-items: start;
|
align-items: start;
|
||||||
@ -41,7 +39,6 @@ html {
|
|||||||
padding: var(--space-l-xl) 0;
|
padding: var(--space-l-xl) 0;
|
||||||
padding-right: var(--space-s-l);
|
padding-right: var(--space-s-l);
|
||||||
padding-inline-end: var(--space-s-l);
|
padding-inline-end: var(--space-s-l);
|
||||||
|
|
||||||
border-right: 1px solid var(--divider-color);
|
border-right: 1px solid var(--divider-color);
|
||||||
border-inline-end: 1px solid var(--divider-color);
|
border-inline-end: 1px solid var(--divider-color);
|
||||||
}
|
}
|
||||||
@ -73,7 +70,6 @@ html {
|
|||||||
@media all and (min-width: 800px) {
|
@media all and (min-width: 800px) {
|
||||||
padding-right: var(--space-s-l);
|
padding-right: var(--space-s-l);
|
||||||
padding-inline-end: var(--space-s-l);
|
padding-inline-end: var(--space-s-l);
|
||||||
|
|
||||||
border-right: 1px solid var(--divider-color);
|
border-right: 1px solid var(--divider-color);
|
||||||
border-inline-end: 1px solid var(--divider-color);
|
border-inline-end: 1px solid var(--divider-color);
|
||||||
}
|
}
|
||||||
@ -83,7 +79,6 @@ html {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.docs-aside {
|
.docs-aside {
|
||||||
grid-column: 2 / 3;
|
grid-column: 2 / 3;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -131,6 +126,15 @@ div.incorrect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.img-container {
|
||||||
|
background-color: var(--img-background-color);
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
|
||||||
|
img {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pre[class*="language-"] {
|
pre[class*="language-"] {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -138,10 +142,10 @@ pre[class*="language-"] {
|
|||||||
.c-btn.c-btn--playground {
|
.c-btn.c-btn--playground {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
font-size: var(--step--1);
|
font-size: var(--step--1);
|
||||||
bottom: .5rem;
|
bottom: 0.5rem;
|
||||||
right: .5rem;
|
right: 0.5rem;
|
||||||
offset-block-end: .5rem;
|
offset-block-end: 0.5rem;
|
||||||
offset-inline-end: .5rem;
|
offset-inline-end: 0.5rem;
|
||||||
|
|
||||||
@media all and (max-width: 768px) {
|
@media all and (max-width: 768px) {
|
||||||
display: none;
|
display: none;
|
||||||
@ -153,3 +157,27 @@ pre[class*="language-"] {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#scroll-up-btn {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
right: 50px;
|
||||||
|
bottom: 35px;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
color: var(--body-background-color);
|
||||||
|
text-decoration: none;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: var(--link-color);
|
||||||
|
|
||||||
|
@media (max-width: 800px) {
|
||||||
|
right: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
right: 25px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
.c-custom-select {
|
.c-custom-select {
|
||||||
-moz-appearance: none;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
appearance: none;
|
appearance: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
min-width: 0px;
|
min-width: 0;
|
||||||
padding: .625rem .875rem;
|
padding: .625rem .875rem;
|
||||||
padding-right: calc(.875rem * 2.5);
|
padding-right: calc(.875rem * 2.5);
|
||||||
padding-inline-end: calc(.875rem * 2.5);
|
padding-inline-end: calc(.875rem * 2.5);
|
||||||
@ -19,14 +17,12 @@
|
|||||||
background-color: var(--body-background-color);
|
background-color: var(--body-background-color);
|
||||||
background-image: url("data:image/svg+xml,%3Csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.60938L10 12.6094L15 7.60938' stroke='%23667085' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A"), linear-gradient(to bottom, var(--body-background-color) 0%, var(--body-background-color) 100%);
|
background-image: url("data:image/svg+xml,%3Csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.60938L10 12.6094L15 7.60938' stroke='%23667085' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A"), linear-gradient(to bottom, var(--body-background-color) 0%, var(--body-background-color) 100%);
|
||||||
background-repeat: no-repeat, repeat;
|
background-repeat: no-repeat, repeat;
|
||||||
background-position: right .875rem top 50%,
|
background-position: right .875rem top 50%, 0 0;
|
||||||
0 0;
|
|
||||||
background-size: 1em auto, 100%;
|
background-size: 1em auto, 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.label__text.label__text {
|
.label__text.label__text {
|
||||||
display: flex;
|
display: flex;
|
||||||
font-size: .875rem;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: .5rem;
|
gap: .5rem;
|
||||||
font-size: .875rem;
|
font-size: .875rem;
|
||||||
@ -45,7 +41,6 @@ input {
|
|||||||
font: inherit;
|
font: inherit;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
display: block;
|
display: block;
|
||||||
line-height: 1.3;
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
@ -46,7 +46,6 @@ input:focus {
|
|||||||
box-shadow: 0 0 0 2px var(--link-color);
|
box-shadow: 0 0 0 2px var(--link-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
*,
|
*,
|
||||||
*::before,
|
*::before,
|
||||||
*::after {
|
*::after {
|
||||||
@ -63,6 +62,7 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
font-size: var(--step-0);
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
@ -81,7 +81,6 @@ body {
|
|||||||
offset-block-start: -30em;
|
offset-block-start: -30em;
|
||||||
offset-inline-start: 0;
|
offset-inline-start: 0;
|
||||||
offset-inline-end: auto;
|
offset-inline-end: auto;
|
||||||
|
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
transition: top .1s linear;
|
transition: top .1s linear;
|
||||||
|
|
||||||
@ -123,8 +122,12 @@ hr {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: var(--space-xl-3xl) calc(1rem + 1vw);
|
padding: var(--space-xl-3xl) calc(1rem + 1vw);
|
||||||
}
|
max-width: 1700px;
|
||||||
|
|
||||||
|
@media all and (min-width: 1700px) {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.section-head {
|
.section-head {
|
||||||
.section-supporting-text {
|
.section-supporting-text {
|
||||||
@ -155,7 +158,6 @@ hr {
|
|||||||
font-size: var(--step-1);
|
font-size: var(--step-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
code,
|
code,
|
||||||
pre {
|
pre {
|
||||||
font-family: var(--mono-font);
|
font-family: var(--mono-font);
|
||||||
@ -170,11 +172,6 @@ code {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p:empty {
|
|
||||||
display: none;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.c-icon {
|
.c-icon {
|
||||||
color: var(--icon-color);
|
color: var(--icon-color);
|
||||||
flex: none;
|
flex: none;
|
||||||
@ -214,7 +211,6 @@ a {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
transition: color .1s linear;
|
transition: color .1s linear;
|
||||||
@ -249,7 +245,6 @@ h6 {
|
|||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ul,
|
ul,
|
||||||
ol {
|
ol {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
@ -259,7 +254,7 @@ ol {
|
|||||||
margin: 0 0 .75em;
|
margin: 0 0 .75em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.person__bio & {
|
.person__bio & {
|
||||||
padding-left: 1.5rem;
|
padding-left: 1.5rem;
|
||||||
padding-inline-start: 1.5rem;
|
padding-inline-start: 1.5rem;
|
||||||
}
|
}
|
||||||
@ -326,7 +321,6 @@ nav {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.video {
|
.video {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
max-width: 1400px;
|
max-width: 1400px;
|
||||||
@ -347,12 +341,7 @@ nav {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* typography */
|
/* typography */
|
||||||
body {
|
|
||||||
font-size: var(--step-0);
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.eyebrow {
|
.eyebrow {
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
@ -374,7 +363,6 @@ h6 {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-block-start: 0;
|
margin-block-start: 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h2,
|
h2,
|
||||||
@ -382,7 +370,6 @@ h3,
|
|||||||
h4,
|
h4,
|
||||||
h5,
|
h5,
|
||||||
h6 {
|
h6 {
|
||||||
|
|
||||||
.docs-main &,
|
.docs-main &,
|
||||||
.components-main & {
|
.components-main & {
|
||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
@ -397,7 +384,6 @@ h6 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
small,
|
small,
|
||||||
caption,
|
caption,
|
||||||
cite,
|
cite,
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
|
|
||||||
a {
|
a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
display: block;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: .75rem .1rem;
|
padding: .75rem .1rem;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
display: block;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-bottom: 1px solid var(--divider-color);
|
border-bottom: 1px solid var(--divider-color);
|
||||||
@ -27,7 +27,10 @@
|
|||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: "✔️";
|
content: " ✔️";
|
||||||
|
white-space: pre;
|
||||||
|
color: rgba(100%, 0%, 0%, 0);
|
||||||
|
text-shadow: 0 0 0 var(--headings-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
*,
|
*,
|
||||||
*:before,
|
*::before,
|
||||||
*:after,
|
*::after,
|
||||||
*:first-letter,
|
*::first-letter,
|
||||||
p:first-line,
|
p::first-line,
|
||||||
div:first-line,
|
div::first-line,
|
||||||
blockquote:first-line,
|
blockquote::first-line,
|
||||||
li:first-line {
|
li::first-line {
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
color: #000 !important;
|
color: #000 !important;
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
@ -64,7 +64,6 @@ h6 {
|
|||||||
font-size: 14pt;
|
font-size: 14pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
p,
|
p,
|
||||||
h2,
|
h2,
|
||||||
h3 {
|
h3 {
|
||||||
@ -110,7 +109,7 @@ a:visited {
|
|||||||
// font-size: 90%;
|
// font-size: 90%;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
abbr[title]:after {
|
abbr[title]::after {
|
||||||
content: " ("attr(title) ")";
|
content: " ("attr(title) ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,17 +118,17 @@ a[href^="http://"] {
|
|||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
a[href$=".jpg"]:after,
|
a[href$=".jpg"]::after,
|
||||||
a[href$=".jpeg"]:after,
|
a[href$=".jpeg"]::after,
|
||||||
a[href$=".gif"]:after,
|
a[href$=".gif"]::after,
|
||||||
a[href$=".png"]:after {
|
a[href$=".png"]::after {
|
||||||
content: " ("attr(href) ") ";
|
content: " ("attr(href) ") ";
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't show links that are fragment identifiers, or use the `javascript:` pseudo protocol .. taken from html5boilerplate */
|
/* Don't show links that are fragment identifiers, or use the `javascript:` pseudo protocol .. taken from html5boilerplate */
|
||||||
a[href^="#"]:after,
|
a[href^="#"]::after,
|
||||||
a[href^="javascript:"]:after {
|
a[href^="javascript:"]::after {
|
||||||
content: "";
|
content: "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +171,7 @@ tr {
|
|||||||
page-break-inside: avoid;
|
page-break-inside: avoid;
|
||||||
}
|
}
|
||||||
|
|
||||||
body>*:not(main),
|
body > *:not(main),
|
||||||
aside,
|
aside,
|
||||||
*[class*="sidebar"] {
|
*[class*="sidebar"] {
|
||||||
display: none;
|
display: none;
|
||||||
@ -184,8 +183,8 @@ button,
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
a[href^='http']:not([href*='mywebsite.com'])::after {
|
a[href^="http"]:not([href*="eslint.org"])::after {
|
||||||
content: ' ('attr(href) ')';
|
content: " ("attr(href) ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
.resource a::after {
|
.resource a::after {
|
||||||
@ -196,7 +195,10 @@ ul {
|
|||||||
page-break-inside: avoid;
|
page-break-inside: avoid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.docs-toc, .docs-index, .docs-aside, #skip-link{
|
.docs-toc,
|
||||||
|
.docs-index,
|
||||||
|
.docs-aside,
|
||||||
|
#skip-link {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,3 +207,7 @@ ul {
|
|||||||
margin: 1cm;
|
margin: 1cm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#scroll-up-btn {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
@ -1,37 +1,35 @@
|
|||||||
|
@import "tokens/themes";
|
||||||
|
@import "tokens/spacing";
|
||||||
|
@import "tokens/typography";
|
||||||
|
@import "tokens/ui";
|
||||||
|
|
||||||
@import "tokens/themes.scss";
|
@import "foundations";
|
||||||
@import "tokens/spacing.scss";
|
@import "syntax-highlighter";
|
||||||
@import "tokens/typography.scss";
|
@import "docs-header";
|
||||||
@import "tokens/ui.scss";
|
@import "docs-footer";
|
||||||
|
@import "eslint-site-footer";
|
||||||
|
@import "eslint-site-header";
|
||||||
|
@import "forms";
|
||||||
|
@import "docs";
|
||||||
|
@import "versions";
|
||||||
|
@import "languages";
|
||||||
|
|
||||||
@import "foundations.scss";
|
@import "components/buttons";
|
||||||
@import "syntax-highlighter.scss";
|
@import "components/docs-navigation";
|
||||||
@import "docs-header.scss";
|
@import "components/toc";
|
||||||
@import "docs-footer.scss";
|
@import "components/search";
|
||||||
@import "eslint-site-footer.scss";
|
@import "components/alert";
|
||||||
@import "eslint-site-header.scss";
|
@import "components/rules";
|
||||||
@import "forms.scss";
|
@import "components/social-icons";
|
||||||
@import "docs.scss";
|
@import "components/hero";
|
||||||
@import "versions.scss";
|
@import "components/theme-switcher";
|
||||||
@import "languages.scss";
|
@import "components/version-switcher";
|
||||||
|
@import "components/language-switcher";
|
||||||
|
@import "components/docs-index"; // docs index on the main docs pages
|
||||||
|
@import "components/index"; // used in component library
|
||||||
|
@import "components/tabs";
|
||||||
|
@import "components/resources";
|
||||||
|
|
||||||
@import "components/buttons.scss";
|
@import "carbon-ads";
|
||||||
@import "components/docs-navigation.scss";
|
|
||||||
@import "components/toc.scss";
|
|
||||||
@import "components/search.scss";
|
|
||||||
@import "components/alert.scss";
|
|
||||||
@import "components/rules.scss";
|
|
||||||
@import "components/social-icons.scss";
|
|
||||||
@import "components/hero.scss";
|
|
||||||
@import "components/theme-switcher.scss";
|
|
||||||
@import "components/version-switcher.scss";
|
|
||||||
@import "components/language-switcher.scss";
|
|
||||||
@import "components/docs-index.scss"; // docs index on the main docs pages
|
|
||||||
@import "components/index.scss"; // used in component library
|
|
||||||
@import "components/tabs.scss";
|
|
||||||
@import "components/index.scss";
|
|
||||||
@import "components/resources.scss";
|
|
||||||
|
|
||||||
@import "carbon-ads.scss";
|
@import "utilities";
|
||||||
|
|
||||||
@import "utilities.scss";
|
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
code[class*="language-"],
|
code[class*="language-"],
|
||||||
pre[class*="language-"] {
|
pre[class*="language-"] {
|
||||||
font-family: var(--mono-font), Consolas,
|
font-family:
|
||||||
|
var(--mono-font),
|
||||||
|
Consolas,
|
||||||
Monaco,
|
Monaco,
|
||||||
'Andale Mono',
|
"Andale Mono",
|
||||||
'Ubuntu Mono',
|
"Ubuntu Mono",
|
||||||
monospace;
|
monospace;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@ -13,19 +15,11 @@ pre[class*="language-"] {
|
|||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-variant-ligatures: none;
|
font-variant-ligatures: none;
|
||||||
|
|
||||||
-moz-tab-size: 4;
|
|
||||||
-o-tab-size: 4;
|
|
||||||
tab-size: 4;
|
tab-size: 4;
|
||||||
|
|
||||||
-webkit-hyphens: none;
|
|
||||||
-moz-hyphens: none;
|
|
||||||
-ms-hyphens: none;
|
|
||||||
hyphens: none;
|
hyphens: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
|
|
||||||
code[class*="language-"],
|
code[class*="language-"],
|
||||||
pre[class*="language-"] {
|
pre[class*="language-"] {
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
@ -37,26 +31,28 @@ pre[class*="language-"] {
|
|||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
margin: 1.5rem 0;
|
margin: 1.5rem 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
background-color: var(--color-neutral-50);
|
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
|
|
||||||
background-color: var(--lightest-background-color);
|
background-color: var(--lightest-background-color);
|
||||||
color: var(--color-neutral-900);
|
color: var(--color-neutral-900);
|
||||||
|
|
||||||
[data-theme="dark"] & {
|
[data-theme="dark"] & {
|
||||||
color: var(--color-neutral-100);
|
color: var(--color-neutral-100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.line-numbers-mode {
|
||||||
|
padding-left: calc(1.5rem + 2.4em + 1.2rem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:not(pre)>code[class*="language-"],
|
:not(pre) > code[class*="language-"],
|
||||||
pre[class*="language-"] {
|
pre[class*="language-"] {
|
||||||
background-color: var(--lightest-background-color);
|
background-color: var(--lightest-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inline code */
|
/* Inline code */
|
||||||
:not(pre)>code[class*="language-"] {
|
:not(pre) > code[class*="language-"] {
|
||||||
padding: .1em;
|
padding: 0.1em;
|
||||||
border-radius: .3em;
|
border-radius: 0.3em;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,19 +60,17 @@ pre[class*="language-"] {
|
|||||||
.token.prolog,
|
.token.prolog,
|
||||||
.token.doctype,
|
.token.doctype,
|
||||||
.token.cdata {
|
.token.cdata {
|
||||||
color: #6E7F8E;
|
color: #6e7f8e;
|
||||||
|
|
||||||
[data-theme="dark"] & {
|
[data-theme="dark"] & {
|
||||||
color: #8E9FAE;
|
color: #8e9fae;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.token.namespace {
|
.token.namespace {
|
||||||
opacity: .7;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.token.selector,
|
.token.selector,
|
||||||
.token.attr-name,
|
.token.attr-name,
|
||||||
.token.string,
|
.token.string,
|
||||||
@ -86,7 +80,6 @@ pre[class*="language-"] {
|
|||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.token.atrule,
|
.token.atrule,
|
||||||
.token.attr-value,
|
.token.attr-value,
|
||||||
.token.keyword {
|
.token.keyword {
|
||||||
@ -106,25 +99,24 @@ pre[class*="language-"] {
|
|||||||
cursor: help;
|
cursor: help;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
.line-numbers-wrapper {
|
||||||
counter-reset: lineNumber;
|
position: absolute;
|
||||||
}
|
top: 0;
|
||||||
|
left: 1.5rem;
|
||||||
code .highlight-line {
|
|
||||||
font-variant-ligatures: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
code .highlight-line:before {
|
|
||||||
-webkit-user-select: none;
|
|
||||||
color: var(--icon-color);
|
|
||||||
content: counter(lineNumber);
|
|
||||||
counter-increment: lineNumber;
|
|
||||||
display: inline-block;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
margin-right: 1.2em;
|
|
||||||
padding-right: 1.2em;
|
|
||||||
margin-inline-end: 1.2em;
|
|
||||||
padding-inline-end: 1.2em;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
width: 2.4em;
|
padding-top: 1.5rem;
|
||||||
|
font-size: 1em;
|
||||||
|
font-family: var(--mono-font), Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: var(--icon-color);
|
||||||
|
font-variant-ligatures: none;
|
||||||
|
|
||||||
|
.line-number {
|
||||||
|
user-select: none;
|
||||||
|
color: var(--icon-color);
|
||||||
|
display: inline-block;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
text-align: right;
|
||||||
|
width: 1.2em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,15 +6,7 @@
|
|||||||
|
|
||||||
--fluid-screen: 100vw;
|
--fluid-screen: 100vw;
|
||||||
--fluid-bp: calc((var(--fluid-screen) - var(--fluid-min-width) / 16 * 1rem) / (var(--fluid-max-width) - var(--fluid-min-width)));
|
--fluid-bp: calc((var(--fluid-screen) - var(--fluid-min-width) / 16 * 1rem) / (var(--fluid-max-width) - var(--fluid-min-width)));
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (min-width: 1024px) {
|
|
||||||
:root {
|
|
||||||
--fluid-screen: calc(var(--fluid-max-width) * 1px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--fc-3xs-min: (var(--fc-s-min) * 0.25);
|
--fc-3xs-min: (var(--fc-s-min) * 0.25);
|
||||||
--fc-3xs-max: (var(--fc-s-max) * 0.25);
|
--fc-3xs-max: (var(--fc-s-max) * 0.25);
|
||||||
|
|
||||||
|
@ -1,65 +1,65 @@
|
|||||||
:root {
|
:root {
|
||||||
/* Tier 1 variables */
|
/* Tier 1 variables */
|
||||||
// colors
|
// colors
|
||||||
--color-neutral-25: #FCFCFD;
|
--color-neutral-25: #fcfcfd;
|
||||||
--color-neutral-50: #F9FAFB;
|
--color-neutral-50: #f9fafb;
|
||||||
--color-neutral-100: #F2F4F7;
|
--color-neutral-100: #f2f4f7;
|
||||||
--color-neutral-200: #E4E7EC;
|
--color-neutral-200: #e4e7ec;
|
||||||
--color-neutral-300: #D0D5DD;
|
--color-neutral-300: #d0d5dd;
|
||||||
--color-neutral-400: #98A2B3;
|
--color-neutral-400: #98a2b3;
|
||||||
--color-neutral-500: #667085;
|
--color-neutral-500: #667085;
|
||||||
--color-neutral-600: #475467;
|
--color-neutral-600: #475467;
|
||||||
--color-neutral-700: #344054;
|
--color-neutral-700: #344054;
|
||||||
--color-neutral-800: #1D2939;
|
--color-neutral-800: #1d2939;
|
||||||
--color-neutral-900: #101828;
|
--color-neutral-900: #101828;
|
||||||
|
|
||||||
--color-primary-25: #FBFBFF;
|
--color-primary-25: #fbfbff;
|
||||||
--color-primary-50: #F6F6FE;
|
--color-primary-50: #f6f6fe;
|
||||||
--color-primary-100: #ECECFD;
|
--color-primary-100: #ececfd;
|
||||||
--color-primary-200: #DEDEFF;
|
--color-primary-200: #dedeff;
|
||||||
--color-primary-300: #CCCCFA;
|
--color-primary-300: #ccccfa;
|
||||||
--color-primary-400: #B7B7FF;
|
--color-primary-400: #b7b7ff;
|
||||||
--color-primary-500: #A0A0F5;
|
--color-primary-500: #a0a0f5;
|
||||||
--color-primary-600: #8080F2;
|
--color-primary-600: #8080f2;
|
||||||
--color-primary-700: #6358D4;
|
--color-primary-700: #6358d4;
|
||||||
--color-primary-800: #4B32C3;
|
--color-primary-800: #4b32c3;
|
||||||
--color-primary-900: #341BAB;
|
--color-primary-900: #341bab;
|
||||||
|
|
||||||
--color-warning-25: #FFFCF5;
|
--color-warning-25: #fffcf5;
|
||||||
--color-warning-50: #FFFAEB;
|
--color-warning-50: #fffaeb;
|
||||||
--color-warning-100: #FEF0C7;
|
--color-warning-100: #fef0c7;
|
||||||
--color-warning-200: #FEDF89;
|
--color-warning-200: #fedf89;
|
||||||
--color-warning-300: #FEC84B;
|
--color-warning-300: #fec84b;
|
||||||
--color-warning-400: #FDB022;
|
--color-warning-400: #fdb022;
|
||||||
--color-warning-500: #F79009;
|
--color-warning-500: #f79009;
|
||||||
--color-warning-600: #DC6803;
|
--color-warning-600: #dc6803;
|
||||||
--color-warning-700: #B54708;
|
--color-warning-700: #b54708;
|
||||||
--color-warning-800: #93370D;
|
--color-warning-800: #93370d;
|
||||||
--color-warning-900: #7A2E0E;
|
--color-warning-900: #7a2e0e;
|
||||||
|
|
||||||
--color-success-25: #F6FEF9;
|
--color-success-25: #f6fef9;
|
||||||
--color-success-50: #ECFDF3;
|
--color-success-50: #ecfdf3;
|
||||||
--color-success-100: #D1FADF;
|
--color-success-100: #d1fadf;
|
||||||
--color-success-200: #A6F4C5;
|
--color-success-200: #a6f4c5;
|
||||||
--color-success-300: #6CE9A6;
|
--color-success-300: #6ce9a6;
|
||||||
--color-success-400: #32D583;
|
--color-success-400: #32d583;
|
||||||
--color-success-500: #12B76A;
|
--color-success-500: #12b76a;
|
||||||
--color-success-600: #039855;
|
--color-success-600: #039855;
|
||||||
--color-success-700: #027A48;
|
--color-success-700: #027a48;
|
||||||
--color-success-800: #05603A;
|
--color-success-800: #05603a;
|
||||||
--color-success-900: #054F31;
|
--color-success-900: #054f31;
|
||||||
|
|
||||||
--color-rose-25: #FFF5F6;
|
--color-rose-25: #fff5f6;
|
||||||
--color-rose-50: #FFF1F3;
|
--color-rose-50: #fff1f3;
|
||||||
--color-rose-100: #FFE4E8;
|
--color-rose-100: #ffe4e8;
|
||||||
--color-rose-200: #FECDD6;
|
--color-rose-200: #fecdd6;
|
||||||
--color-rose-300: #FEA3B4;
|
--color-rose-300: #fea3b4;
|
||||||
--color-rose-400: #FD6F8E;
|
--color-rose-400: #fd6f8e;
|
||||||
--color-rose-500: #F63D68;
|
--color-rose-500: #f63d68;
|
||||||
--color-rose-600: #E31B54;
|
--color-rose-600: #e31b54;
|
||||||
--color-rose-700: #C01048;
|
--color-rose-700: #c01048;
|
||||||
--color-rose-800: #A11043;
|
--color-rose-800: #a11043;
|
||||||
--color-rose-900: #89123E;
|
--color-rose-900: #89123e;
|
||||||
|
|
||||||
/* Tier 2 variables */
|
/* Tier 2 variables */
|
||||||
--primary-button-background-color: var(--color-primary-800);
|
--primary-button-background-color: var(--color-primary-800);
|
||||||
@ -79,7 +79,6 @@
|
|||||||
--border-color: var(--color-neutral-300);
|
--border-color: var(--color-neutral-300);
|
||||||
--divider-color: var(--color-neutral-200);
|
--divider-color: var(--color-neutral-200);
|
||||||
|
|
||||||
|
|
||||||
--icon-color: var(--color-neutral-400);
|
--icon-color: var(--color-neutral-400);
|
||||||
--dark-icon-color: var(--color-neutral-500);
|
--dark-icon-color: var(--color-neutral-500);
|
||||||
--link-color: var(--color-primary-800);
|
--link-color: var(--color-primary-800);
|
||||||
@ -97,14 +96,14 @@
|
|||||||
--body-background-color: var(--color-neutral-900);
|
--body-background-color: var(--color-neutral-900);
|
||||||
--body-text-color: var(--color-neutral-300);
|
--body-text-color: var(--color-neutral-300);
|
||||||
--headings-color: #fff;
|
--headings-color: #fff;
|
||||||
|
|
||||||
--divider-color: var(--color-neutral-600);
|
--divider-color: var(--color-neutral-600);
|
||||||
--border-color: var(--color-neutral-500);
|
--border-color: var(--color-neutral-500);
|
||||||
|
|
||||||
--icon-color: var(--body-text-color);
|
--icon-color: var(--body-text-color);
|
||||||
--dark-icon-color: #fff;
|
--dark-icon-color: #fff;
|
||||||
--link-color: var(--color-primary-400);
|
--link-color: var(--color-primary-400);
|
||||||
|
|
||||||
--lighter-background-color: var(--color-neutral-800);
|
--lighter-background-color: var(--color-neutral-800);
|
||||||
--lightest-background-color: var(--color-neutral-800);
|
--lightest-background-color: var(--color-neutral-800);
|
||||||
--docs-lightest-background-color: var(--color-neutral-800);
|
--docs-lightest-background-color: var(--color-neutral-800);
|
||||||
@ -114,8 +113,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
html[data-theme="light"] {
|
html[data-theme="light"] {
|
||||||
--body-background-color: #fff;
|
--body-background-color: #fff;
|
||||||
--body-text-color: var(--color-neutral-500);
|
--body-text-color: var(--color-neutral-500);
|
||||||
@ -124,7 +121,6 @@ html[data-theme="light"] {
|
|||||||
--border-color: var(--color-neutral-300);
|
--border-color: var(--color-neutral-300);
|
||||||
--divider-color: var(--color-neutral-200);
|
--divider-color: var(--color-neutral-200);
|
||||||
|
|
||||||
|
|
||||||
--icon-color: var(--color-neutral-400);
|
--icon-color: var(--color-neutral-400);
|
||||||
--dark-icon-color: var(--color-neutral-500);
|
--dark-icon-color: var(--color-neutral-500);
|
||||||
--link-color: var(--color-primary-800);
|
--link-color: var(--color-primary-800);
|
||||||
@ -135,6 +131,7 @@ html[data-theme="light"] {
|
|||||||
--hero-background-color: var(--color-neutral-25);
|
--hero-background-color: var(--color-neutral-25);
|
||||||
--footer-background-color: var(--color-neutral-25);
|
--footer-background-color: var(--color-neutral-25);
|
||||||
--outline-color: var(--color-brand);
|
--outline-color: var(--color-brand);
|
||||||
|
--img-background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[data-theme="dark"] {
|
html[data-theme="dark"] {
|
||||||
@ -155,4 +152,5 @@ html[data-theme="dark"] {
|
|||||||
--hero-background-color: var(--color-neutral-800);
|
--hero-background-color: var(--color-neutral-800);
|
||||||
--footer-background-color: var(--color-neutral-800);
|
--footer-background-color: var(--color-neutral-800);
|
||||||
--outline-color: #fff;
|
--outline-color: #fff;
|
||||||
|
--img-background-color: var(--color-neutral-300);
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,5 @@
|
|||||||
/* @link https://utopia.fyi/type/calculator?c=320,16,1.125,1280,16,1.25,6,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l */
|
/* @link https://utopia.fyi/type/calculator?c=320,16,1.125,1280,16,1.25,6,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l */
|
||||||
|
|
||||||
:root {
|
|
||||||
--fluid-min-width: 320;
|
|
||||||
--fluid-max-width: 1280;
|
|
||||||
|
|
||||||
--fluid-screen: 100vw;
|
|
||||||
--fluid-bp: calc((var(--fluid-screen) - var(--fluid-min-width) / 16 * 1rem) / (var(--fluid-max-width) - var(--fluid-min-width)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (min-width: 1280px) {
|
@media screen and (min-width: 1280px) {
|
||||||
:root {
|
:root {
|
||||||
--fluid-screen: calc(var(--fluid-max-width) * 1px);
|
--fluid-screen: calc(var(--fluid-max-width) * 1px);
|
||||||
@ -15,6 +7,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
|
--fluid-min-width: 320;
|
||||||
|
--fluid-max-width: 1280;
|
||||||
|
|
||||||
|
--fluid-screen: 100vw;
|
||||||
|
--fluid-bp: calc((var(--fluid-screen) - var(--fluid-min-width) / 16 * 1rem) / (var(--fluid-max-width) - var(--fluid-min-width)));
|
||||||
|
|
||||||
--f--2-min: 12.64;
|
--f--2-min: 12.64;
|
||||||
--f--2-max: 10.24;
|
--f--2-max: 10.24;
|
||||||
--step--2: calc(((var(--f--2-min) / 16) * 1rem) + (var(--f--2-max) - var(--f--2-min)) * var(--fluid-bp));
|
--step--2: calc(((var(--f--2-min) / 16) * 1rem) + (var(--f--2-max) - var(--f--2-min)) * var(--fluid-bp));
|
||||||
@ -50,30 +48,31 @@
|
|||||||
--f-6-min: 32.44;
|
--f-6-min: 32.44;
|
||||||
--f-6-max: 61.04;
|
--f-6-max: 61.04;
|
||||||
--step-6: calc(((var(--f-6-min) / 16) * 1rem) + (var(--f-6-max) - var(--f-6-min)) * var(--fluid-bp));
|
--step-6: calc(((var(--f-6-min) / 16) * 1rem) + (var(--f-6-max) - var(--f-6-min)) * var(--fluid-bp));
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--mono-font: "Mono Punctuators", "Space Mono", monospace;
|
--mono-font: "Mono Punctuators", "Space Mono", monospace;
|
||||||
--text-font: "Inter",
|
--text-font:
|
||||||
-apple-system,
|
"Inter",
|
||||||
BlinkMacSystemFont,
|
-apple-system,
|
||||||
"Segoe UI",
|
BlinkMacSystemFont,
|
||||||
Roboto,
|
"Segoe UI",
|
||||||
Helvetica,
|
Roboto,
|
||||||
Arial,
|
Helvetica,
|
||||||
sans-serif,
|
Arial,
|
||||||
"Apple Color Emoji",
|
sans-serif,
|
||||||
"Segoe UI Emoji",
|
"Apple Color Emoji",
|
||||||
"Segoe UI Symbol";
|
"Twemoji Country Flags",
|
||||||
--display-font: "Space Grotesk",
|
"Segoe UI Emoji",
|
||||||
-apple-system,
|
"Segoe UI Symbol";
|
||||||
BlinkMacSystemFont,
|
--display-font:
|
||||||
"Segoe UI",
|
"Space Grotesk",
|
||||||
Roboto,
|
-apple-system,
|
||||||
Helvetica,
|
BlinkMacSystemFont,
|
||||||
Arial,
|
"Segoe UI",
|
||||||
sans-serif,
|
Roboto,
|
||||||
"Apple Color Emoji",
|
Helvetica,
|
||||||
"Segoe UI Emoji",
|
Arial,
|
||||||
"Segoe UI Symbol";
|
sans-serif,
|
||||||
|
"Apple Color Emoji",
|
||||||
|
"Segoe UI Emoji",
|
||||||
|
"Segoe UI Symbol";
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
:root {
|
:root {
|
||||||
// elevations
|
// elevations
|
||||||
--shadow-lg: 0px 12px 16px -4px rgba(16, 24, 40, 0.1),
|
--shadow-lg:
|
||||||
0px 4px 6px -2px rgba(16, 24, 40, 0.05);
|
0 12px 16px -4px rgba(16, 24, 40, 0.1),
|
||||||
--shadow-xs: 0px 1px 2px rgba(16, 24, 40, 0.05);
|
0 4px 6px -2px rgba(16, 24, 40, 0.05);
|
||||||
|
--shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
|
||||||
|
|
||||||
--border-radius: .5rem;
|
--border-radius: .5rem;
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
clip: rect(0 0 0 0);
|
clip: rect(0 0 0 0);
|
||||||
clip-path: inset(100%);
|
clip-path: inset(100%);
|
||||||
height: 1px;
|
height: 1px;
|
||||||
overflow:
|
overflow: hidden;
|
||||||
hidden;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@ -35,7 +34,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.text.text {
|
.text.text {
|
||||||
font-size: inherit;
|
|
||||||
color: inherit;
|
color: inherit;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-family: var(--text-font);
|
font-family: var(--text-font);
|
||||||
@ -120,7 +118,6 @@
|
|||||||
grid-column: 1 / 8;
|
grid-column: 1 / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.span-1-12 {
|
.span-1-12 {
|
||||||
grid-column: 1 / -1;
|
grid-column: 1 / -1;
|
||||||
}
|
}
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
|
|
||||||
a {
|
a {
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
display: block;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 1rem .5rem;
|
padding: 1rem .5rem;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
display: block;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-bottom: 1px solid var(--divider-color);
|
border-bottom: 1px solid var(--divider-color);
|
||||||
@ -28,7 +28,10 @@
|
|||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: "✔️";
|
content: " ✔️";
|
||||||
|
white-space: pre;
|
||||||
|
color: rgba(100%, 0%, 0%, 0);
|
||||||
|
text-shadow: 0 0 0 var(--headings-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
---
|
---
|
||||||
title: Architecture
|
title: Architecture
|
||||||
layout: doc
|
|
||||||
eleventyNavigation:
|
eleventyNavigation:
|
||||||
key: architecture
|
key: architecture
|
||||||
parent: developer guide
|
parent: contribute to eslint
|
||||||
title: Architecture
|
title: Architecture
|
||||||
order: 1
|
order: 5
|
||||||
---
|
---
|
||||||
|
|
||||||
<center><img alt="dependency graph" src="../../assets/images/architecture/dependency.svg"></center>
|
:::img-container
|
||||||
|
<img alt="dependency graph" src="../../assets/images/architecture/dependency.svg">
|
||||||
|
:::
|
||||||
|
|
||||||
At a high level, there are a few key parts to ESLint:
|
At a high level, there are a few key parts to ESLint:
|
||||||
|
|
@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: Code Conventions
|
title: Code Conventions
|
||||||
layout: doc
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Code conventions for ESLint are determined by
|
Code conventions for ESLint are determined by
|
||||||
@ -8,7 +7,7 @@ Code conventions for ESLint are determined by
|
|||||||
|
|
||||||
The rationales for the specific rules in use can be found by looking to the
|
The rationales for the specific rules in use can be found by looking to the
|
||||||
project documentation for any given rule. If the rule is one of our own, see
|
project documentation for any given rule. If the rule is one of our own, see
|
||||||
our own [rule documentation](https://eslint.org/docs/rules/) and otherwise, see
|
our own [rule documentation](../rules/) and otherwise, see
|
||||||
the documentation of the plugin in which the rule can be found.
|
the documentation of the plugin in which the rule can be found.
|
||||||
|
|
||||||
If you need to make changes to a `package.json` file, please see the
|
If you need to make changes to a `package.json` file, please see the
|
10
eslint/docs/src/contribute/code-of-conduct.md
Normal file
10
eslint/docs/src/contribute/code-of-conduct.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
title: Code of Conduct
|
||||||
|
eleventyNavigation:
|
||||||
|
key: code of conduct
|
||||||
|
parent: contribute to eslint
|
||||||
|
title: Code of Conduct
|
||||||
|
order: 0
|
||||||
|
---
|
||||||
|
|
||||||
|
ESLint welcomes contributions from everyone and adheres to the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct). We kindly request that you read over this code of conduct before contributing.
|
110
eslint/docs/src/contribute/core-rules.md
Normal file
110
eslint/docs/src/contribute/core-rules.md
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
---
|
||||||
|
title: Contribute to Core Rules
|
||||||
|
eleventyNavigation:
|
||||||
|
key: contribute core rule
|
||||||
|
parent: contribute to eslint
|
||||||
|
title: Contribute to Core Rules
|
||||||
|
order: 10
|
||||||
|
---
|
||||||
|
|
||||||
|
The ESLint core rules are the rules included in the ESLint package.
|
||||||
|
|
||||||
|
## Rule Writing Documentation
|
||||||
|
|
||||||
|
For full reference information on writing rules, refer to [Custom Rules](../extend/custom-rules). Both custom rules and core rules have the same API. The primary difference between core and custom rules are:
|
||||||
|
|
||||||
|
1. Core rules are included in the `eslint` package.
|
||||||
|
1. Core rules must adhere to the conventions documented on this page.
|
||||||
|
|
||||||
|
## File Structure
|
||||||
|
|
||||||
|
Each core rule in ESLint has three files named with its identifier (for example, `no-extra-semi`).
|
||||||
|
|
||||||
|
* in the `lib/rules` directory: a source file (for example, `no-extra-semi.js`)
|
||||||
|
* in the `tests/lib/rules` directory: a test file (for example, `no-extra-semi.js`)
|
||||||
|
* in the `docs/src/rules` directory: a Markdown documentation file (for example, `no-extra-semi.md`)
|
||||||
|
|
||||||
|
**Important:** If you submit a core rule to the ESLint repository, you **must** follow the conventions explained below.
|
||||||
|
|
||||||
|
Here is the basic format of the source file for a rule:
|
||||||
|
|
||||||
|
```js
|
||||||
|
/**
|
||||||
|
* @fileoverview Rule to disallow unnecessary semicolons
|
||||||
|
* @author Nicholas C. Zakas
|
||||||
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Rule Definition
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/** @type {import('../shared/types').Rule} */
|
||||||
|
module.exports = {
|
||||||
|
meta: {
|
||||||
|
type: "suggestion",
|
||||||
|
|
||||||
|
docs: {
|
||||||
|
description: "disallow unnecessary semicolons",
|
||||||
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-extra-semi"
|
||||||
|
},
|
||||||
|
fixable: "code",
|
||||||
|
schema: [] // no options
|
||||||
|
},
|
||||||
|
create: function(context) {
|
||||||
|
return {
|
||||||
|
// callback functions
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## Rule Unit Tests
|
||||||
|
|
||||||
|
Each bundled rule for ESLint core must have a set of unit tests submitted with it to be accepted. The test file is named the same as the source file but lives in `tests/lib/`. For example, if the rule source file is `lib/rules/foo.js` then the test file should be `tests/lib/rules/foo.js`.
|
||||||
|
|
||||||
|
ESLint provides the [`RuleTester`](../integrate/nodejs-api#ruletester) utility to make it easy to write tests for rules.
|
||||||
|
|
||||||
|
## Performance Testing
|
||||||
|
|
||||||
|
To keep the linting process efficient and unobtrusive, it is useful to verify the performance impact of new rules or modifications to existing rules.
|
||||||
|
|
||||||
|
To learn how to profile the performance of individual rules, refer to [Profile Rule Performance](../extend/custom-rules#profile-rule-performance) in the custom rules documentation.
|
||||||
|
|
||||||
|
When developing in the ESLint core repository, the `npm run perf` command gives a high-level overview of ESLint running time with all core rules enabled.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git checkout main
|
||||||
|
Switched to branch 'main'
|
||||||
|
|
||||||
|
$ npm run perf
|
||||||
|
CPU Speed is 2200 with multiplier 7500000
|
||||||
|
Performance Run #1: 1394.689313ms
|
||||||
|
Performance Run #2: 1423.295351ms
|
||||||
|
Performance Run #3: 1385.09515ms
|
||||||
|
Performance Run #4: 1382.406982ms
|
||||||
|
Performance Run #5: 1409.68566ms
|
||||||
|
Performance budget ok: 1394.689313ms (limit: 3409.090909090909ms)
|
||||||
|
|
||||||
|
$ git checkout my-rule-branch
|
||||||
|
Switched to branch 'my-rule-branch'
|
||||||
|
|
||||||
|
$ npm run perf
|
||||||
|
CPU Speed is 2200 with multiplier 7500000
|
||||||
|
Performance Run #1: 1443.736547ms
|
||||||
|
Performance Run #2: 1419.193291ms
|
||||||
|
Performance Run #3: 1436.018228ms
|
||||||
|
Performance Run #4: 1473.605485ms
|
||||||
|
Performance Run #5: 1457.455283ms
|
||||||
|
Performance budget ok: 1443.736547ms (limit: 3409.090909090909ms)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Rule Naming Conventions
|
||||||
|
|
||||||
|
The rule naming conventions for ESLint are as follows:
|
||||||
|
|
||||||
|
* Use dashes between words.
|
||||||
|
* If your rule only disallows something, prefix it with `no-` such as `no-eval` for disallowing `eval()` and `no-debugger` for disallowing `debugger`.
|
||||||
|
* If your rule is enforcing the inclusion of something, use a short name without a special prefix.
|
@ -1,12 +1,10 @@
|
|||||||
---
|
---
|
||||||
title: Development Environment
|
title: Set up a Development Environment
|
||||||
layout: doc
|
|
||||||
eleventyNavigation:
|
eleventyNavigation:
|
||||||
key: set up a development environment
|
key: development environment
|
||||||
parent: developer guide
|
parent: contribute to eslint
|
||||||
title: Set Up a Development Environment
|
title: Set up a Development Environment
|
||||||
order: 2
|
order: 6
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
ESLint has a very lightweight development environment that makes updating code fast and easy. This is a step-by-step guide to setting up a local development environment that will let you contribute back to the project.
|
ESLint has a very lightweight development environment that makes updating code fast and easy. This is a step-by-step guide to setting up a local development environment that will let you contribute back to the project.
|
||||||
@ -17,10 +15,16 @@ Go to <https://nodejs.org/> to download and install the latest stable version fo
|
|||||||
|
|
||||||
Most of the installers already come with [npm](https://www.npmjs.com/) but if for some reason npm doesn't work on your system, you can install it manually using the instructions on the site.
|
Most of the installers already come with [npm](https://www.npmjs.com/) but if for some reason npm doesn't work on your system, you can install it manually using the instructions on the site.
|
||||||
|
|
||||||
## Step 2: Fork and checkout your own ESLint repository
|
## Step 2: Fork and Checkout Your Own ESLint Repository
|
||||||
|
|
||||||
Go to <https://github.com/eslint/eslint> and click the "Fork" button. Follow the [GitHub documentation](https://help.github.com/articles/fork-a-repo) for forking and cloning.
|
Go to <https://github.com/eslint/eslint> and click the "Fork" button. Follow the [GitHub documentation](https://help.github.com/articles/fork-a-repo) for forking and cloning.
|
||||||
|
|
||||||
|
Clone your fork:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone https://github.com/<Your Github Username>/eslint
|
||||||
|
```
|
||||||
|
|
||||||
Once you've cloned the repository, run `npm install` to get all the necessary dependencies:
|
Once you've cloned the repository, run `npm install` to get all the necessary dependencies:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@ -30,7 +34,9 @@ npm install
|
|||||||
|
|
||||||
You must be connected to the Internet for this step to work. You'll see a lot of utilities being downloaded.
|
You must be connected to the Internet for this step to work. You'll see a lot of utilities being downloaded.
|
||||||
|
|
||||||
## Step 3: Add the upstream source
|
**Note:** It's a good idea to re-run `npm install` whenever you pull from the main repository to ensure you have the latest development dependencies.
|
||||||
|
|
||||||
|
## Step 3: Add the Upstream Source
|
||||||
|
|
||||||
The *upstream source* is the main ESLint repository where active development happens. While you won't have push access to upstream, you will have pull access, allowing you to pull in the latest code whenever you want.
|
The *upstream source* is the main ESLint repository where active development happens. While you won't have push access to upstream, you will have pull access, allowing you to pull in the latest code whenever you want.
|
||||||
|
|
||||||
@ -44,7 +50,7 @@ Now, the remote `upstream` points to the upstream source.
|
|||||||
|
|
||||||
## Step 4: Install the Yeoman Generator
|
## Step 4: Install the Yeoman Generator
|
||||||
|
|
||||||
[Yeoman](http://yeoman.io) is a scaffold generator that ESLint uses to help streamline development of new rules. If you don't already have Yeoman installed, you can install it via npm:
|
[Yeoman](https://yeoman.io) is a scaffold generator that ESLint uses to help streamline development of new rules. If you don't already have Yeoman installed, you can install it via npm:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -g yo
|
npm install -g yo
|
||||||
@ -58,7 +64,7 @@ npm install -g generator-eslint
|
|||||||
|
|
||||||
Please see the [generator documentation](https://github.com/eslint/generator-eslint) for instructions on how to use it.
|
Please see the [generator documentation](https://github.com/eslint/generator-eslint) for instructions on how to use it.
|
||||||
|
|
||||||
## Step 5: Run the tests
|
## Step 5: Run the Tests
|
||||||
|
|
||||||
Running the tests is the best way to ensure you have correctly set up your development environment. Make sure you're in the `eslint` directory and run:
|
Running the tests is the best way to ensure you have correctly set up your development environment. Make sure you're in the `eslint` directory and run:
|
||||||
|
|
||||||
@ -70,9 +76,24 @@ The testing takes a few minutes to complete. If any tests fail, that likely mean
|
|||||||
|
|
||||||
## Reference Information
|
## Reference Information
|
||||||
|
|
||||||
|
### Directory Structure
|
||||||
|
|
||||||
|
The ESLint directory and file structure is as follows:
|
||||||
|
|
||||||
|
* `bin` - executable files that are available when ESLint is installed
|
||||||
|
* `conf` - default configuration information
|
||||||
|
* `docs` - documentation for the project
|
||||||
|
* `lib` - contains the source code
|
||||||
|
* `formatters` - all source files defining formatters
|
||||||
|
* `rules` - all source files defining rules
|
||||||
|
* `tests` - the main unit test folder
|
||||||
|
* `lib` - tests for the source code
|
||||||
|
* `formatters` - tests for the formatters
|
||||||
|
* `rules` - tests for the rules
|
||||||
|
|
||||||
### Workflow
|
### Workflow
|
||||||
|
|
||||||
Once you have your development environment installed, you can make and submit changes to the ESLint source files. Doing this successfully requires careful adherence to our [pull-request submission workflow](contributing/pull-requests).
|
Once you have your development environment installed, you can make and submit changes to the ESLint source files. Doing this successfully requires careful adherence to our [pull-request submission workflow](./pull-requests).
|
||||||
|
|
||||||
### Build Scripts
|
### Build Scripts
|
||||||
|
|
@ -1,11 +1,10 @@
|
|||||||
---
|
---
|
||||||
title: Governance
|
title: Governance
|
||||||
layout: doc
|
|
||||||
eleventyNavigation:
|
eleventyNavigation:
|
||||||
key: governance
|
key: governance
|
||||||
parent: maintainer guide
|
parent: contribute to eslint
|
||||||
title: Governance
|
title: Governance
|
||||||
order: 4
|
order: 11
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -29,7 +28,7 @@ As Contributors gain experience and familiarity with the project, their profile
|
|||||||
|
|
||||||
### Website Team Member
|
### Website Team Member
|
||||||
|
|
||||||
Website Team Members are community members who have shown that they are committed to the continued maintenance of [eslint.org](https://eslint.org/) through ongoing engagement with the community. Website Team Members are given push access to the `eslint.org` GitHub repository and must abide by the project's [Contribution Guidelines](../developer-guide/contributing/).
|
Website Team Members are community members who have shown that they are committed to the continued maintenance of [eslint.org](https://eslint.org/) through ongoing engagement with the community. Website Team Members are given push access to the `eslint.org` GitHub repository and must abide by the project's [Contribution Guidelines](../contribute/).
|
||||||
|
|
||||||
Website Team Members:
|
Website Team Members:
|
||||||
|
|
||||||
@ -37,8 +36,8 @@ Website Team Members are community members who have shown that they are committe
|
|||||||
* Are expected to delete their public branches when they are no longer necessary.
|
* Are expected to delete their public branches when they are no longer necessary.
|
||||||
* Must submit pull requests for all changes.
|
* Must submit pull requests for all changes.
|
||||||
* Have their work reviewed by Reviewers and TSC members before acceptance into the repository.
|
* Have their work reviewed by Reviewers and TSC members before acceptance into the repository.
|
||||||
* May label and close website-related issues (see [Managing Issues](issues.html))
|
* May label and close website-related issues (see [Manage Issues](../maintain/manage-issues))
|
||||||
* May merge some pull requests (see [Managing Pull Requests](pullrequests.html))
|
* May merge some pull requests (see [Review Pull Requests](../maintain/review-pull-requests))
|
||||||
|
|
||||||
To become a Website Team Member:
|
To become a Website Team Member:
|
||||||
|
|
||||||
@ -52,7 +51,7 @@ It is important to recognize that membership on the website team is a privilege,
|
|||||||
|
|
||||||
### Committers
|
### Committers
|
||||||
|
|
||||||
Committers are community members who have shown that they are committed to the continued development of the project through ongoing engagement with the community. Committers are given push access to the project's GitHub repos and must abide by the project's [Contribution Guidelines](../developer-guide/contributing/).
|
Committers are community members who have shown that they are committed to the continued development of the project through ongoing engagement with the community. Committers are given push access to the project's GitHub repos and must abide by the project's [Contribution Guidelines](../contribute/).
|
||||||
|
|
||||||
Committers:
|
Committers:
|
||||||
|
|
||||||
@ -60,8 +59,8 @@ Committers:
|
|||||||
* Are expected to delete their public branches when they are no longer necessary.
|
* Are expected to delete their public branches when they are no longer necessary.
|
||||||
* Must submit pull requests for all changes.
|
* Must submit pull requests for all changes.
|
||||||
* Have their work reviewed by TSC members before acceptance into the repository.
|
* Have their work reviewed by TSC members before acceptance into the repository.
|
||||||
* May label and close issues (see [Managing Issues](issues.html))
|
* May label and close issues (see [Manage Issues](../maintain/manage-issues))
|
||||||
* May merge some pull requests (see [Managing Pull Requests](pullrequests.html))
|
* May merge some pull requests (see [Review Pull Requests](../maintain/review-pull-requests))
|
||||||
|
|
||||||
To become a Committer:
|
To become a Committer:
|
||||||
|
|
||||||
@ -144,7 +143,7 @@ A Reviewer is invited to become a TSC member by existing TSC members. A nominati
|
|||||||
|
|
||||||
1. Add the GitHub user to the "ESLint TSC" GitHub team
|
1. Add the GitHub user to the "ESLint TSC" GitHub team
|
||||||
1. Set the GitHub user to be have the "Owner" role for the ESLint organization
|
1. Set the GitHub user to be have the "Owner" role for the ESLint organization
|
||||||
1. Send a welcome email with a link to the [maintainer guide](./) and instructions for npm 2FA.
|
1. Send a welcome email with a link to the [Maintain ESLint documentation](../maintain/) and instructions for npm 2FA.
|
||||||
1. Invite to the Discord TSC channel
|
1. Invite to the Discord TSC channel
|
||||||
1. Make the TSC member an admin on the ESLint team mailing list
|
1. Make the TSC member an admin on the ESLint team mailing list
|
||||||
1. Add the TSC member to the recurring TSC meeting event on Google Calendar
|
1. Add the TSC member to the recurring TSC meeting event on Google Calendar
|
@ -1,12 +1,9 @@
|
|||||||
---
|
---
|
||||||
title: Contributing
|
title: Contribute to ESLint
|
||||||
layout: doc
|
|
||||||
eleventyNavigation:
|
eleventyNavigation:
|
||||||
key: contributing
|
key: contribute to eslint
|
||||||
parent: developer guide
|
title: Contribute to ESLint
|
||||||
title: Contributing
|
order: 3
|
||||||
order: 10
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
One of the great things about open source projects is that anyone can contribute in any number of meaningful ways. ESLint couldn't exist without the help of the many contributors it's had since the project began, and we want you to feel like you can contribute and make a difference as well.
|
One of the great things about open source projects is that anyone can contribute in any number of meaningful ways. ESLint couldn't exist without the help of the many contributors it's had since the project began, and we want you to feel like you can contribute and make a difference as well.
|
||||||
@ -17,34 +14,54 @@ This guide is intended for anyone who wants to contribute to an ESLint project.
|
|||||||
|
|
||||||
ESLint welcomes contributions from everyone and adheres to the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct). We kindly request that you read over our code of conduct before contributing.
|
ESLint welcomes contributions from everyone and adheres to the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct). We kindly request that you read over our code of conduct before contributing.
|
||||||
|
|
||||||
## [Bug Reporting](reporting-bugs)
|
## [Report Bugs](report-bugs)
|
||||||
|
|
||||||
Think you found a problem? We'd love to hear about it. This section explains how to submit a bug, the type of information we need to properly verify it, and the overall process.
|
Think you found a problem? We'd love to hear about it. This section explains how to submit a bug, the type of information we need to properly verify it, and the overall process.
|
||||||
|
|
||||||
## Proposing a [New Rule](new-rules)
|
## [Propose a New Rule](propose-new-rule)
|
||||||
|
|
||||||
We get a lot of proposals for new rules in ESLint. This section explains how we determine which rules are accepted and what information you should provide to help us evaluate your proposal.
|
We get a lot of proposals for new rules in ESLint. This section explains how we determine which rules are accepted and what information you should provide to help us evaluate your proposal.
|
||||||
|
|
||||||
## Proposing a [Rule Change](rule-changes)
|
## [Propose a Rule Change](propose-rule-change)
|
||||||
|
|
||||||
Want to make a change to an existing rule? This section explains the process and how we evaluate such proposals.
|
Want to make a change to an existing rule? This section explains the process and how we evaluate such proposals.
|
||||||
|
|
||||||
## Requesting a [Change](changes)
|
## [Request a Change](request-change)
|
||||||
|
|
||||||
If you'd like to request a change other than a bug fix or new rule, this section explains that process.
|
If you'd like to request a change other than a bug fix or new rule, this section explains that process.
|
||||||
|
|
||||||
## Reporting a security vulnerability
|
## [Architecture](architecture)
|
||||||
|
|
||||||
To report a security vulnerability in ESLint, please use our [HackerOne program](https://hackerone.com/eslint).
|
Learn about the architecture of the ESLint project.
|
||||||
|
|
||||||
## [Working on Issues](working-on-issues)
|
## [Set up a Development Environment](development-environment)
|
||||||
|
|
||||||
|
Developing for ESLint is a bit different than running it on the command line. This section shows you how to set up a development environment and get you ready to write code.
|
||||||
|
|
||||||
|
## [Run the Tests](tests)
|
||||||
|
|
||||||
|
There are a lot of unit tests included with ESLint to make sure that we're keeping on top of code quality. This section explains how to run the unit tests.
|
||||||
|
|
||||||
|
## [Work on Issues](work-on-issue)
|
||||||
|
|
||||||
Have some extra time and want to contribute? This section talks about the process of working on issues.
|
Have some extra time and want to contribute? This section talks about the process of working on issues.
|
||||||
|
|
||||||
## Submitting a [Pull Request](pull-requests)
|
## [Submit a Pull Request](pull-requests)
|
||||||
|
|
||||||
We're always looking for contributions from the community. This section explains the requirements for pull requests and the process of contributing code.
|
We're always looking for contributions from the community. This section explains the requirements for pull requests and the process of contributing code.
|
||||||
|
|
||||||
## Signing the CLA
|
## [Contribute to Core Rules](core-rules)
|
||||||
|
|
||||||
|
This section explains how to add to the core rules of ESLint.
|
||||||
|
|
||||||
|
## [Governance](governance)
|
||||||
|
|
||||||
|
Describes the governance policy for ESLint, including the rights and privileges of individuals inside the project.
|
||||||
|
|
||||||
|
## [Report a Security Vulnerability](report-security-vulnerability)
|
||||||
|
|
||||||
|
To report a security vulnerability in ESLint, please create an advisory on Github.
|
||||||
|
|
||||||
|
## Sign the CLA
|
||||||
|
|
||||||
In order to submit code or documentation to an ESLint project, you will need to electronically sign our Contributor License Agreement. The CLA is the commonly used Apache-style template, and is you giving us permission to use your contribution. You only need to sign the CLA once for any OpenJS Foundation projects that use EasyCLA. You will be asked to sign the CLA in the first pull request you open.
|
In order to submit code or documentation to an ESLint project, you will need to electronically sign our Contributor License Agreement. The CLA is the commonly used Apache-style template, and is you giving us permission to use your contribution. You only need to sign the CLA once for any OpenJS Foundation projects that use EasyCLA. You will be asked to sign the CLA in the first pull request you open.
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Package.json Conventions
|
title: Package.json Conventions
|
||||||
layout: doc
|
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/contribute/package-json-conventions.md
|
||||||
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/package-json-conventions.md
|
|
||||||
---
|
---
|
||||||
|
|
||||||
The following applies to the "scripts" section of `package.json` files.
|
The following applies to the "scripts" section of `package.json` files.
|
||||||
@ -10,22 +9,16 @@ The following applies to the "scripts" section of `package.json` files.
|
|||||||
|
|
||||||
npm script names MUST contain only lower case letters, `:` to separate parts, `-` to separate words, and `+` to separate file extensions. Each part name SHOULD be either a full English word (e.g. `coverage` not `cov`) or a well-known initialism in all lowercase (e.g. `wasm`).
|
npm script names MUST contain only lower case letters, `:` to separate parts, `-` to separate words, and `+` to separate file extensions. Each part name SHOULD be either a full English word (e.g. `coverage` not `cov`) or a well-known initialism in all lowercase (e.g. `wasm`).
|
||||||
|
|
||||||
Here is a summary of the proposal in EBNF.
|
Here is a summary of the proposal in ABNF.
|
||||||
|
|
||||||
```ebnf
|
```abnf
|
||||||
name = life-cycle | main ":fix"? target? option* ":watch"?
|
name = life-cycle / main target? option* ":watch"?
|
||||||
|
life-cycle = "prepare" / "preinstall" / "install" / "postinstall" / "prepublish" / "preprepare" / "prepare" / "postprepare" / "prepack" / "postpack" / "prepublishOnly"
|
||||||
life-cycle = prepare | preinstall | install | postinstall | prepublish | preprepare | prepare | postprepare | prepack | postpack | prepublishOnly;
|
main = "build" / "lint" ":fix"? / "release" / "start" / "test"
|
||||||
|
target = ":" word ("-" word)* / extension ("+" extension)*
|
||||||
main = "build" | "lint" | "start" | "test";
|
option = ":" word ("-" word)*
|
||||||
|
word = ALPHA +
|
||||||
target = ":" word ("-" word)* | extension ("+" extension)*;
|
extension = ( ALPHA / DIGIT )+
|
||||||
|
|
||||||
option = ":" word ("-" word)*;
|
|
||||||
|
|
||||||
word = [a-z]+;
|
|
||||||
|
|
||||||
extension = [a-z0-9]+;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Order
|
## Order
|
||||||
@ -42,6 +35,10 @@ Scripts that generate a set of files from source code and / or data MUST have na
|
|||||||
|
|
||||||
If a package contains any `build:*` scripts, there MAY be a script named `build`. If so, SHOULD produce the same output as running each of the `build` scripts individually. It MUST produce a subset of the output from running those scripts.
|
If a package contains any `build:*` scripts, there MAY be a script named `build`. If so, SHOULD produce the same output as running each of the `build` scripts individually. It MUST produce a subset of the output from running those scripts.
|
||||||
|
|
||||||
|
### Release
|
||||||
|
|
||||||
|
Scripts that have public side effects (publishing the web site, committing to Git, etc.) MUST begin with `release`.
|
||||||
|
|
||||||
### Lint
|
### Lint
|
||||||
|
|
||||||
Scripts that statically analyze files (mostly, but not limited to running `eslint` itself) MUST have names that begin with `lint`.
|
Scripts that statically analyze files (mostly, but not limited to running `eslint` itself) MUST have names that begin with `lint`.
|
@ -1,7 +1,10 @@
|
|||||||
---
|
---
|
||||||
title: New Rules
|
title: Propose a New Rule
|
||||||
layout: doc
|
eleventyNavigation:
|
||||||
|
key: propose rule
|
||||||
|
parent: contribute to eslint
|
||||||
|
title: Propose a New Rule
|
||||||
|
order: 2
|
||||||
---
|
---
|
||||||
|
|
||||||
ESLint is all about rules. For most of the project's lifetime, we've had over 200 rules, and that list continues to grow. However, we can't just accept any proposed rule because all rules need to work cohesively together. As such, we have some guidelines around which rules can be part of the ESLint core and which are better off as custom rules and plugins.
|
ESLint is all about rules. For most of the project's lifetime, we've had over 200 rules, and that list continues to grow. However, we can't just accept any proposed rule because all rules need to work cohesively together. As such, we have some guidelines around which rules can be part of the ESLint core and which are better off as custom rules and plugins.
|
||||||
@ -23,7 +26,7 @@ Even though these are the formal criteria for inclusion, each rule is evaluated
|
|||||||
|
|
||||||
## Proposing a Rule
|
## Proposing a Rule
|
||||||
|
|
||||||
If you want to propose a new rule, please see how to [create a pull request](/docs/developer-guide/contributing/pull-requests) or submit an issue by filling out a [new rule template](https://github.com/eslint/eslint/issues/new/choose).
|
If you want to propose a new rule, please see how to [create a pull request](pull-requests) or submit an issue by filling out a [new rule template](https://github.com/eslint/eslint/issues/new/choose).
|
||||||
|
|
||||||
We need all of this information in order to determine whether or not the rule is a good core rule candidate.
|
We need all of this information in order to determine whether or not the rule is a good core rule candidate.
|
||||||
|
|
||||||
@ -43,4 +46,4 @@ The ESLint team doesn't implement new rules that are suggested by users because
|
|||||||
|
|
||||||
## Alternative: Creating Your Own Rules
|
## Alternative: Creating Your Own Rules
|
||||||
|
|
||||||
Remember that ESLint is completely pluggable, which means you can create your own rules and distribute them using plugins. We did this on purpose because we don't want to be the gatekeepers for all possible rules. Even if we don't accept a rule into the core, that doesn't mean you can't have the exact rule that you want. See the [working with rules](../working-with-rules) and [working with plugins](../working-with-plugins) documentation for more information.
|
Remember that ESLint is completely pluggable, which means you can create your own rules and distribute them using plugins. We did this on purpose because we don't want to be the gatekeepers for all possible rules. Even if we don't accept a rule into the core, that doesn't mean you can't have the exact rule that you want. See the [Custom Rules](../extend/custom-rules) and [Create Plugins](../extend/plugins) documentation for more information.
|
@ -1,14 +1,17 @@
|
|||||||
---
|
---
|
||||||
title: Rule Changes
|
title: Propose a Rule Change
|
||||||
layout: doc
|
eleventyNavigation:
|
||||||
|
key: propose rule change
|
||||||
|
parent: contribute to eslint
|
||||||
|
title: Propose a Rule Change
|
||||||
|
order: 3
|
||||||
---
|
---
|
||||||
|
|
||||||
Occasionally, a core ESLint rule needs to be changed. This is not necessarily a bug, but rather, an enhancement that makes a rule more configurable. In those situations, we will consider making changes to rules.
|
Occasionally, a core ESLint rule needs to be changed. This is not necessarily a bug, but rather, an enhancement that makes a rule more configurable. In those situations, we will consider making changes to rules.
|
||||||
|
|
||||||
## Proposing a Rule Change
|
## Proposing a Rule Change
|
||||||
|
|
||||||
To propose a change to an existing rule, [create a pull request](/docs/developer-guide/contributing/pull-requests) or [new issue](https://github.com/eslint/eslint/issues/new/choose) and fill out the template.
|
To propose a change to an existing rule, [create a pull request](pull-requests) or [new issue](https://github.com/eslint/eslint/issues/new/choose) and fill out the template.
|
||||||
|
|
||||||
We need all of this information in order to determine whether or not the change is a good candidate for inclusion.
|
We need all of this information in order to determine whether or not the change is a good candidate for inclusion.
|
||||||
|
|
||||||
@ -16,7 +19,7 @@ We need all of this information in order to determine whether or not the change
|
|||||||
|
|
||||||
In order for a rule change to be accepted into ESLint, it must:
|
In order for a rule change to be accepted into ESLint, it must:
|
||||||
|
|
||||||
1. Adhere to the [Core Rule Guidelines](new-rules#core-rule-guidelines)
|
1. Adhere to the [Core Rule Guidelines](propose-new-rule#core-rule-guidelines)
|
||||||
1. Have an ESLint team member champion the change
|
1. Have an ESLint team member champion the change
|
||||||
1. Be important enough that rule is deemed incomplete without this change
|
1. Be important enough that rule is deemed incomplete without this change
|
||||||
|
|
@ -1,7 +1,10 @@
|
|||||||
---
|
---
|
||||||
title: Pull Requests
|
title: Submit a Pull Request
|
||||||
layout: doc
|
eleventyNavigation:
|
||||||
|
key: submit pull request
|
||||||
|
parent: contribute to eslint
|
||||||
|
title: Submit a Pull Request
|
||||||
|
order: 9
|
||||||
---
|
---
|
||||||
|
|
||||||
If you want to contribute to an ESLint repo, please use a GitHub pull request. This is the fastest way for us to evaluate your code and to merge it into the code base. Please don't file an issue with snippets of code. Doing so means that we need to manually merge the changes in and update any appropriate tests. That decreases the likelihood that your code is going to get included in a timely manner. Please use pull requests.
|
If you want to contribute to an ESLint repo, please use a GitHub pull request. This is the fastest way for us to evaluate your code and to merge it into the code base. Please don't file an issue with snippets of code. Doing so means that we need to manually merge the changes in and update any appropriate tests. That decreases the likelihood that your code is going to get included in a timely manner. Please use pull requests.
|
||||||
@ -10,8 +13,8 @@ If you want to contribute to an ESLint repo, please use a GitHub pull request. T
|
|||||||
|
|
||||||
If you'd like to work on a pull request and you've never submitted code before, follow these steps:
|
If you'd like to work on a pull request and you've never submitted code before, follow these steps:
|
||||||
|
|
||||||
1. Set up a [development environment](../development-environment).
|
1. Set up a [development environment](./development-environment).
|
||||||
1. If you want to implement a breaking change or a change to the core, ensure there's an issue that describes what you're doing and the issue has been accepted. You can create a new issue or just indicate you're [working on an existing issue](working-on-issues). Bug fixes, documentation changes, and other pull requests do not require an issue.
|
1. If you want to implement a breaking change or a change to the core, ensure there's an issue that describes what you're doing and the issue has been accepted. You can create a new issue or just indicate you're [working on an existing issue](./work-on-issue). Bug fixes, documentation changes, and other pull requests do not require an issue.
|
||||||
|
|
||||||
After that, you're ready to start working on code.
|
After that, you're ready to start working on code.
|
||||||
|
|
||||||
@ -43,14 +46,14 @@ You should do all of your development for the issue in this branch.
|
|||||||
|
|
||||||
### Step 2: Make your changes<a name="step2"></a>
|
### Step 2: Make your changes<a name="step2"></a>
|
||||||
|
|
||||||
Make the changes to the code and tests, following the [code conventions](../code-conventions) as you go. Once you have finished, commit the changes to your branch:
|
Make the changes to the code and tests, following the [code conventions](./code-conventions) as you go. Once you have finished, commit the changes to your branch:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git add -A
|
git add -A
|
||||||
git commit
|
git commit
|
||||||
```
|
```
|
||||||
|
|
||||||
All ESLint projects follow [Conventional Commits](https://www.conventionalcommits.org/) for our commit messages. Here's an example commit message:
|
All ESLint projects follow [Conventional Commits](https://www.conventionalcommits.org/) for our commit messages. (Note: we don’t support the optional scope in messages.) Here's an example commit message:
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
tag: Short description of what you did
|
tag: Short description of what you did
|
||||||
@ -76,7 +79,7 @@ The `tag` is one of the following:
|
|||||||
* `ci` - changes to our CI configuration files and scripts.
|
* `ci` - changes to our CI configuration files and scripts.
|
||||||
* `perf` - a code change that improves performance.
|
* `perf` - a code change that improves performance.
|
||||||
|
|
||||||
Use the [labels of the issue you are working on](working-on-issues#issue-labels) to determine the best tag.
|
Use the [labels of the issue you are working on](work-on-issue#issue-labels) to determine the best tag.
|
||||||
|
|
||||||
The message summary should be a one-sentence description of the change, and it must be 72 characters in length or shorter. If the pull request addresses an issue, then the issue number should be mentioned in the body of the commit message in the format `Fixes #1234`. If the commit doesn't completely fix the issue, then use `Refs #1234` instead of `Fixes #1234`.
|
The message summary should be a one-sentence description of the change, and it must be 72 characters in length or shorter. If the pull request addresses an issue, then the issue number should be mentioned in the body of the commit message in the format `Fixes #1234`. If the commit doesn't completely fix the issue, then use `Refs #1234` instead of `Fixes #1234`.
|
||||||
|
|
||||||
@ -120,7 +123,7 @@ With your code ready to go, this is a good time to double-check your submission
|
|||||||
* Make separate pull requests for unrelated changes. Large pull requests with multiple unrelated changes may be closed without merging.
|
* Make separate pull requests for unrelated changes. Large pull requests with multiple unrelated changes may be closed without merging.
|
||||||
* All changes must be accompanied by tests, even if the feature you're working on previously had no tests.
|
* All changes must be accompanied by tests, even if the feature you're working on previously had no tests.
|
||||||
* All user-facing changes must be accompanied by appropriate documentation.
|
* All user-facing changes must be accompanied by appropriate documentation.
|
||||||
* Follow the [Code Conventions](../code-conventions).
|
* Follow the [Code Conventions](./code-conventions).
|
||||||
|
|
||||||
### Step 6: Push your changes<a name="step6"></a>
|
### Step 6: Push your changes<a name="step6"></a>
|
||||||
|
|
||||||
@ -180,7 +183,7 @@ The commit messages in subsequent commits do not need to be in any specific form
|
|||||||
|
|
||||||
### Rebasing
|
### Rebasing
|
||||||
|
|
||||||
If your code is out-of-date, we might ask you to rebase. That means we want you to apply your changes on top of the latest upstream code. Make sure you have set up a [development environment](../development-environment) and then you can rebase using these commands:
|
If your code is out-of-date, we might ask you to rebase. That means we want you to apply your changes on top of the latest upstream code. Make sure you have set up a [development environment](./development-environment) and then you can rebase using these commands:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git fetch upstream
|
git fetch upstream
|
@ -1,11 +1,14 @@
|
|||||||
---
|
---
|
||||||
title: Reporting Bugs
|
title: Report Bugs
|
||||||
layout: doc
|
eleventyNavigation:
|
||||||
|
key: report bugs
|
||||||
|
parent: contribute to eslint
|
||||||
|
title: Report Bugs
|
||||||
|
order: 1
|
||||||
---
|
---
|
||||||
|
|
||||||
If you think you've found a bug in ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new/choose) or a [pull request](/docs/developer-guide/contributing/pull-requests) on GitHub.
|
If you think you've found a bug in ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new/choose) or a [pull request](pull-requests) 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.
|
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.
|
||||||
|
|
||||||
**Note:** If you just have a question that won't necessarily result in a change to ESLint, such as asking how something works or how to contribute, please use the [mailing list](https://groups.google.com/group/eslint) or [chat](https://eslint.org/chat) instead of filing an issue.
|
**Note:** If you just have a question that won't necessarily result in a change to ESLint, such as asking how something works or how to contribute, please open a [discussion](https://github.com/eslint/eslint/discussions) or stop by our [Discord server](https://eslint.org/chat) instead of filing an issue.
|
10
eslint/docs/src/contribute/report-security-vulnerability.md
Normal file
10
eslint/docs/src/contribute/report-security-vulnerability.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
title: Report a Security Vulnerability
|
||||||
|
eleventyNavigation:
|
||||||
|
key: report security vulnerability
|
||||||
|
parent: contribute to eslint
|
||||||
|
title: Report a Security Vulnerability
|
||||||
|
order: 11
|
||||||
|
---
|
||||||
|
|
||||||
|
To report a security vulnerability in ESLint, please use our [create an advisory form](https://github.com/eslint/eslint/security/advisories/new) on GitHub.
|
@ -1,7 +1,10 @@
|
|||||||
---
|
---
|
||||||
title: Change Requests
|
title: Request a Change
|
||||||
layout: doc
|
eleventyNavigation:
|
||||||
|
key: request change
|
||||||
|
parent: contribute to eslint
|
||||||
|
title: Request a Change
|
||||||
|
order: 4
|
||||||
---
|
---
|
||||||
|
|
||||||
If you'd like to request a change to ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new/choose) 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/choose) on GitHub. Be sure to include the following information:
|
||||||
@ -18,4 +21,4 @@ If you're requesting a change to a rule, it's helpful to include this informatio
|
|||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
**Note:** If you just have a question that won't necessarily result in a change to ESLint, such as asking how something works or how to contribute, please use the [mailing list](https://groups.google.com/group/eslint) or [chat](https://eslint.org/chat) instead of filing an issue.
|
**Note:** If you just have a question that won't necessarily result in a change to ESLint, such as asking how something works or how to contribute, please open a [discussion](https://github.com/eslint/eslint/discussions) or stop by our [Discord server](https://eslint.org/chat) instead of filing an issue.
|
@ -1,12 +1,10 @@
|
|||||||
---
|
---
|
||||||
title: Unit Tests
|
title: Run the Tests
|
||||||
layout: doc
|
|
||||||
eleventyNavigation:
|
eleventyNavigation:
|
||||||
key: run the tests
|
key: run tests
|
||||||
parent: developer guide
|
parent: contribute to eslint
|
||||||
title: Run the Tests
|
title: Run the Tests
|
||||||
order: 3
|
order: 7
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Most parts of ESLint have unit tests associated with them. Unit tests are written using [Mocha](https://mochajs.org/) and are required when making contributions to ESLint. You'll find all of the unit tests in the `tests` directory.
|
Most parts of ESLint have unit tests associated with them. Unit tests are written using [Mocha](https://mochajs.org/) and are required when making contributions to ESLint. You'll find all of the unit tests in the `tests` directory.
|
@ -1,17 +1,20 @@
|
|||||||
---
|
---
|
||||||
title: Working on Issues
|
title: Work on Issues
|
||||||
layout: doc
|
eleventyNavigation:
|
||||||
|
key: work on issues
|
||||||
|
parent: contribute to eslint
|
||||||
|
title: Work on Issues
|
||||||
|
order: 8
|
||||||
---
|
---
|
||||||
|
|
||||||
Our public [issues tracker](https://github.com/eslint/eslint/issues) lists all of the things we plan on doing as well as suggestions from the community. Before starting to work on an issue, be sure you read through the rest of this page.
|
Our public [issues tracker](https://github.com/eslint/eslint/issues) lists all of the things we plan on doing as well as suggestions from the community. Before starting to work on an issue, be sure you read through the rest of this page.
|
||||||
|
|
||||||
## Issue Labels
|
## Issue Labels
|
||||||
|
|
||||||
We use labels to indicate the status of issues. The most complete documentation on the labels is found in the [Maintainer Guide](https://eslint.org/docs/maintainer-guide/issues.html#when-an-issue-is-opened), but most contributors should find the information on this page sufficient. The most important questions that labels can help you, as a contributor, answer are:
|
We use labels to indicate the status of issues. The most complete documentation on the labels is found in the [Maintain ESLint documentation](../maintain/manage-issues#when-an-issue-is-opened), but most contributors should find the information on this page sufficient. The most important questions that labels can help you, as a contributor, answer are:
|
||||||
|
|
||||||
1. Is this issue available for me to work on? If you have little or no experience contributing to ESLint, the [`good first issue`](https://github.com/eslint/eslint/labels/good%20first%20issue) label marks appropriate issues. Otherwise, the [`help wanted`](https://github.com/eslint/eslint/labels/help%20wanted) label is an invitation to work on the issue. If you have more experience, you can try working on other issues labeled [`accepted`](https://github.com/eslint/eslint/labels/accepted). Conversely, issues not yet ready to work on are labeled `triage`, `evaluating`, and/or `needs bikeshedding`, and issues that cannot currently be worked on because of something else, such as a bug in a dependency, are labeled `blocked`.
|
1. Is this issue available for me to work on? If you have little or no experience contributing to ESLint, the [`good first issue`](https://github.com/eslint/eslint/labels/good%20first%20issue) label marks appropriate issues. Otherwise, the [`help wanted`](https://github.com/eslint/eslint/labels/help%20wanted) label is an invitation to work on the issue. If you have more experience, you can try working on other issues labeled [`accepted`](https://github.com/eslint/eslint/labels/accepted). Conversely, issues not yet ready to work on are labeled `triage`, `evaluating`, and/or `needs bikeshedding`, and issues that cannot currently be worked on because of something else, such as a bug in a dependency, are labeled `blocked`.
|
||||||
1. What is this issue about? Labels describing the nature of issues include `bug`, `enhancement`, `feature`, `question`, `rule`, `documentation`, `core`, `build`, `cli`, `infrastructure`, `breaking`, and `chore`. These are documented in the [Maintainer Guide](https://eslint.org/docs/maintainer-guide/issues.html#types-of-issues).
|
1. What is this issue about? Labels describing the nature of issues include `bug`, `enhancement`, `feature`, `question`, `rule`, `documentation`, `core`, `build`, `cli`, `infrastructure`, `breaking`, and `chore`. These are documented in [Maintain ESLint](../maintain/manage-issues#types-of-issues).
|
||||||
1. What is the priority of this issue? Because we have a lot of issues, we prioritize certain issues above others. The following is the list of priorities, from highest to lowest:
|
1. What is the priority of this issue? Because we have a lot of issues, we prioritize certain issues above others. The following is the list of priorities, from highest to lowest:
|
||||||
|
|
||||||
1. **Bugs** - problems with the project are actively affecting users. We want to get these resolved as quickly as possible.
|
1. **Bugs** - problems with the project are actively affecting users. We want to get these resolved as quickly as possible.
|
@ -1,55 +0,0 @@
|
|||||||
---
|
|
||||||
title: Developer Guide
|
|
||||||
layout: doc
|
|
||||||
eleventyNavigation:
|
|
||||||
key: developer guide
|
|
||||||
title: Developer Guide
|
|
||||||
order: 2
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
This guide is intended for those who wish to:
|
|
||||||
|
|
||||||
* Contribute code to ESLint
|
|
||||||
* Create their own rules for ESLint
|
|
||||||
|
|
||||||
In order to work with ESLint as a developer, it's recommended that:
|
|
||||||
|
|
||||||
* You know JavaScript, since ESLint is written in JavaScript.
|
|
||||||
* You have some familiarity with Node.js, since ESLint runs on it.
|
|
||||||
* You're comfortable with command-line programs.
|
|
||||||
* You understand unit tests and why they're important.
|
|
||||||
|
|
||||||
If that sounds like you, then continue reading to get started.
|
|
||||||
|
|
||||||
## Section 1: Get the [Source Code](source-code)
|
|
||||||
|
|
||||||
Before you can get started, you'll need to get a copy of the ESLint source code. This section explains how to do that and a little about the source code structure.
|
|
||||||
|
|
||||||
## Section 2: Set up a [Development Environment](development-environment)
|
|
||||||
|
|
||||||
Developing for ESLint is a bit different than running it on the command line. This section shows you how to set up a development environment and get you ready to write code.
|
|
||||||
|
|
||||||
## Section 3: Run the [Unit Tests](unit-tests)
|
|
||||||
|
|
||||||
There are a lot of unit tests included with ESLint to make sure that we're keeping on top of code quality. This section explains how to run the unit tests.
|
|
||||||
|
|
||||||
## Section 4: [Working with Rules](working-with-rules)
|
|
||||||
|
|
||||||
You're finally ready to start working with rules. You may want to fix an existing rule or create a new one. This section explains how to do all of that.
|
|
||||||
|
|
||||||
## Section 5: [Working with Plugins](working-with-plugins)
|
|
||||||
|
|
||||||
You've developed library-specific rules for ESLint and you want to share them with the community. You can publish an ESLint plugin on npm.
|
|
||||||
|
|
||||||
## Section 6: [Working with Custom Parsers](working-with-custom-parsers)
|
|
||||||
|
|
||||||
If you aren't going to use the default parser of ESLint, this section explains about using custom parsers.
|
|
||||||
|
|
||||||
## Section 7: [Node.js API](nodejs-api)
|
|
||||||
|
|
||||||
If you're interested in writing a tool that uses ESLint, then you can use the Node.js API to get programmatic access to functionality.
|
|
||||||
|
|
||||||
## Section 8: [Contributing](contributing/)
|
|
||||||
|
|
||||||
Once you've made changes that you want to share with the community, the next step is to submit those changes back via a pull request.
|
|
@ -1,219 +0,0 @@
|
|||||||
---
|
|
||||||
title: Shareable Configs
|
|
||||||
layout: doc
|
|
||||||
eleventyNavigation:
|
|
||||||
key: shareable configs
|
|
||||||
parent: developer guide
|
|
||||||
title: Shareable Configs
|
|
||||||
order: 8
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
The configuration that you have in your `.eslintrc` file is an important part of your project, and as such, you may want to share it with other projects or people. Shareable configs allow you to publish your configuration settings on [npm](https://www.npmjs.com/) and have others download and use it in their ESLint projects.
|
|
||||||
|
|
||||||
## Creating a Shareable Config
|
|
||||||
|
|
||||||
Shareable configs are simply npm packages that export a configuration object. To start, [create a Node.js module](https://docs.npmjs.com/getting-started/creating-node-modules) like you normally would. Make sure the module name begins with `eslint-config-`, such as `eslint-config-myconfig`.
|
|
||||||
|
|
||||||
npm [scoped modules](https://docs.npmjs.com/misc/scope) are also supported, by naming or prefixing the module with `@scope/eslint-config`, such as `@scope/eslint-config` or `@scope/eslint-config-myconfig`.
|
|
||||||
|
|
||||||
Create a new `index.js` file and export an object containing your settings:
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = {
|
|
||||||
|
|
||||||
globals: {
|
|
||||||
MyGlobal: true
|
|
||||||
},
|
|
||||||
|
|
||||||
rules: {
|
|
||||||
semi: [2, "always"]
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
Since `index.js` is just JavaScript, you can optionally read these settings from a file or generate them dynamically.
|
|
||||||
|
|
||||||
## Publishing a Shareable Config
|
|
||||||
|
|
||||||
Once your shareable config is ready, you can [publish to npm](https://docs.npmjs.com/getting-started/publishing-npm-packages) to share with others. We recommend using the `eslint` and `eslintconfig` keywords so others can easily find your module.
|
|
||||||
|
|
||||||
You should declare your dependency on ESLint in `package.json` using the [peerDependencies](https://docs.npmjs.com/files/package.json#peerdependencies) field. The recommended way to declare a dependency for future proof compatibility is with the ">=" range syntax, using the lowest required ESLint version. For example:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"peerDependencies": {
|
|
||||||
"eslint": ">= 3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
If your shareable config depends on a plugin, you should also specify it as a `peerDependency` (plugins will be loaded relative to the end user's project, so the end user is required to install the plugins they need). However, if your shareable config depends on a third-party parser or another shareable config, you can specify these packages as `dependencies`.
|
|
||||||
|
|
||||||
You can also test your shareable config on your computer before publishing by linking your module globally. Type:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm link
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, in your project that wants to use your shareable config, type:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm link eslint-config-myconfig
|
|
||||||
```
|
|
||||||
|
|
||||||
Be sure to replace `eslint-config-myconfig` with the actual name of your module.
|
|
||||||
|
|
||||||
## Using a Shareable Config
|
|
||||||
|
|
||||||
Shareable configs are designed to work with the `extends` feature of `.eslintrc` files. Instead of using a file path for the value of `extends`, use your module name. For example:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"extends": "eslint-config-myconfig"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also omit the `eslint-config-` and it will be automatically assumed by ESLint:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"extends": "myconfig"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### npm scoped modules
|
|
||||||
|
|
||||||
npm [scoped modules](https://docs.npmjs.com/misc/scope) are also supported in a number of ways.
|
|
||||||
|
|
||||||
By using the module name:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"extends": "@scope/eslint-config"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also omit the `eslint-config` and it will be automatically assumed by ESLint:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"extends": "@scope"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The module name can also be customized, just note that when using [scoped modules](https://docs.npmjs.com/misc/scope) it is not possible to omit the `eslint-config-` prefix. Doing so would result in package naming conflicts, and thus in resolution errors in most of cases. For example a package named `@scope/eslint-config-myconfig` vs `@scope/myconfig`, since both are valid scoped package names, the configuration should be specified as:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"extends": "@scope/eslint-config-myconfig"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
You can override settings from the shareable config by adding them directly into your `.eslintrc` file.
|
|
||||||
|
|
||||||
## Sharing Multiple Configs
|
|
||||||
|
|
||||||
It's possible to share multiple configs in the same npm package. You can specify a default config for the package by following the directions in the first section. You can specify additional configs by simply adding a new file to your npm package and then referencing it from your ESLint config.
|
|
||||||
|
|
||||||
As an example, you can create a file called `my-special-config.js` in the root of your npm package and export a config, such as:
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = {
|
|
||||||
rules: {
|
|
||||||
quotes: [2, "double"]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, assuming you're using the package name `eslint-config-myconfig`, you can access the additional config via:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"extends": "myconfig/my-special-config"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
When using [scoped modules](https://docs.npmjs.com/misc/scope) it is not possible to omit the `eslint-config` namespace. Doing so would result in resolution errors as explained above. Assuming the package name is `@scope/eslint-config`, the additional config can be accessed as:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"extends": "@scope/eslint-config/my-special-config"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that you can leave off the `.js` from the filename. In this way, you can add as many additional configs to your package as you'd like.
|
|
||||||
|
|
||||||
**Important:** We strongly recommend always including a default config for your plugin to avoid errors.
|
|
||||||
|
|
||||||
## Local Config File Resolution
|
|
||||||
|
|
||||||
If you need to make multiple configs that can extend from each other and live in different directories, you can create a single shareable config that handles this scenario.
|
|
||||||
|
|
||||||
As an example, let's assume you're using the package name `eslint-config-myconfig` and your package looks something like this:
|
|
||||||
|
|
||||||
```text
|
|
||||||
myconfig
|
|
||||||
├── index.js
|
|
||||||
└─┬ lib
|
|
||||||
├── defaults.js
|
|
||||||
├── dev.js
|
|
||||||
├── ci.js
|
|
||||||
└─┬ ci
|
|
||||||
├── frontend.js
|
|
||||||
├── backend.js
|
|
||||||
└── common.js
|
|
||||||
```
|
|
||||||
|
|
||||||
In your `index.js` you can do something like this:
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = require('./lib/ci.js');
|
|
||||||
```
|
|
||||||
|
|
||||||
Now inside your package you have `/lib/defaults.js`, which contains:
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = {
|
|
||||||
rules: {
|
|
||||||
'no-console': 1
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
Inside your `/lib/ci.js` you have
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = require('./ci/backend');
|
|
||||||
```
|
|
||||||
|
|
||||||
Inside your `/lib/ci/common.js`
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = {
|
|
||||||
rules: {
|
|
||||||
'no-alert': 2
|
|
||||||
},
|
|
||||||
extends: 'myconfig/lib/defaults'
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
Despite being in an entirely different directory, you'll see that all `extends` must use the full package path to the config file you wish to extend.
|
|
||||||
|
|
||||||
Now inside your `/lib/ci/backend.js`
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = {
|
|
||||||
rules: {
|
|
||||||
'no-console': 1
|
|
||||||
},
|
|
||||||
extends: 'myconfig/lib/ci/common'
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
In the last file, you'll once again see that to properly resolve your config, you'll need include the full package path.
|
|
||||||
|
|
||||||
## Further Reading
|
|
||||||
|
|
||||||
* [npm Developer Guide](https://docs.npmjs.com/misc/developers)
|
|
@ -1,53 +0,0 @@
|
|||||||
---
|
|
||||||
title: Source Code
|
|
||||||
layout: doc
|
|
||||||
eleventyNavigation:
|
|
||||||
key: getting the source code
|
|
||||||
parent: developer guide
|
|
||||||
title: Getting the Source Code
|
|
||||||
order: 1
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
ESLint is hosted at [GitHub](https://github.com/eslint/eslint) and uses [Git](https://git-scm.com/) for source control. In order to obtain the source code, you must first install Git on your system. Instructions for installing and setting up Git can be found at [https://help.github.com/articles/set-up-git/](https://help.github.com/articles/set-up-git/).
|
|
||||||
|
|
||||||
If you simply want to create a local copy of the source to play with, you can clone the main repository using this command:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git clone git://github.com/eslint/eslint.git
|
|
||||||
```
|
|
||||||
|
|
||||||
If you're planning on contributing to ESLint, then it's a good idea to fork the repository. You can find instructions for forking a repository at [https://help.github.com/articles/fork-a-repo/](https://help.github.com/articles/fork-a-repo/). After forking the ESLint repository, you'll want to create a local copy of your fork.
|
|
||||||
|
|
||||||
## Start Developing
|
|
||||||
|
|
||||||
Before you can get started developing, you'll need to have a couple of things installed:
|
|
||||||
|
|
||||||
* [Node.JS](https://nodejs.org)
|
|
||||||
* [npm](https://www.npmjs.com/)
|
|
||||||
|
|
||||||
Once you have a local copy and have Node.JS and npm installed, you'll need to install the ESLint dependencies:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
cd eslint
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
Now when you run `eslint`, it will be running your local copy and showing your changes.
|
|
||||||
|
|
||||||
**Note:** It's a good idea to re-run `npm install` whenever you pull from the main repository to ensure you have the latest development dependencies.
|
|
||||||
|
|
||||||
## Directory structure
|
|
||||||
|
|
||||||
The ESLint directory and file structure is as follows:
|
|
||||||
|
|
||||||
* `bin` - executable files that are available when ESLint is installed
|
|
||||||
* `conf` - default configuration information
|
|
||||||
* `docs` - documentation for the project
|
|
||||||
* `lib` - contains the source code
|
|
||||||
* `formatters` - all source files defining formatters
|
|
||||||
* `rules` - all source files defining rules
|
|
||||||
* `tests` - the main unit test folder
|
|
||||||
* `lib` - tests for the source code
|
|
||||||
* `formatters` - tests for the formatters
|
|
||||||
* `rules` - tests for the rules
|
|
@ -1,82 +0,0 @@
|
|||||||
---
|
|
||||||
title: Working with Custom Parsers
|
|
||||||
layout: doc
|
|
||||||
eleventyNavigation:
|
|
||||||
key: working with custom parsers
|
|
||||||
parent: developer guide
|
|
||||||
title: Working with Custom Parsers
|
|
||||||
order: 7
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
If you want to use your own parser and provide additional capabilities for your rules, you can specify your own custom parser. If a `parseForESLint` method is exposed on the parser, this method will be used to parse the code. Otherwise, the `parse` method will be used. Both methods should take in the source code as the first argument, and an optional configuration object as the second argument (provided as `parserOptions` in a config file). The `parse` method should simply return the AST. The `parseForESLint` method should return an object that contains the required property `ast` and optional properties `services`, `scopeManager`, and `visitorKeys`.
|
|
||||||
|
|
||||||
* `ast` should contain the AST.
|
|
||||||
* `services` can contain any parser-dependent services (such as type checkers for nodes). The value of the `services` property is available to rules as `context.parserServices`. Default is an empty object.
|
|
||||||
* `scopeManager` can be a [ScopeManager](./scope-manager-interface) object. Custom parsers can use customized scope analysis for experimental/enhancement syntaxes. Default is the `ScopeManager` object which is created by [eslint-scope](https://github.com/eslint/eslint-scope).
|
|
||||||
* Support for `scopeManager` was added in ESLint v4.14.0. ESLint versions which support `scopeManager` will provide an `eslintScopeManager: true` property in `parserOptions`, which can be used for feature detection.
|
|
||||||
* `visitorKeys` can be an object to customize AST traversal. The keys of the object are the type of AST nodes. Each value is an array of the property names which should be traversed. Default is [KEYS of `eslint-visitor-keys`](https://github.com/eslint/eslint-visitor-keys#evkkeys).
|
|
||||||
* Support for `visitorKeys` was added in ESLint v4.14.0. ESLint versions which support `visitorKeys` will provide an `eslintVisitorKeys: true` property in `parserOptions`, which can be used for feature detection.
|
|
||||||
|
|
||||||
You can find an ESLint parser project [here](https://github.com/typescript-eslint/typescript-eslint).
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"parser": "./path/to/awesome-custom-parser.js"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var espree = require("espree");
|
|
||||||
// awesome-custom-parser.js
|
|
||||||
exports.parseForESLint = function(code, options) {
|
|
||||||
return {
|
|
||||||
ast: espree.parse(code, options),
|
|
||||||
services: {
|
|
||||||
foo: function() {
|
|
||||||
console.log("foo");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
scopeManager: null,
|
|
||||||
visitorKeys: null
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
## The AST specification
|
|
||||||
|
|
||||||
The AST that custom parsers should create is based on [ESTree](https://github.com/estree/estree). The AST requires some additional properties about detail information of the source code.
|
|
||||||
|
|
||||||
### All nodes:
|
|
||||||
|
|
||||||
All nodes must have `range` property.
|
|
||||||
|
|
||||||
* `range` (`number[]`) is an array of two numbers. Both numbers are a 0-based index which is the position in the array of source code characters. The first is the start position of the node, the second is the end position of the node. `code.slice(node.range[0], node.range[1])` must be the text of the node. This range does not include spaces/parentheses which are around the node.
|
|
||||||
* `loc` (`SourceLocation`) must not be `null`. [The `loc` property is defined as nullable by ESTree](https://github.com/estree/estree/blob/25834f7247d44d3156030f8e8a2d07644d771fdb/es5.md#node-objects), but ESLint requires this property. On the other hand, `SourceLocation#source` property can be `undefined`. ESLint does not use the `SourceLocation#source` property.
|
|
||||||
|
|
||||||
The `parent` property of all nodes must be rewritable. ESLint sets each node's `parent` property to its parent node while traversing, before any rules have access to the AST.
|
|
||||||
|
|
||||||
### The `Program` node:
|
|
||||||
|
|
||||||
The `Program` node must have `tokens` and `comments` properties. Both properties are an array of the below Token interface.
|
|
||||||
|
|
||||||
```ts
|
|
||||||
interface Token {
|
|
||||||
type: string;
|
|
||||||
loc: SourceLocation;
|
|
||||||
range: [number, number]; // See "All nodes:" section for details of `range` property.
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
* `tokens` (`Token[]`) is the array of tokens which affect the behavior of programs. Arbitrary spaces can exist between tokens, so rules check the `Token#range` to detect spaces between tokens. This must be sorted by `Token#range[0]`.
|
|
||||||
* `comments` (`Token[]`) is the array of comment tokens. This must be sorted by `Token#range[0]`.
|
|
||||||
|
|
||||||
The range indexes of all tokens and comments must not overlap with the range of other tokens and comments.
|
|
||||||
|
|
||||||
### The `Literal` node:
|
|
||||||
|
|
||||||
The `Literal` node must have `raw` property.
|
|
||||||
|
|
||||||
* `raw` (`string`) is the source code of this literal. This is the same as `code.slice(node.range[0], node.range[1])`.
|
|
@ -1,249 +0,0 @@
|
|||||||
---
|
|
||||||
title: Working with Plugins
|
|
||||||
layout: doc
|
|
||||||
eleventyNavigation:
|
|
||||||
key: working with plugings
|
|
||||||
parent: developer guide
|
|
||||||
title: Working with Plugins
|
|
||||||
order: 5
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Each plugin is an npm module with a name in the format of `eslint-plugin-<plugin-name>`, such as `eslint-plugin-jquery`. You can also use scoped packages in the format of `@<scope>/eslint-plugin-<plugin-name>` such as `@jquery/eslint-plugin-jquery` or even `@<scope>/eslint-plugin` such as `@jquery/eslint-plugin`.
|
|
||||||
|
|
||||||
## Create a Plugin
|
|
||||||
|
|
||||||
The easiest way to start creating a plugin is to use the [Yeoman generator](https://www.npmjs.com/package/generator-eslint). The generator will guide you through setting up the skeleton of a plugin.
|
|
||||||
|
|
||||||
### Rules in Plugins
|
|
||||||
|
|
||||||
Plugins can expose additional rules for use in ESLint. To do so, the plugin must export a `rules` object containing a key-value mapping of rule ID to rule. The rule ID does not have to follow any naming convention (so it can just be `dollar-sign`, for instance).
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = {
|
|
||||||
rules: {
|
|
||||||
"dollar-sign": {
|
|
||||||
create: function (context) {
|
|
||||||
// rule implementation ...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
To use the rule in ESLint, you would use the unprefixed plugin name, followed by a slash, followed by the rule name. So if this plugin were named `eslint-plugin-myplugin`, then in your configuration you'd refer to the rule by the name `myplugin/dollar-sign`. Example: `"rules": {"myplugin/dollar-sign": 2}`.
|
|
||||||
|
|
||||||
### Environments in Plugins
|
|
||||||
|
|
||||||
Plugins can expose additional environments for use in ESLint. To do so, the plugin must export an `environments` object. The keys of the `environments` object are the names of the different environments provided and the values are the environment settings. For example:
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = {
|
|
||||||
environments: {
|
|
||||||
jquery: {
|
|
||||||
globals: {
|
|
||||||
$: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
There's a `jquery` environment defined in this plugin. To use the environment in ESLint, you would use the unprefixed plugin name, followed by a slash, followed by the environment name. So if this plugin were named `eslint-plugin-myplugin`, then you would set the environment in your configuration to be `"myplugin/jquery"`.
|
|
||||||
|
|
||||||
Plugin environments can define the following objects:
|
|
||||||
|
|
||||||
1. `globals` - acts the same `globals` in a configuration file. The keys are the names of the globals and the values are `true` to allow the global to be overwritten and `false` to disallow.
|
|
||||||
1. `parserOptions` - acts the same as `parserOptions` in a configuration file.
|
|
||||||
|
|
||||||
### Processors in Plugins
|
|
||||||
|
|
||||||
You can also create plugins that would tell ESLint how to process files other than JavaScript. In order to create a processor, the object that is exported from your module has to conform to the following interface:
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = {
|
|
||||||
processors: {
|
|
||||||
"processor-name": {
|
|
||||||
// takes text of the file and filename
|
|
||||||
preprocess: function(text, filename) {
|
|
||||||
// here, you can strip out any non-JS content
|
|
||||||
// and split into multiple strings to lint
|
|
||||||
|
|
||||||
return [ // return an array of code blocks to lint
|
|
||||||
{ text: code1, filename: "0.js" },
|
|
||||||
{ text: code2, filename: "1.js" },
|
|
||||||
];
|
|
||||||
},
|
|
||||||
|
|
||||||
// takes a Message[][] and filename
|
|
||||||
postprocess: function(messages, filename) {
|
|
||||||
// `messages` argument contains two-dimensional array of Message objects
|
|
||||||
// where each top-level array item contains array of lint messages related
|
|
||||||
// to the text that was returned in array from preprocess() method
|
|
||||||
|
|
||||||
// you need to return a one-dimensional array of the messages you want to keep
|
|
||||||
return [].concat(...messages);
|
|
||||||
},
|
|
||||||
|
|
||||||
supportsAutofix: true // (optional, defaults to false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
**The `preprocess` method** takes the file contents and filename as arguments, and returns an array of code blocks to lint. The code blocks will be linted separately but still be registered to the filename.
|
|
||||||
|
|
||||||
A code block has two properties `text` and `filename`; the `text` property is the content of the block and the `filename` property is the name of the block. Name of the block can be anything, but should include the file extension, that would tell the linter how to process the current block. The linter will check [`--ext` CLI option](../user-guide/command-line-interface#--ext) to see if the current block should be linted, and resolve `overrides` configs to check how to process the current block.
|
|
||||||
|
|
||||||
It's up to the plugin to decide if it needs to return just one part, or multiple pieces. For example in the case of processing `.html` files, you might want to return just one item in the array by combining all scripts, but for `.md` file where each JavaScript block might be independent, you can return multiple items.
|
|
||||||
|
|
||||||
**The `postprocess` method** takes a two-dimensional array of arrays of lint messages and the filename. Each item in the input array corresponds to the part that was returned from the `preprocess` method. The `postprocess` method must adjust the locations of all errors to correspond to locations in the original, unprocessed code, and aggregate them into a single flat array and return it.
|
|
||||||
|
|
||||||
Reported problems have the following location information:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
{
|
|
||||||
line: number,
|
|
||||||
column: number,
|
|
||||||
|
|
||||||
endLine?: number,
|
|
||||||
endColumn?: number
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
By default, ESLint will not perform autofixes when a processor is used, even when the `--fix` flag is enabled on the command line. To allow ESLint to autofix code when using your processor, you should take the following additional steps:
|
|
||||||
|
|
||||||
1. Update the `postprocess` method to additionally transform the `fix` property of reported problems. All autofixable problems will have a `fix` property, which is an object with the following schema:
|
|
||||||
|
|
||||||
```js
|
|
||||||
{
|
|
||||||
range: [number, number],
|
|
||||||
text: string
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The `range` property contains two indexes in the code, referring to the start and end location of a contiguous section of text that will be replaced. The `text` property refers to the text that will replace the given range.
|
|
||||||
|
|
||||||
In the initial list of problems, the `fix` property will refer to a fix in the processed JavaScript. The `postprocess` method should transform the object to refer to a fix in the original, unprocessed file.
|
|
||||||
|
|
||||||
2. Add a `supportsAutofix: true` property to the processor.
|
|
||||||
|
|
||||||
You can have both rules and processors in a single plugin. You can also have multiple processors in one plugin.
|
|
||||||
To support multiple extensions, add each one to the `processors` element and point them to the same object.
|
|
||||||
|
|
||||||
#### Specifying Processor in Config Files
|
|
||||||
|
|
||||||
To use a processor, add its ID to a `processor` section in the config file. Processor ID is a concatenated string of plugin name and processor name with a slash as a separator. This can also be added to a `overrides` section of the config, to specify which processors should handle which files.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
plugins:
|
|
||||||
- a-plugin
|
|
||||||
overrides:
|
|
||||||
- files: "*.md"
|
|
||||||
processor: a-plugin/markdown
|
|
||||||
```
|
|
||||||
|
|
||||||
See [Specifying Processor](../user-guide/configuring/plugins#specifying-processor) for details.
|
|
||||||
|
|
||||||
#### File Extension-named Processor
|
|
||||||
|
|
||||||
If a processor name starts with `.`, ESLint handles the processor as a **file extension-named processor** especially and applies the processor to the kind of files automatically. People don't need to specify the file extension-named processors in their config files.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
|
|
||||||
```js
|
|
||||||
module.exports = {
|
|
||||||
processors: {
|
|
||||||
// This processor will be applied to `*.md` files automatically.
|
|
||||||
// Also, people can use this processor as "plugin-id/.md" explicitly.
|
|
||||||
".md": {
|
|
||||||
preprocess(text, filename) { /* ... */ },
|
|
||||||
postprocess(messageLists, filename) { /* ... */ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configs in Plugins
|
|
||||||
|
|
||||||
You can bundle configurations inside a plugin by specifying them under the `configs` key. This can be useful when you want to provide not just code style, but also some custom rules to support it. Multiple configurations are supported per plugin. Note that it is not possible to specify a default configuration for a given plugin and that users must specify in their configuration file when they want to use one.
|
|
||||||
|
|
||||||
```js
|
|
||||||
// eslint-plugin-myPlugin
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
configs: {
|
|
||||||
myConfig: {
|
|
||||||
plugins: ["myPlugin"],
|
|
||||||
env: ["browser"],
|
|
||||||
rules: {
|
|
||||||
semi: "error",
|
|
||||||
"myPlugin/my-rule": "error",
|
|
||||||
"eslint-plugin-myPlugin/another-rule": "error"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
myOtherConfig: {
|
|
||||||
plugins: ["myPlugin"],
|
|
||||||
env: ["node"],
|
|
||||||
rules: {
|
|
||||||
"myPlugin/my-rule": "off",
|
|
||||||
"eslint-plugin-myPlugin/another-rule": "off",
|
|
||||||
"eslint-plugin-myPlugin/yet-another-rule": "error"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
If the example plugin above were called `eslint-plugin-myPlugin`, the `myConfig` and `myOtherConfig` configurations would then be usable by extending off of `"plugin:myPlugin/myConfig"` and `"plugin:myPlugin/myOtherConfig"`, respectively.
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"extends": ["plugin:myPlugin/myConfig"]
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
**Note:** Please note that configuration will not enable any of the plugin's rules by default, and instead should be treated as a standalone config. This means that you must specify your plugin name in the `plugins` array as well as any rules you want to enable that are part of the plugin. Any plugin rules must be prefixed with the short or long plugin name. See [Configuring Plugins](../user-guide/configuring/plugins#configuring-plugins) for more information.
|
|
||||||
|
|
||||||
### Peer Dependency
|
|
||||||
|
|
||||||
To make clear that the plugin requires ESLint to work correctly you have to declare ESLint as a `peerDependency` in your `package.json`.
|
|
||||||
The plugin support was introduced in ESLint version `0.8.0`. Ensure the `peerDependency` points to ESLint `0.8.0` or later.
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"peerDependencies": {
|
|
||||||
"eslint": ">=0.8.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Testing
|
|
||||||
|
|
||||||
ESLint provides the [`RuleTester`](/docs/developer-guide/nodejs-api#ruletester) utility to make it easy to test the rules of your plugin.
|
|
||||||
|
|
||||||
### Linting
|
|
||||||
|
|
||||||
ESLint plugins should be linted too! It's suggested to lint your plugin with the `recommended` configurations of:
|
|
||||||
|
|
||||||
* [eslint](https://www.npmjs.com/package/eslint)
|
|
||||||
* [eslint-plugin-eslint-plugin](https://www.npmjs.com/package/eslint-plugin-eslint-plugin)
|
|
||||||
* [eslint-plugin-node](https://www.npmjs.com/package/eslint-plugin-node)
|
|
||||||
|
|
||||||
## Share Plugins
|
|
||||||
|
|
||||||
In order to make your plugin available to the community you have to publish it on npm.
|
|
||||||
|
|
||||||
Recommended keywords:
|
|
||||||
|
|
||||||
* `eslint`
|
|
||||||
* `eslintplugin`
|
|
||||||
|
|
||||||
Add these keywords into your `package.json` file to make it easy for others to find.
|
|
||||||
|
|
||||||
## Further Reading
|
|
||||||
|
|
||||||
* [npm Developer Guide](https://docs.npmjs.com/misc/developers)
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user