tools: support DisposableStack
and AsyncDisposableStack
in linter
PR-URL: https://github.com/nodejs/node/pull/58454 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
a7e4a40298
commit
381d7a4ae0
@ -120,6 +120,7 @@ export default [
|
|||||||
{
|
{
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
|
AsyncDisposableStack: 'readonly',
|
||||||
ByteLengthQueuingStrategy: 'readonly',
|
ByteLengthQueuingStrategy: 'readonly',
|
||||||
CompressionStream: 'readonly',
|
CompressionStream: 'readonly',
|
||||||
CountQueuingStrategy: 'readonly',
|
CountQueuingStrategy: 'readonly',
|
||||||
@ -128,6 +129,7 @@ export default [
|
|||||||
Crypto: 'readonly',
|
Crypto: 'readonly',
|
||||||
CryptoKey: 'readonly',
|
CryptoKey: 'readonly',
|
||||||
DecompressionStream: 'readonly',
|
DecompressionStream: 'readonly',
|
||||||
|
DisposableStack: 'readonly',
|
||||||
EventSource: 'readable',
|
EventSource: 'readable',
|
||||||
fetch: 'readonly',
|
fetch: 'readonly',
|
||||||
Float16Array: 'readonly',
|
Float16Array: 'readonly',
|
||||||
|
@ -356,11 +356,22 @@ export default [
|
|||||||
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.",
|
||||||
},
|
},
|
||||||
// Float16Array is not available in primordials because it's only available with --js-float16array CLI flag.
|
// Float16Array is not available in primordials because it can be
|
||||||
|
// disabled with --no-js-float16array CLI flag.
|
||||||
{
|
{
|
||||||
name: 'Float16Array',
|
name: 'Float16Array',
|
||||||
message: 'Use `const { Float16Array } = globalThis;` instead of the global.',
|
message: 'Use `const { Float16Array } = globalThis;` instead of the global.',
|
||||||
},
|
},
|
||||||
|
// DisposableStack and AsyncDisposableStack are not available in primordials because they can be
|
||||||
|
// disabled with --no-js-explicit-resource-management CLI flag.
|
||||||
|
{
|
||||||
|
name: 'DisposableStack',
|
||||||
|
message: 'Use `const { DisposableStack } = globalThis;` instead of the global.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'AsyncDisposableStack',
|
||||||
|
message: 'Use `const { AsyncDisposableStack } = globalThis;` instead of the global.',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
'no-restricted-modules': [
|
'no-restricted-modules': [
|
||||||
'error',
|
'error',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user