mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 13:40:37 +00:00
build,tools: change the quotes in YAML
Remove useless quotes and use single quotes when needed. PR-URL: https://github.com/nodejs/node/pull/41756 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im>
This commit is contained in:
parent
f282e4a94d
commit
8e653d9898
2
.github/ISSUE_TEMPLATE/1-bug-report.yml
vendored
2
.github/ISSUE_TEMPLATE/1-bug-report.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: "\U0001F41B Bug report"
|
name: \U0001F41B Bug report
|
||||||
description: Create a report to help us improve
|
description: Create a report to help us improve
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
|
4
.github/ISSUE_TEMPLATE/2-feature-request.yml
vendored
4
.github/ISSUE_TEMPLATE/2-feature-request.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
name: "\U0001F680 Feature request"
|
name: \U0001F680 Feature request
|
||||||
description: Suggest an idea for this project
|
description: Suggest an idea for this project
|
||||||
labels: ["feature request"]
|
labels: [feature request]
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: "\U0001F4D7 Open an issue regarding the Node.js API reference docs"
|
name: \U0001F4D7 Open an issue regarding the Node.js API reference docs
|
||||||
description: Let us know about any problematic API reference documents
|
description: Let us know about any problematic API reference documents
|
||||||
labels: ["doc"]
|
labels: [doc]
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: Report a flaky test
|
name: Report a flaky test
|
||||||
description: Report a flaky test in our CI
|
description: Report a flaky test in our CI
|
||||||
labels: ["flaky-test"]
|
labels: [flaky-test]
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
10
.github/workflows/authors.yml
vendored
10
.github/workflows/authors.yml
vendored
@ -2,7 +2,7 @@ name: Authors update
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
# Run once a week at 00:05 AM UTC on Sunday.
|
# Run once a week at 00:05 AM UTC on Sunday.
|
||||||
- cron: '5 0 * * 0'
|
- cron: 5 0 * * 0
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: '0' # This is required to actually get all the authors
|
fetch-depth: '0' # This is required to actually get all the authors
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- run: "tools/update-authors.js" # Run the AUTHORS tool
|
- run: tools/update-authors.js # Run the AUTHORS tool
|
||||||
- uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR
|
- uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
|
||||||
@ -25,7 +25,7 @@ jobs:
|
|||||||
Here are some new additions to the AUTHORS file.
|
Here are some new additions to the AUTHORS file.
|
||||||
This is an automatically generated PR by the
|
This is an automatically generated PR by the
|
||||||
`authors.yml` GitHub Action, which runs `tools/update-authors.js`.
|
`authors.yml` GitHub Action, which runs `tools/update-authors.js`.
|
||||||
branch: "actions/authors-update" # Custom branch *just* for this Action.
|
branch: actions/authors-update # Custom branch *just* for this Action.
|
||||||
commit-message: "meta: update AUTHORS"
|
commit-message: 'meta: update AUTHORS'
|
||||||
labels: meta
|
labels: meta
|
||||||
title: "meta: update AUTHORS"
|
title: 'meta: update AUTHORS'
|
||||||
|
2
.github/workflows/auto-start-ci.yml
vendored
2
.github/workflows/auto-start-ci.yml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
# optimistic, it can take longer to run.
|
# optimistic, it can take longer to run.
|
||||||
# To understand why `schedule` is used instead of other events, refer to
|
# To understand why `schedule` is used instead of other events, refer to
|
||||||
# ./doc/contributing/commit-queue.md
|
# ./doc/contributing/commit-queue.md
|
||||||
- cron: "*/5 * * * *"
|
- cron: '*/5 * * * *'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: lts/*
|
NODE_VERSION: lts/*
|
||||||
|
12
.github/workflows/build-tarball.yml
vendored
12
.github/workflows/build-tarball.yml
vendored
@ -4,10 +4,10 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.mailmap'
|
- .mailmap
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'AUTHORS'
|
- AUTHORS
|
||||||
- 'doc/**'
|
- doc/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- '!.github/workflows/build-tarball.yml'
|
- '!.github/workflows/build-tarball.yml'
|
||||||
push:
|
push:
|
||||||
@ -17,10 +17,10 @@ on:
|
|||||||
- v[0-9]+.x-staging
|
- v[0-9]+.x-staging
|
||||||
- v[0-9]+.x
|
- v[0-9]+.x
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.mailmap'
|
- .mailmap
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'AUTHORS'
|
- AUTHORS
|
||||||
- 'doc/**'
|
- doc/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- '!.github/workflows/build-tarball.yml'
|
- '!.github/workflows/build-tarball.yml'
|
||||||
|
|
||||||
|
2
.github/workflows/close-stalled.yml
vendored
2
.github/workflows/close-stalled.yml
vendored
@ -1,7 +1,7 @@
|
|||||||
name: Close stalled issues and PRs
|
name: Close stalled issues and PRs
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * *"
|
- cron: 0 0 * * *
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CLOSE_MESSAGE: >
|
CLOSE_MESSAGE: >
|
||||||
|
2
.github/workflows/commit-queue.yml
vendored
2
.github/workflows/commit-queue.yml
vendored
@ -11,7 +11,7 @@ on:
|
|||||||
# be read-only, and the Action won't have access to any other repository
|
# be read-only, and the Action won't have access to any other repository
|
||||||
# secrets, which it needs to access Jenkins API.
|
# secrets, which it needs to access Jenkins API.
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "*/5 * * * *"
|
- cron: '*/5 * * * *'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: lts/*
|
NODE_VERSION: lts/*
|
||||||
|
12
.github/workflows/coverage-linux.yml
vendored
12
.github/workflows/coverage-linux.yml
vendored
@ -5,18 +5,18 @@ on:
|
|||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'benchmark/**'
|
- benchmark/**
|
||||||
- 'deps/**'
|
- deps/*
|
||||||
- 'doc/**'
|
- doc/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- '!.github/workflows/coverage-linux.yml'
|
- '!.github/workflows/coverage-linux.yml'
|
||||||
push:
|
push:
|
||||||
branches: [master, main]
|
branches: [master, main]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'benchmark/**'
|
- benchmark/**
|
||||||
- 'deps/**'
|
- deps/**
|
||||||
- 'doc/**'
|
- doc/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- '!.github/workflows/coverage-linux.yml'
|
- '!.github/workflows/coverage-linux.yml'
|
||||||
|
|
||||||
|
16
.github/workflows/coverage-windows.yml
vendored
16
.github/workflows/coverage-windows.yml
vendored
@ -5,20 +5,20 @@ on:
|
|||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'benchmark/**'
|
- benchmark/**
|
||||||
- 'deps/**'
|
- deps/**
|
||||||
- 'doc/**'
|
- doc/**
|
||||||
- 'tools/**'
|
- tools/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- '!.github/workflows/coverage-windows.yml'
|
- '!.github/workflows/coverage-windows.yml'
|
||||||
push:
|
push:
|
||||||
branches: [master, main]
|
branches: [master, main]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'benchmark/**'
|
- benchmark/**
|
||||||
- 'deps/**'
|
- deps/**
|
||||||
- 'doc/**'
|
- doc/**
|
||||||
- 'tools/**'
|
- tools/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- '!.github/workflows/coverage-windows.yml'
|
- '!.github/workflows/coverage-windows.yml'
|
||||||
|
|
||||||
|
2
.github/workflows/daily.yml
vendored
2
.github/workflows/daily.yml
vendored
@ -3,7 +3,7 @@ name: Node.js daily job
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * *"
|
- cron: 0 0 * * *
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: lts/*
|
NODE_VERSION: lts/*
|
||||||
|
@ -3,7 +3,7 @@ name: Find inactive collaborators
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
# Run every Monday at 4:05 AM UTC.
|
# Run every Monday at 4:05 AM UTC.
|
||||||
- cron: '5 4 * * 1'
|
- cron: 5 4 * * 1
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@ -37,6 +37,6 @@ jobs:
|
|||||||
author: Node.js GitHub Bot <github-bot@iojs.org>
|
author: Node.js GitHub Bot <github-bot@iojs.org>
|
||||||
branch: actions/inactive-collaborators
|
branch: actions/inactive-collaborators
|
||||||
body: This PR was generated by tools/find-inactive-collaborators.yml.
|
body: This PR was generated by tools/find-inactive-collaborators.yml.
|
||||||
commit-message: "meta: move one or more collaborators to emeritus"
|
commit-message: 'meta: move one or more collaborators to emeritus'
|
||||||
labels: meta
|
labels: meta
|
||||||
title: "meta: move one or more collaborators to emeritus"
|
title: 'meta: move one or more collaborators to emeritus'
|
||||||
|
6
.github/workflows/find-inactive-tsc.yml
vendored
6
.github/workflows/find-inactive-tsc.yml
vendored
@ -3,7 +3,7 @@ name: Find inactive TSC members
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
# Run every Tuesday 12:05 AM UTC.
|
# Run every Tuesday 12:05 AM UTC.
|
||||||
- cron: '5 0 * * 2'
|
- cron: 5 0 * * 2
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@ -51,6 +51,6 @@ jobs:
|
|||||||
@nodejs/tsc ${{ env.INACTIVE_TSC_HANDLES }}
|
@nodejs/tsc ${{ env.INACTIVE_TSC_HANDLES }}
|
||||||
|
|
||||||
${{ env.DETAILS_FOR_COMMIT_BODY }}
|
${{ env.DETAILS_FOR_COMMIT_BODY }}
|
||||||
commit-message: "meta: move one or more TSC members to emeritus"
|
commit-message: 'meta: move one or more TSC members to emeritus'
|
||||||
labels: meta
|
labels: meta
|
||||||
title: "meta: move one or more TSC members to emeritus"
|
title: 'meta: move one or more TSC members to emeritus'
|
||||||
|
6
.github/workflows/license-builder.yml
vendored
6
.github/workflows/license-builder.yml
vendored
@ -3,7 +3,7 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
# 00:00:00 every Monday
|
# 00:00:00 every Monday
|
||||||
# https://crontab.guru/#0_0_*_*_1
|
# https://crontab.guru/#0_0_*_*_1
|
||||||
- cron: "0 0 * * 1"
|
- cron: 0 0 * * 1
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -14,14 +14,14 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- run: "./tools/license-builder.sh" # Run the license builder tool
|
- run: ./tools/license-builder.sh # Run the license builder tool
|
||||||
- uses: gr2m/create-or-update-pull-request-action@v1.x # Create a PR or update the Action's existing PR
|
- uses: gr2m/create-or-update-pull-request-action@v1.x # Create a PR or update the Action's existing PR
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
author: Node.js GitHub Bot <github-bot@iojs.org>
|
author: Node.js GitHub Bot <github-bot@iojs.org>
|
||||||
branch: actions/license-builder
|
branch: actions/license-builder
|
||||||
title: "doc: run license-builder"
|
title: 'doc: run license-builder'
|
||||||
body: >
|
body: >
|
||||||
License is likely out of date. This is an automatically generated PR by
|
License is likely out of date. This is an automatically generated PR by
|
||||||
the `license-builder.yml` GitHub Action, which runs `license-builder.sh`
|
the `license-builder.yml` GitHub Action, which runs `license-builder.sh`
|
||||||
|
2
.github/workflows/linters.yml
vendored
2
.github/workflows/linters.yml
vendored
@ -138,7 +138,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- uses: mszostok/codeowners-validator@v0.6.0
|
- uses: mszostok/codeowners-validator@v0.6.0
|
||||||
with:
|
with:
|
||||||
checks: "files,duppatterns"
|
checks: files,duppatterns
|
||||||
lint-pr-url:
|
lint-pr-url:
|
||||||
if: ${{ github.event.pull_request }}
|
if: ${{ github.event.pull_request }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
2
.github/workflows/notify-force-push.yml
vendored
2
.github/workflows/notify-force-push.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
SLACK_COLOR: '#DE512A'
|
SLACK_COLOR: '#DE512A'
|
||||||
SLACK_ICON: https://github.com/nodejs.png?size=48
|
SLACK_ICON: https://github.com/nodejs.png?size=48
|
||||||
SLACK_TITLE: '${{ github.actor }} force-pushed to ${{ github.ref }}'
|
SLACK_TITLE: ${{ github.actor }} force-pushed to ${{ github.ref }}
|
||||||
SLACK_MESSAGE: |
|
SLACK_MESSAGE: |
|
||||||
A commit was force-pushed to <https://github.com/${{ github.repository }}/tree/${{ github.repository.default_branch }}|${{ github.repository }}@${{ github.repository.default_branch }}> by <https://github.com/${{ github.actor }}|${{ github.actor }}>
|
A commit was force-pushed to <https://github.com/${{ github.repository }}/tree/${{ github.repository.default_branch }}|${{ github.repository }}@${{ github.repository.default_branch }}> by <https://github.com/${{ github.actor }}|${{ github.actor }}>
|
||||||
|
|
||||||
|
12
.github/workflows/test-asan.yml
vendored
12
.github/workflows/test-asan.yml
vendored
@ -4,10 +4,10 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.mailmap'
|
- .mailmap
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'AUTHORS'
|
- AUTHORS
|
||||||
- 'doc/**'
|
- doc/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- '!.github/workflows/test-asan.yml'
|
- '!.github/workflows/test-asan.yml'
|
||||||
push:
|
push:
|
||||||
@ -18,10 +18,10 @@ on:
|
|||||||
- v[0-9]+.x-staging
|
- v[0-9]+.x-staging
|
||||||
- v[0-9]+.x
|
- v[0-9]+.x
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.mailmap'
|
- .mailmap
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'AUTHORS'
|
- AUTHORS
|
||||||
- 'doc/**'
|
- doc/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- '!.github/workflows/test-asan.yml'
|
- '!.github/workflows/test-asan.yml'
|
||||||
|
|
||||||
|
12
.github/workflows/test-macos.yml
vendored
12
.github/workflows/test-macos.yml
vendored
@ -4,10 +4,10 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.mailmap'
|
- .mailmap
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'AUTHORS'
|
- AUTHORS
|
||||||
- 'doc/**'
|
- doc/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- '!.github/workflows/test-macos.yml'
|
- '!.github/workflows/test-macos.yml'
|
||||||
push:
|
push:
|
||||||
@ -18,10 +18,10 @@ on:
|
|||||||
- v[0-9]+.x-staging
|
- v[0-9]+.x-staging
|
||||||
- v[0-9]+.x
|
- v[0-9]+.x
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.mailmap'
|
- .mailmap
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'AUTHORS'
|
- AUTHORS
|
||||||
- 'doc/**'
|
- doc/**
|
||||||
- .github/**
|
- .github/**
|
||||||
- '!.github/workflows/test-macos.yml'
|
- '!.github/workflows/test-macos.yml'
|
||||||
|
|
||||||
|
12
.github/workflows/tools.yml
vendored
12
.github/workflows/tools.yml
vendored
@ -2,7 +2,7 @@ name: Tools update
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
# Run once a week at 00:05 AM UTC on Saturday.
|
# Run once a week at 00:05 AM UTC on Saturday.
|
||||||
- cron: '5 0 * * 6'
|
- cron: 5 0 * * 6
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ jobs:
|
|||||||
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
||||||
./update-eslint.sh
|
./update-eslint.sh
|
||||||
fi
|
fi
|
||||||
- id: "lint-md-dependencies"
|
- id: lint-md-dependencies
|
||||||
run: |
|
run: |
|
||||||
cd tools/lint-md
|
cd tools/lint-md
|
||||||
npm ci
|
npm ci
|
||||||
@ -63,8 +63,8 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
|
||||||
with:
|
with:
|
||||||
author: Node.js GitHub Bot <github-bot@iojs.org>
|
author: Node.js GitHub Bot <github-bot@iojs.org>
|
||||||
body: "This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}."
|
body: This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}.
|
||||||
branch: "actions/tools-update-${{ matrix.id }}" # Custom branch *just* for this Action.
|
branch: actions/tools-update-${{ matrix.id }} # Custom branch *just* for this Action.
|
||||||
commit-message: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"
|
commit-message: 'tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}'
|
||||||
labels: tools
|
labels: tools
|
||||||
title: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"
|
title: 'tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}'
|
||||||
|
@ -6,97 +6,97 @@ rules:
|
|||||||
no-buffer-constructor: error
|
no-buffer-constructor: error
|
||||||
no-mixed-operators:
|
no-mixed-operators:
|
||||||
- error
|
- error
|
||||||
- groups: [["&&", "||"]]
|
- groups: [['&&', '||']]
|
||||||
no-restricted-syntax:
|
no-restricted-syntax:
|
||||||
# Config copied from .eslintrc.js
|
# Config copied from .eslintrc.js
|
||||||
- error
|
- error
|
||||||
- selector: "CallExpression[callee.object.name='assert']:not([callee.property.name='ok']):not([callee.property.name='fail']):not([callee.property.name='ifError'])"
|
- selector: CallExpression[callee.object.name='assert']:not([callee.property.name='ok']):not([callee.property.name='fail']):not([callee.property.name='ifError'])
|
||||||
message: "Please only use simple assertions in ./lib"
|
message: Please only use simple assertions in ./lib
|
||||||
- selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]"
|
- selector: CallExpression[callee.name='setTimeout'][arguments.length<2]
|
||||||
message: "setTimeout() must be invoked with at least two arguments."
|
message: setTimeout() must be invoked with at least two arguments.
|
||||||
- selector: "CallExpression[callee.name='setInterval'][arguments.length<2]"
|
- selector: CallExpression[callee.name='setInterval'][arguments.length<2]
|
||||||
message: "setInterval() must be invoked with at least 2 arguments."
|
message: setInterval() must be invoked with at least 2 arguments.
|
||||||
- selector: "ThrowStatement > CallExpression[callee.name=/Error$/]"
|
- selector: ThrowStatement > CallExpression[callee.name=/Error$/]
|
||||||
message: "Use new keyword when throwing an Error."
|
message: Use new keyword when throwing an Error.
|
||||||
# Config specific to lib
|
# Config specific to lib
|
||||||
- selector: "NewExpression[callee.name=/Error$/]:not([callee.name=/^(AssertionError|NghttpError|AbortError)$/])"
|
- selector: NewExpression[callee.name=/Error$/]:not([callee.name=/^(AssertionError|NghttpError|AbortError)$/])
|
||||||
message: "Use an error exported by the internal/errors module."
|
message: Use an error exported by the internal/errors module.
|
||||||
- selector: "CallExpression[callee.object.name='Error'][callee.property.name='captureStackTrace']"
|
- selector: CallExpression[callee.object.name='Error'][callee.property.name='captureStackTrace']
|
||||||
message: "Please use `require('internal/errors').hideStackFrames()` instead."
|
message: Please use `require('internal/errors').hideStackFrames()` instead.
|
||||||
- selector: "AssignmentExpression:matches([left.name='prepareStackTrace'], [left.property.name='prepareStackTrace'])"
|
- selector: AssignmentExpression:matches([left.name='prepareStackTrace'], [left.property.name='prepareStackTrace'])
|
||||||
message: "Use 'overrideStackTrace' from 'lib/internal/errors.js' instead of 'Error.prepareStackTrace'."
|
message: Use 'overrideStackTrace' from 'lib/internal/errors.js' instead of 'Error.prepareStackTrace'.
|
||||||
- selector: "ThrowStatement > NewExpression[callee.name=/^ERR_[A-Z_]+$/] > ObjectExpression:first-child:not(:has([key.name='message']):has([key.name='code']):has([key.name='syscall']))"
|
- selector: ThrowStatement > NewExpression[callee.name=/^ERR_[A-Z_]+$/] > ObjectExpression:first-child:not(:has([key.name='message']):has([key.name='code']):has([key.name='syscall']))
|
||||||
message: "The context passed into SystemError constructor must have .code, .syscall and .message."
|
message: The context passed into SystemError constructor must have .code, .syscall and .message.
|
||||||
no-restricted-globals:
|
no-restricted-globals:
|
||||||
- error
|
- error
|
||||||
- name: AbortController
|
- name: AbortController
|
||||||
message: "Use `const { AbortController } = require('internal/abort_controller');` instead of the global."
|
message: Use `const { AbortController } = require('internal/abort_controller');` instead of the global.
|
||||||
- name: AbortSignal
|
- name: AbortSignal
|
||||||
message: "Use `const { AbortSignal } = require('internal/abort_controller');` instead of the global."
|
message: Use `const { AbortSignal } = require('internal/abort_controller');` instead of the global.
|
||||||
# Atomics is not available in primordials because it can be
|
# Atomics is not available in primordials because it can be
|
||||||
# disabled with --no-harmony-atomics CLI flag.
|
# disabled with --no-harmony-atomics CLI flag.
|
||||||
- name: Atomics
|
- name: Atomics
|
||||||
message: "Use `const { Atomics } = globalThis;` instead of the global."
|
message: Use `const { Atomics } = globalThis;` instead of the global.
|
||||||
- name: Blob
|
- name: Blob
|
||||||
message: "Use `const { Blob } = require('buffer');` instead of the global."
|
message: Use `const { Blob } = require('buffer');` instead of the global.
|
||||||
- name: Buffer
|
- name: Buffer
|
||||||
message: "Use `const { Buffer } = require('buffer');` instead of the global."
|
message: Use `const { Buffer } = require('buffer');` instead of the global.
|
||||||
- name: DOMException
|
- name: DOMException
|
||||||
message: "Use lazy function `const { lazyDOMException } = require('internal/util');` instead of the global."
|
message: Use lazy function `const { lazyDOMException } = require('internal/util');` instead of the global.
|
||||||
- name: Event
|
- name: Event
|
||||||
message: "Use `const { Event } = require('internal/event_target');` instead of the global."
|
message: Use `const { Event } = require('internal/event_target');` instead of the global.
|
||||||
- name: EventTarget
|
- name: EventTarget
|
||||||
message: "Use `const { EventTarget } = require('internal/event_target');` instead of the global."
|
message: Use `const { EventTarget } = require('internal/event_target');` instead of the global.
|
||||||
# Intl is not available in primordials because it can be
|
# Intl is not available in primordials because it can be
|
||||||
# disabled with --without-intl build flag.
|
# disabled with --without-intl build flag.
|
||||||
- name: Intl
|
- name: Intl
|
||||||
message: "Use `const { Intl } = globalThis;` instead of the global."
|
message: Use `const { Intl } = globalThis;` instead of the global.
|
||||||
- name: BroadcastChannel
|
- name: BroadcastChannel
|
||||||
message: "Use `const { BroadcastChannel } = require('internal/worker/io');` instead of the global."
|
message: Use `const { BroadcastChannel } = require('internal/worker/io');` instead of the global.
|
||||||
- name: MessageChannel
|
- name: MessageChannel
|
||||||
message: "Use `const { MessageChannel } = require('internal/worker/io');` instead of the global."
|
message: Use `const { MessageChannel } = require('internal/worker/io');` instead of the global.
|
||||||
- name: MessageEvent
|
- name: MessageEvent
|
||||||
message: "Use `const { MessageEvent } = require('internal/worker/io');` instead of the global."
|
message: Use `const { MessageEvent } = require('internal/worker/io');` instead of the global.
|
||||||
- name: MessagePort
|
- name: MessagePort
|
||||||
message: "Use `const { MessagePort } = require('internal/worker/io');` instead of the global."
|
message: Use `const { MessagePort } = require('internal/worker/io');` instead of the global.
|
||||||
# SharedArrayBuffer is not available in primordials because it can be
|
# SharedArrayBuffer is not available in primordials because it can be
|
||||||
# disabled with --no-harmony-sharedarraybuffer CLI flag.
|
# disabled with --no-harmony-sharedarraybuffer CLI flag.
|
||||||
- name: SharedArrayBuffer
|
- name: SharedArrayBuffer
|
||||||
message: "Use `const { SharedArrayBuffer } = globalThis;` instead of the global."
|
message: Use `const { SharedArrayBuffer } = globalThis;` instead of the global.
|
||||||
- name: TextDecoder
|
- name: TextDecoder
|
||||||
message: "Use `const { TextDecoder } = require('internal/encoding');` instead of the global."
|
message: Use `const { TextDecoder } = require('internal/encoding');` instead of the global.
|
||||||
- name: TextEncoder
|
- name: TextEncoder
|
||||||
message: "Use `const { TextEncoder } = require('internal/encoding');` instead of the global."
|
message: Use `const { TextEncoder } = require('internal/encoding');` instead of the global.
|
||||||
- name: URL
|
- name: URL
|
||||||
message: "Use `const { URL } = require('internal/url');` instead of the global."
|
message: Use `const { URL } = require('internal/url');` instead of the global.
|
||||||
- name: URLSearchParams
|
- name: URLSearchParams
|
||||||
message: "Use `const { URLSearchParams } = require('internal/url');` instead of the global."
|
message: Use `const { URLSearchParams } = require('internal/url');` instead of the global.
|
||||||
# WebAssembly is not available in primordials because it can be
|
# WebAssembly is not available in primordials because it can be
|
||||||
# disabled with --jitless CLI flag.
|
# disabled with --jitless CLI flag.
|
||||||
- name: WebAssembly
|
- name: WebAssembly
|
||||||
message: "Use `const { WebAssembly } = globalThis;` instead of the global."
|
message: Use `const { WebAssembly } = globalThis;` instead of the global.
|
||||||
- name: atob
|
- name: atob
|
||||||
message: "Use `const { atob } = require('buffer');` instead of the global."
|
message: Use `const { atob } = require('buffer');` instead of the global.
|
||||||
- name: btoa
|
- name: btoa
|
||||||
message: "Use `const { btoa } = require('buffer');` instead of the global."
|
message: Use `const { btoa } = require('buffer');` instead of the global.
|
||||||
- name: crypto
|
- name: crypto
|
||||||
message: "Use `const { crypto } = require('internal/crypto/webcrypto');` instead of the global."
|
message: Use `const { crypto } = require('internal/crypto/webcrypto');` instead of the global.
|
||||||
- name: Crypto
|
- name: Crypto
|
||||||
message: "Use `const { Crypto } = require('internal/crypto/webcrypto');` instead of the global."
|
message: Use `const { Crypto } = require('internal/crypto/webcrypto');` instead of the global.
|
||||||
- name: CryptoKey
|
- name: CryptoKey
|
||||||
message: "Use `const { CryptoKey } = require('internal/crypto/webcrypto');` instead of the global."
|
message: Use `const { CryptoKey } = require('internal/crypto/webcrypto');` instead of the global.
|
||||||
- name: global
|
- name: global
|
||||||
message: "Use `const { globalThis } = primordials;` instead of `global`."
|
message: Use `const { globalThis } = primordials;` instead of `global`.
|
||||||
- name: globalThis
|
- name: globalThis
|
||||||
message: "Use `const { globalThis } = primordials;` instead of the global."
|
message: Use `const { globalThis } = primordials;` instead of the global.
|
||||||
- name: performance
|
- name: performance
|
||||||
message: "Use `const { performance } = require('perf_hooks');` instead of the global."
|
message: Use `const { performance } = require('perf_hooks');` instead of the global.
|
||||||
- name: queueMicrotask
|
- name: queueMicrotask
|
||||||
message: "Use `const { queueMicrotask } = require('internal/process/task_queues');` instead of the global."
|
message: Use `const { queueMicrotask } = require('internal/process/task_queues');` instead of the global.
|
||||||
- name: structuredClone
|
- name: structuredClone
|
||||||
message: "Use `const { structuredClone } = require('internal/structured_clone');` instead of the global."
|
message: Use `const { structuredClone } = require('internal/structured_clone');` instead of the global.
|
||||||
- name: SubtleCrypto
|
- name: SubtleCrypto
|
||||||
message: "Use `const { SubtleCrypto } = require('internal/crypto/webcrypto');` instead of the global."
|
message: Use `const { SubtleCrypto } = require('internal/crypto/webcrypto');` instead of the global.
|
||||||
# Custom rules in tools/eslint-rules
|
# Custom rules in tools/eslint-rules
|
||||||
node-core/lowercase-name-for-primitive: error
|
node-core/lowercase-name-for-primitive: error
|
||||||
node-core/non-ascii-character: error
|
node-core/non-ascii-character: error
|
||||||
|
@ -5,7 +5,7 @@ env:
|
|||||||
es6: true
|
es6: true
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
multiline-comment-style: ["error", "separate-lines"]
|
multiline-comment-style: [error, separate-lines]
|
||||||
no-var: error
|
no-var: error
|
||||||
prefer-const: error
|
prefer-const: error
|
||||||
symbol-description: off
|
symbol-description: off
|
||||||
@ -13,40 +13,40 @@ rules:
|
|||||||
no-restricted-syntax:
|
no-restricted-syntax:
|
||||||
# Config copied from .eslintrc.js
|
# Config copied from .eslintrc.js
|
||||||
- error
|
- error
|
||||||
- selector: "CallExpression:matches([callee.name='deepStrictEqual'], [callee.property.name='deepStrictEqual']):matches([arguments.1.type='Literal']:not([arguments.1.regex]), [arguments.1.type='Identifier'][arguments.1.name='undefined'])"
|
- selector: CallExpression:matches([callee.name='deepStrictEqual'], [callee.property.name='deepStrictEqual']):matches([arguments.1.type='Literal']:not([arguments.1.regex]), [arguments.1.type='Identifier'][arguments.1.name='undefined'])
|
||||||
message: "Use strictEqual instead of deepStrictEqual for literals or undefined."
|
message: Use strictEqual instead of deepStrictEqual for literals or undefined.
|
||||||
- selector: "CallExpression:matches([callee.name='notDeepStrictEqual'], [callee.property.name='notDeepStrictEqual']):matches([arguments.1.type='Literal']:not([arguments.1.regex]), [arguments.1.type='Identifier'][arguments.1.name='undefined'])"
|
- selector: CallExpression:matches([callee.name='notDeepStrictEqual'], [callee.property.name='notDeepStrictEqual']):matches([arguments.1.type='Literal']:not([arguments.1.regex]), [arguments.1.type='Identifier'][arguments.1.name='undefined'])
|
||||||
message: "Use notStrictEqual instead of notDeepStrictEqual for literals or undefined."
|
message: Use notStrictEqual instead of notDeepStrictEqual for literals or undefined.
|
||||||
- selector: "CallExpression:matches([callee.name='deepStrictEqual'], [callee.property.name='deepStrictEqual'])[arguments.2.type='Literal']"
|
- selector: CallExpression:matches([callee.name='deepStrictEqual'], [callee.property.name='deepStrictEqual'])[arguments.2.type='Literal']
|
||||||
message: "Do not use a literal for the third argument of assert.deepStrictEqual()"
|
message: Do not use a literal for the third argument of assert.deepStrictEqual()
|
||||||
- selector: "CallExpression:matches([callee.name='doesNotThrow'], [callee.property.name='doesNotThrow'])"
|
- selector: CallExpression:matches([callee.name='doesNotThrow'], [callee.property.name='doesNotThrow'])
|
||||||
message: "Do not use `assert.doesNotThrow()`. Write the code without the wrapper and add a comment instead."
|
message: Do not use `assert.doesNotThrow()`. Write the code without the wrapper and add a comment instead.
|
||||||
- selector: "CallExpression:matches([callee.name='doesNotReject'], [callee.property.name='doesNotReject'])"
|
- selector: CallExpression:matches([callee.name='doesNotReject'], [callee.property.name='doesNotReject'])
|
||||||
message: "Do not use `assert.doesNotReject()`. Write the code without the wrapper and add a comment instead."
|
message: Do not use `assert.doesNotReject()`. Write the code without the wrapper and add a comment instead.
|
||||||
- selector: "CallExpression:matches([callee.name='rejects'], [callee.property.name='rejects'])[arguments.length<2]"
|
- selector: CallExpression:matches([callee.name='rejects'], [callee.property.name='rejects'])[arguments.length<2]
|
||||||
message: "`assert.rejects()` must be invoked with at least two arguments."
|
message: '`assert.rejects()` must be invoked with at least two arguments.'
|
||||||
- selector: "CallExpression[callee.property.name='strictEqual'][arguments.2.type='Literal']"
|
- selector: CallExpression[callee.property.name='strictEqual'][arguments.2.type='Literal']
|
||||||
message: "Do not use a literal for the third argument of assert.strictEqual()"
|
message: Do not use a literal for the third argument of assert.strictEqual()
|
||||||
- selector: "CallExpression:matches([callee.name='throws'], [callee.property.name='throws'])[arguments.1.type='Literal']:not([arguments.1.regex])"
|
- selector: CallExpression:matches([callee.name='throws'], [callee.property.name='throws'])[arguments.1.type='Literal']:not([arguments.1.regex])
|
||||||
message: "Use an object as second argument of `assert.throws()`."
|
message: Use an object as second argument of `assert.throws()`.
|
||||||
- selector: "CallExpression:matches([callee.name='throws'], [callee.property.name='throws'])[arguments.length<2]"
|
- selector: CallExpression:matches([callee.name='throws'], [callee.property.name='throws'])[arguments.length<2]
|
||||||
message: "`assert.throws()` must be invoked with at least two arguments."
|
message: '`assert.throws()` must be invoked with at least two arguments.'
|
||||||
- selector: "CallExpression[callee.name='setInterval'][arguments.length<2]"
|
- selector: CallExpression[callee.name='setInterval'][arguments.length<2]
|
||||||
message: "`setInterval()` must be invoked with at least two arguments."
|
message: '`setInterval()` must be invoked with at least two arguments.'
|
||||||
- selector: "ThrowStatement > CallExpression[callee.name=/Error$/]"
|
- selector: ThrowStatement > CallExpression[callee.name=/Error$/]
|
||||||
message: "Use `new` keyword when throwing an `Error`."
|
message: Use `new` keyword when throwing an `Error`.
|
||||||
- selector: "CallExpression:matches([callee.name='notDeepStrictEqual'], [callee.property.name='notDeepStrictEqual'])[arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])"
|
- selector: CallExpression:matches([callee.name='notDeepStrictEqual'], [callee.property.name='notDeepStrictEqual'])[arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])
|
||||||
message: "The first argument should be the `actual`, not the `expected` value."
|
message: The first argument should be the `actual`, not the `expected` value.
|
||||||
- selector: "CallExpression:matches([callee.name='notStrictEqual'], [callee.property.name='notStrictEqual'])[arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])"
|
- selector: CallExpression:matches([callee.name='notStrictEqual'], [callee.property.name='notStrictEqual'])[arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])
|
||||||
message: "The first argument should be the `actual`, not the `expected` value."
|
message: The first argument should be the `actual`, not the `expected` value.
|
||||||
- selector: "CallExpression:matches([callee.name='deepStrictEqual'], [callee.property.name='deepStrictEqual'])[arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])"
|
- selector: CallExpression:matches([callee.name='deepStrictEqual'], [callee.property.name='deepStrictEqual'])[arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])
|
||||||
message: "The first argument should be the `actual`, not the `expected` value."
|
message: The first argument should be the `actual`, not the `expected` value.
|
||||||
- selector: "CallExpression:matches([callee.name='strictEqual'], [callee.property.name='strictEqual'])[arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])"
|
- selector: CallExpression:matches([callee.name='strictEqual'], [callee.property.name='strictEqual'])[arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])
|
||||||
message: "The first argument should be the `actual`, not the `expected` value."
|
message: The first argument should be the `actual`, not the `expected` value.
|
||||||
- selector: "CallExpression[callee.name='isNaN']"
|
- selector: CallExpression[callee.name='isNaN']
|
||||||
message: "Use Number.isNaN() instead of the global isNaN() function."
|
message: Use Number.isNaN() instead of the global isNaN() function.
|
||||||
- selector: "VariableDeclarator > CallExpression:matches([callee.name='debuglog'], [callee.property.name='debuglog']):not([arguments.0.value='test'])"
|
- selector: VariableDeclarator > CallExpression:matches([callee.name='debuglog'], [callee.property.name='debuglog']):not([arguments.0.value='test'])
|
||||||
message: "Use 'test' as debuglog value in tests."
|
message: Use 'test' as debuglog value in tests.
|
||||||
|
|
||||||
# Custom rules in tools/eslint-rules
|
# Custom rules in tools/eslint-rules
|
||||||
node-core/prefer-assert-iferror: error
|
node-core/prefer-assert-iferror: error
|
||||||
@ -60,7 +60,7 @@ rules:
|
|||||||
## common module is mandatory in tests
|
## common module is mandatory in tests
|
||||||
node-core/required-modules:
|
node-core/required-modules:
|
||||||
- error
|
- error
|
||||||
- common: 'common(/index\.(m)?js)?$'
|
- common: common(/index\.(m)?js)?$
|
||||||
node-core/require-common-first: error
|
node-core/require-common-first: error
|
||||||
node-core/no-duplicate-requires: off
|
node-core/no-duplicate-requires: off
|
||||||
|
|
||||||
|
@ -5,11 +5,11 @@ env:
|
|||||||
rules:
|
rules:
|
||||||
camelcase:
|
camelcase:
|
||||||
- error
|
- error
|
||||||
- properties: 'never'
|
- properties: never
|
||||||
ignoreDestructuring: true
|
ignoreDestructuring: true
|
||||||
allow: ['child_process']
|
allow: [child_process]
|
||||||
no-unused-vars:
|
no-unused-vars:
|
||||||
- error
|
- error
|
||||||
- args: 'after-used'
|
- args: after-used
|
||||||
prefer-arrow-callback: error
|
prefer-arrow-callback: error
|
||||||
no-var: error
|
no-var: error
|
||||||
|
Loading…
Reference in New Issue
Block a user