Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import toolsConfig from './tools/eslint.config_partial.mjs';
import {
noRestrictedSyntaxCommonAll,
noRestrictedSyntaxCommonLib,
noRestrictedSyntaxCommonTest,
requireEslintTool,
resolveEslintTool,
} from './tools/eslint.config_utils.mjs';
Expand Down Expand Up @@ -191,12 +190,15 @@ export default [
property: '__defineSetter__',
message: '__defineSetter__ is deprecated.',
},
{
property: 'webcrypto',
message: 'Use `globalThis.crypto`.',
},
],
'no-restricted-syntax': [
'error',
...noRestrictedSyntaxCommonAll,
...noRestrictedSyntaxCommonLib,
...noRestrictedSyntaxCommonTest,
],
'no-self-compare': 'error',
'no-template-curly-in-string': 'error',
Expand Down
2 changes: 0 additions & 2 deletions test/eslint.config_partial.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import {
noRestrictedSyntaxCommonAll,
noRestrictedSyntaxCommonTest,
requireEslintTool,
} from '../tools/eslint.config_utils.mjs';

Expand All @@ -26,7 +25,6 @@ export default [
'no-restricted-syntax': [
'error',
...noRestrictedSyntaxCommonAll,
...noRestrictedSyntaxCommonTest,
{
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.',
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-global-webcrypto-classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ if (!common.hasCrypto)

const assert = require('assert');

/* eslint-disable no-restricted-syntax */
const webcrypto = require('internal/crypto/webcrypto');
assert.strictEqual(Crypto, webcrypto.Crypto);
assert.strictEqual(CryptoKey, webcrypto.CryptoKey);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-global-webcrypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (!common.hasCrypto)
const assert = require('assert');
const crypto = require('crypto');

/* eslint-disable no-restricted-syntax */
/* eslint-disable no-restricted-properties */
assert.strictEqual(globalThis.crypto, crypto.webcrypto);
assert.strictEqual(Crypto, crypto.webcrypto.constructor);
assert.strictEqual(SubtleCrypto, crypto.webcrypto.subtle.constructor);
9 changes: 0 additions & 9 deletions tools/eslint.config_utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,3 @@ export const noRestrictedSyntaxCommonLib = [
message: '`setTimeout()` must be invoked with at least two arguments.',
},
];

export const noRestrictedSyntaxCommonTest = [
{
// TODO(@panva): move this to no-restricted-properties
// when https://github.com/eslint/eslint/issues/16412 is fixed.
selector: "Identifier[name='webcrypto']",
message: 'Use `globalThis.crypto`.',
},
];