Skip to content

docs: rename "directive comments" to "comment directives" #11268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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: 3 additions & 3 deletions packages/eslint-plugin/docs/rules/ban-ts-comment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/util/astUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
8 changes: 4 additions & 4 deletions packages/scope-manager/src/variable/ESLintScopeVariable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
}
2 changes: 1 addition & 1 deletion packages/utils/src/ts-eslint/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export namespace ClassicConfig {
*/
globals?: GlobalsConfig;
/**
* The flag that disables directive comments.
* The flag that disables comment directives.
*/
noInlineConfig?: boolean;
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/ts-eslint/eslint/ESLintShared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export declare class ESLintBase<
}
export interface ESLintOptions<Config extends Linter.ConfigType> {
/**
* 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
*/
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy