From 3d63a4580a2e0a1dd2a68a8997d436ec82cd454a Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Wed, 4 Jun 2025 14:06:07 +0300 Subject: [PATCH 1/2] Update ban-ts-comment.mdx --- packages/eslint-plugin/docs/rules/ban-ts-comment.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx b/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx index e2338747b707..0f162f5ee57f 100644 --- a/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx +++ b/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx @@ -9,11 +9,11 @@ import TabItem from '@theme/TabItem'; > > See **https://typescript-eslint.io/rules/ban-ts-comment** for documentation. -TypeScript provides several directive comments that can be used to alter how it processes files. +TypeScript provides several comment directives that can be used to alter how it processes files. Using these to suppress TypeScript compiler errors reduces the effectiveness of TypeScript overall. Instead, it's generally better to correct the types of code, to make directives unnecessary. -The directive comments supported by TypeScript are: +The comment directives supported by TypeScript are: ```ts // @ts-expect-error @@ -22,7 +22,7 @@ The directive comments supported by TypeScript are: // @ts-check ``` -This rule lets you set which directive comments you want to allow in your codebase. +This rule lets you set which comment directives you want to allow in your codebase. ## Options From c6944886763f24b0da0c5d892dc2ef109f119b76 Mon Sep 17 00:00:00 2001 From: mrazauskas Date: Fri, 6 Jun 2025 09:50:21 +0300 Subject: [PATCH 2/2] rename more --- packages/eslint-plugin/src/util/astUtils.ts | 4 ++-- .../scope-manager/src/variable/ESLintScopeVariable.ts | 8 ++++---- packages/utils/src/ts-eslint/Config.ts | 2 +- packages/utils/src/ts-eslint/eslint/ESLintShared.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/eslint-plugin/src/util/astUtils.ts b/packages/eslint-plugin/src/util/astUtils.ts index c2450ae30130..1d8500052634 100644 --- a/packages/eslint-plugin/src/util/astUtils.ts +++ b/packages/eslint-plugin/src/util/astUtils.ts @@ -11,9 +11,9 @@ export * from '@typescript-eslint/utils/ast-utils'; // https://github.com/eslint/eslint/blob/145aec1ab9052fbca96a44d04927c595951b1536/lib/rules/utils/ast-utils.js#L1751-L1779 // Could be export { getNameLocationInGlobalDirectiveComment } from 'eslint/lib/rules/utils/ast-utils' /** - * Get the `loc` object of a given name in a `/*globals` directive comment. + * Get the `loc` object of a given name in a `/*globals` comment directive. * @param sourceCode The source code to convert index to loc. - * @param comment The `/*globals` directive comment which include the name. + * @param comment The `/*globals` comment directive which include the name. * @param name The name to find. * @returns The `loc` object. */ diff --git a/packages/scope-manager/src/variable/ESLintScopeVariable.ts b/packages/scope-manager/src/variable/ESLintScopeVariable.ts index be5a95acec89..a51995f27ec7 100644 --- a/packages/scope-manager/src/variable/ESLintScopeVariable.ts +++ b/packages/scope-manager/src/variable/ESLintScopeVariable.ts @@ -17,21 +17,21 @@ export class ESLintScopeVariable extends VariableBase { /** * Written to by ESLint. - * This property is undefined if there are no globals directive comments. - * The array of globals directive comments which defined this global variable in the source code file. + * This property is undefined if there are no globals comment directives. + * The array of globals comment directives which defined this global variable in the source code file. */ public eslintExplicitGlobal?: boolean; /** * Written to by ESLint. - * The configured value in config files. This can be different from `variable.writeable` if there are globals directive comments. + * The configured value in config files. This can be different from `variable.writeable` if there are globals comment directives. */ public eslintImplicitGlobalSetting?: 'readonly' | 'writable'; /** * Written to by ESLint. * If this key exists, it is a global variable added by ESLint. - * If `true`, this global variable was defined by a globals directive comment in the source code file. + * If `true`, this global variable was defined by a globals comment directive in the source code file. */ public eslintExplicitGlobalComments?: TSESTree.Comment[]; } diff --git a/packages/utils/src/ts-eslint/Config.ts b/packages/utils/src/ts-eslint/Config.ts index b80646756e35..8dc9b80c9e28 100644 --- a/packages/utils/src/ts-eslint/Config.ts +++ b/packages/utils/src/ts-eslint/Config.ts @@ -79,7 +79,7 @@ export namespace ClassicConfig { */ globals?: GlobalsConfig; /** - * The flag that disables directive comments. + * The flag that disables comment directives. */ noInlineConfig?: boolean; /** diff --git a/packages/utils/src/ts-eslint/eslint/ESLintShared.ts b/packages/utils/src/ts-eslint/eslint/ESLintShared.ts index db6e5b4de20d..54a79d150bd1 100644 --- a/packages/utils/src/ts-eslint/eslint/ESLintShared.ts +++ b/packages/utils/src/ts-eslint/eslint/ESLintShared.ts @@ -104,7 +104,7 @@ export declare class ESLintBase< } export interface ESLintOptions { /** - * If false is present, ESLint suppresses directive comments in source code. + * If false is present, ESLint suppresses comment directives in source code. * If this option is false, it overrides the noInlineConfig setting in your configurations. * @default true */