From a2b4e4be7c8a7e71417e4e9da5b24ccddecf8ad0 Mon Sep 17 00:00:00 2001 From: "Shahar \"Dawn\" Or" Date: Sat, 5 Oct 2024 15:11:05 +0700 Subject: [PATCH] feat!: no-new-native-nonconstructor Also replaces no-new-symbol --- src/_intentionally-unused-rules.ts | 3 +++ src/rules.ts | 2 +- src/test/_expected-exported-value.ts | 2 +- src/test/_rules_to_consider.ts | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/_intentionally-unused-rules.ts b/src/_intentionally-unused-rules.ts index eacb3701..5a20bfaa 100644 --- a/src/_intentionally-unused-rules.ts +++ b/src/_intentionally-unused-rules.ts @@ -17,6 +17,9 @@ export const intentionallyUnusedRules: string[] = [ // Made redundant by TS strict mode and `@typescript-eslint/explicit-function-return-type` '@typescript-eslint/explicit-module-boundary-types', + // Made redundant by no-new-native-nonconstructor + 'no-new-symbol', + // From rule documentation: // > Requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability. TypeScript is often better at inferring types than easily written type annotations would allow. // > diff --git a/src/rules.ts b/src/rules.ts index 8187b105..01789cd0 100644 --- a/src/rules.ts +++ b/src/rules.ts @@ -323,7 +323,7 @@ export const eslintRules: Record = { 'no-multi-str': ['error'], 'no-new': ['error'], 'no-new-func': ['error'], - 'no-new-symbol': ['error'], + 'no-new-native-nonconstructor': ['error'], 'no-new-wrappers': ['error'], 'no-obj-calls': ['error'], 'no-object-constructor': ['error'], diff --git a/src/test/_expected-exported-value.ts b/src/test/_expected-exported-value.ts index e4dc1406..f0321cc1 100644 --- a/src/test/_expected-exported-value.ts +++ b/src/test/_expected-exported-value.ts @@ -75,7 +75,7 @@ export const expectedEslintRules: Record< 'no-multi-str': ['error'], 'no-new': ['error'], 'no-new-func': ['error'], - 'no-new-symbol': ['error'], + 'no-new-native-nonconstructor': ['error'], 'no-new-wrappers': ['error'], 'no-obj-calls': ['error'], 'no-object-constructor': ['error'], diff --git a/src/test/_rules_to_consider.ts b/src/test/_rules_to_consider.ts index 57aff43b..6df6be55 100644 --- a/src/test/_rules_to_consider.ts +++ b/src/test/_rules_to_consider.ts @@ -49,7 +49,6 @@ export const eslintRulesToConsider = [ 'no-multi-assign', 'no-negated-condition', 'no-nested-ternary', - 'no-new-native-nonconstructor', 'no-nonoctal-decimal-escape', 'no-param-reassign', 'no-plusplus',