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:
Mestery 2022-01-29 21:31:01 +01:00 committed by Antoine du Hamel
parent f282e4a94d
commit 8e653d9898
23 changed files with 150 additions and 150 deletions

View File

@ -1,4 +1,4 @@
name: "\U0001F41B Bug report"
name: \U0001F41B Bug report
description: Create a report to help us improve
body:
- type: markdown

View File

@ -1,6 +1,6 @@
name: "\U0001F680 Feature request"
name: \U0001F680 Feature request
description: Suggest an idea for this project
labels: ["feature request"]
labels: [feature request]
body:
- type: markdown
attributes:

View File

@ -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
labels: ["doc"]
labels: [doc]
body:
- type: markdown
attributes:

View File

@ -1,6 +1,6 @@
name: Report a flaky test
description: Report a flaky test in our CI
labels: ["flaky-test"]
labels: [flaky-test]
body:
- type: markdown
attributes:

View File

@ -2,7 +2,7 @@ name: Authors update
on:
schedule:
# Run once a week at 00:05 AM UTC on Sunday.
- cron: '5 0 * * 0'
- cron: 5 0 * * 0
workflow_dispatch:
@ -15,7 +15,7 @@ jobs:
with:
fetch-depth: '0' # This is required to actually get all the authors
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
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
@ -25,7 +25,7 @@ jobs:
Here are some new additions to the AUTHORS file.
This is an automatically generated PR by the
`authors.yml` GitHub Action, which runs `tools/update-authors.js`.
branch: "actions/authors-update" # Custom branch *just* for this Action.
commit-message: "meta: update AUTHORS"
branch: actions/authors-update # Custom branch *just* for this Action.
commit-message: 'meta: update AUTHORS'
labels: meta
title: "meta: update AUTHORS"
title: 'meta: update AUTHORS'

View File

@ -6,7 +6,7 @@ on:
# optimistic, it can take longer to run.
# To understand why `schedule` is used instead of other events, refer to
# ./doc/contributing/commit-queue.md
- cron: "*/5 * * * *"
- cron: '*/5 * * * *'
env:
NODE_VERSION: lts/*

View File

@ -4,10 +4,10 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- '.mailmap'
- .mailmap
- '**.md'
- 'AUTHORS'
- 'doc/**'
- AUTHORS
- doc/**
- .github/**
- '!.github/workflows/build-tarball.yml'
push:
@ -17,10 +17,10 @@ on:
- v[0-9]+.x-staging
- v[0-9]+.x
paths-ignore:
- '.mailmap'
- .mailmap
- '**.md'
- 'AUTHORS'
- 'doc/**'
- AUTHORS
- doc/**
- .github/**
- '!.github/workflows/build-tarball.yml'

View File

@ -1,7 +1,7 @@
name: Close stalled issues and PRs
on:
schedule:
- cron: "0 0 * * *"
- cron: 0 0 * * *
env:
CLOSE_MESSAGE: >

View File

@ -11,7 +11,7 @@ on:
# be read-only, and the Action won't have access to any other repository
# secrets, which it needs to access Jenkins API.
schedule:
- cron: "*/5 * * * *"
- cron: '*/5 * * * *'
env:
NODE_VERSION: lts/*

View File

@ -5,18 +5,18 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- '**.md'
- 'benchmark/**'
- 'deps/**'
- 'doc/**'
- benchmark/**
- deps/*
- doc/**
- .github/**
- '!.github/workflows/coverage-linux.yml'
push:
branches: [master, main]
paths-ignore:
- '**.md'
- 'benchmark/**'
- 'deps/**'
- 'doc/**'
- benchmark/**
- deps/**
- doc/**
- .github/**
- '!.github/workflows/coverage-linux.yml'

View File

@ -5,20 +5,20 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- '**.md'
- 'benchmark/**'
- 'deps/**'
- 'doc/**'
- 'tools/**'
- benchmark/**
- deps/**
- doc/**
- tools/**
- .github/**
- '!.github/workflows/coverage-windows.yml'
push:
branches: [master, main]
paths-ignore:
- '**.md'
- 'benchmark/**'
- 'deps/**'
- 'doc/**'
- 'tools/**'
- benchmark/**
- deps/**
- doc/**
- tools/**
- .github/**
- '!.github/workflows/coverage-windows.yml'

View File

@ -3,7 +3,7 @@ name: Node.js daily job
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: 0 0 * * *
env:
NODE_VERSION: lts/*

View File

@ -3,7 +3,7 @@ name: Find inactive collaborators
on:
schedule:
# Run every Monday at 4:05 AM UTC.
- cron: '5 4 * * 1'
- cron: 5 4 * * 1
workflow_dispatch:
@ -37,6 +37,6 @@ jobs:
author: Node.js GitHub Bot <github-bot@iojs.org>
branch: actions/inactive-collaborators
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
title: "meta: move one or more collaborators to emeritus"
title: 'meta: move one or more collaborators to emeritus'

View File

@ -3,7 +3,7 @@ name: Find inactive TSC members
on:
schedule:
# Run every Tuesday 12:05 AM UTC.
- cron: '5 0 * * 2'
- cron: 5 0 * * 2
workflow_dispatch:
@ -51,6 +51,6 @@ jobs:
@nodejs/tsc ${{ env.INACTIVE_TSC_HANDLES }}
${{ 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
title: "meta: move one or more TSC members to emeritus"
title: 'meta: move one or more TSC members to emeritus'

View File

@ -3,7 +3,7 @@ on:
schedule:
# 00:00:00 every Monday
# https://crontab.guru/#0_0_*_*_1
- cron: "0 0 * * 1"
- cron: 0 0 * * 1
workflow_dispatch:
jobs:
@ -14,14 +14,14 @@ jobs:
- uses: actions/checkout@v2
with:
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
author: Node.js GitHub Bot <github-bot@iojs.org>
branch: actions/license-builder
title: "doc: run license-builder"
title: 'doc: run license-builder'
body: >
License is likely out of date. This is an automatically generated PR by
the `license-builder.yml` GitHub Action, which runs `license-builder.sh`

View File

@ -138,7 +138,7 @@ jobs:
persist-credentials: false
- uses: mszostok/codeowners-validator@v0.6.0
with:
checks: "files,duppatterns"
checks: files,duppatterns
lint-pr-url:
if: ${{ github.event.pull_request }}
runs-on: ubuntu-latest

View File

@ -16,7 +16,7 @@ jobs:
env:
SLACK_COLOR: '#DE512A'
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: |
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 }}>

View File

@ -4,10 +4,10 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- '.mailmap'
- .mailmap
- '**.md'
- 'AUTHORS'
- 'doc/**'
- AUTHORS
- doc/**
- .github/**
- '!.github/workflows/test-asan.yml'
push:
@ -18,10 +18,10 @@ on:
- v[0-9]+.x-staging
- v[0-9]+.x
paths-ignore:
- '.mailmap'
- .mailmap
- '**.md'
- 'AUTHORS'
- 'doc/**'
- AUTHORS
- doc/**
- .github/**
- '!.github/workflows/test-asan.yml'

View File

@ -4,10 +4,10 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- '.mailmap'
- .mailmap
- '**.md'
- 'AUTHORS'
- 'doc/**'
- AUTHORS
- doc/**
- .github/**
- '!.github/workflows/test-macos.yml'
push:
@ -18,10 +18,10 @@ on:
- v[0-9]+.x-staging
- v[0-9]+.x
paths-ignore:
- '.mailmap'
- .mailmap
- '**.md'
- 'AUTHORS'
- 'doc/**'
- AUTHORS
- doc/**
- .github/**
- '!.github/workflows/test-macos.yml'

View File

@ -2,7 +2,7 @@ name: Tools update
on:
schedule:
# Run once a week at 00:05 AM UTC on Saturday.
- cron: '5 0 * * 6'
- cron: 5 0 * * 6
workflow_dispatch:
@ -23,7 +23,7 @@ jobs:
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./update-eslint.sh
fi
- id: "lint-md-dependencies"
- id: lint-md-dependencies
run: |
cd tools/lint-md
npm ci
@ -63,8 +63,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
with:
author: Node.js GitHub Bot <github-bot@iojs.org>
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.
commit-message: "tools: update ${{ 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.
commit-message: 'tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}'
labels: tools
title: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"
title: 'tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}'

View File

@ -6,97 +6,97 @@ rules:
no-buffer-constructor: error
no-mixed-operators:
- error
- groups: [["&&", "||"]]
- groups: [['&&', '||']]
no-restricted-syntax:
# Config copied from .eslintrc.js
- error
- 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"
- selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]"
message: "setTimeout() must be invoked with at least two arguments."
- selector: "CallExpression[callee.name='setInterval'][arguments.length<2]"
message: "setInterval() must be invoked with at least 2 arguments."
- selector: "ThrowStatement > CallExpression[callee.name=/Error$/]"
message: "Use new keyword when throwing an Error."
- 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
- selector: CallExpression[callee.name='setTimeout'][arguments.length<2]
message: setTimeout() must be invoked with at least two arguments.
- selector: CallExpression[callee.name='setInterval'][arguments.length<2]
message: setInterval() must be invoked with at least 2 arguments.
- selector: ThrowStatement > CallExpression[callee.name=/Error$/]
message: Use new keyword when throwing an Error.
# Config specific to lib
- selector: "NewExpression[callee.name=/Error$/]:not([callee.name=/^(AssertionError|NghttpError|AbortError)$/])"
message: "Use an error exported by the internal/errors module."
- selector: "CallExpression[callee.object.name='Error'][callee.property.name='captureStackTrace']"
message: "Please use `require('internal/errors').hideStackFrames()` instead."
- selector: "AssignmentExpression:matches([left.name='prepareStackTrace'], [left.property.name='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']))"
message: "The context passed into SystemError constructor must have .code, .syscall and .message."
- selector: NewExpression[callee.name=/Error$/]:not([callee.name=/^(AssertionError|NghttpError|AbortError)$/])
message: Use an error exported by the internal/errors module.
- selector: CallExpression[callee.object.name='Error'][callee.property.name='captureStackTrace']
message: Please use `require('internal/errors').hideStackFrames()` instead.
- selector: AssignmentExpression:matches([left.name='prepareStackTrace'], [left.property.name='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']))
message: The context passed into SystemError constructor must have .code, .syscall and .message.
no-restricted-globals:
- error
- 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
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
# disabled with --no-harmony-atomics CLI flag.
- name: Atomics
message: "Use `const { Atomics } = globalThis;` instead of the global."
message: Use `const { Atomics } = globalThis;` instead of the global.
- name: Blob
message: "Use `const { Blob } = require('buffer');` instead of the global."
message: Use `const { Blob } = require('buffer');` instead of the global.
- name: Buffer
message: "Use `const { Buffer } = require('buffer');` instead of the global."
message: Use `const { Buffer } = require('buffer');` instead of the global.
- 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
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
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
# disabled with --without-intl build flag.
- name: Intl
message: "Use `const { Intl } = globalThis;` instead of the global."
message: Use `const { Intl } = globalThis;` instead of the global.
- 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
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
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
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
# disabled with --no-harmony-sharedarraybuffer CLI flag.
- name: SharedArrayBuffer
message: "Use `const { SharedArrayBuffer } = globalThis;` instead of the global."
message: Use `const { SharedArrayBuffer } = globalThis;` instead of the global.
- 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
message: "Use `const { TextEncoder } = require('internal/encoding');` instead of the global."
message: Use `const { TextEncoder } = require('internal/encoding');` instead of the global.
- 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
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
# disabled with --jitless CLI flag.
- name: WebAssembly
message: "Use `const { WebAssembly } = globalThis;` instead of the global."
message: Use `const { WebAssembly } = globalThis;` instead of the global.
- name: atob
message: "Use `const { atob } = require('buffer');` instead of the global."
message: Use `const { atob } = require('buffer');` instead of the global.
- name: btoa
message: "Use `const { btoa } = require('buffer');` instead of the global."
message: Use `const { btoa } = require('buffer');` instead of the global.
- 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
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
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
message: "Use `const { globalThis } = primordials;` instead of `global`."
message: Use `const { globalThis } = primordials;` instead of `global`.
- name: globalThis
message: "Use `const { globalThis } = primordials;` instead of the global."
message: Use `const { globalThis } = primordials;` instead of the global.
- 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
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
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
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
node-core/lowercase-name-for-primitive: error
node-core/non-ascii-character: error

View File

@ -5,7 +5,7 @@ env:
es6: true
rules:
multiline-comment-style: ["error", "separate-lines"]
multiline-comment-style: [error, separate-lines]
no-var: error
prefer-const: error
symbol-description: off
@ -13,40 +13,40 @@ rules:
no-restricted-syntax:
# Config copied from .eslintrc.js
- 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'])"
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'])"
message: "Use notStrictEqual instead of notDeepStrictEqual for literals or undefined."
- 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()"
- 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."
- 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."
- selector: "CallExpression:matches([callee.name='rejects'], [callee.property.name='rejects'])[arguments.length<2]"
message: "`assert.rejects()` must be invoked with at least two arguments."
- selector: "CallExpression[callee.property.name='strictEqual'][arguments.2.type='Literal']"
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])"
message: "Use an object as second argument of `assert.throws()`."
- selector: "CallExpression:matches([callee.name='throws'], [callee.property.name='throws'])[arguments.length<2]"
message: "`assert.throws()` must be invoked with at least two arguments."
- selector: "CallExpression[callee.name='setInterval'][arguments.length<2]"
message: "`setInterval()` must be invoked with at least two arguments."
- selector: "ThrowStatement > CallExpression[callee.name=/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'])"
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'])"
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'])"
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'])"
message: "The first argument should be the `actual`, not the `expected` value."
- selector: "CallExpression[callee.name='isNaN']"
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'])"
message: "Use 'test' as debuglog value in tests."
- 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.
- 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.
- 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()
- 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.
- 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.
- selector: CallExpression:matches([callee.name='rejects'], [callee.property.name='rejects'])[arguments.length<2]
message: '`assert.rejects()` must be invoked with at least two arguments.'
- selector: CallExpression[callee.property.name='strictEqual'][arguments.2.type='Literal']
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])
message: Use an object as second argument of `assert.throws()`.
- selector: CallExpression:matches([callee.name='throws'], [callee.property.name='throws'])[arguments.length<2]
message: '`assert.throws()` must be invoked with at least two arguments.'
- selector: CallExpression[callee.name='setInterval'][arguments.length<2]
message: '`setInterval()` must be invoked with at least two arguments.'
- selector: ThrowStatement > CallExpression[callee.name=/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'])
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'])
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'])
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'])
message: The first argument should be the `actual`, not the `expected` value.
- selector: CallExpression[callee.name='isNaN']
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'])
message: Use 'test' as debuglog value in tests.
# Custom rules in tools/eslint-rules
node-core/prefer-assert-iferror: error
@ -60,7 +60,7 @@ rules:
## common module is mandatory in tests
node-core/required-modules:
- error
- common: 'common(/index\.(m)?js)?$'
- common: common(/index\.(m)?js)?$
node-core/require-common-first: error
node-core/no-duplicate-requires: off

View File

@ -5,11 +5,11 @@ env:
rules:
camelcase:
- error
- properties: 'never'
- properties: never
ignoreDestructuring: true
allow: ['child_process']
allow: [child_process]
no-unused-vars:
- error
- args: 'after-used'
- args: after-used
prefer-arrow-callback: error
no-var: error