Skip to content

Commit 8208974

Browse files
authored
docs: rename "directive comments" to "comment directives" (typescript-eslint#11268)
* Update ban-ts-comment.mdx * rename more
1 parent b2eded8 commit 8208974

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

packages/eslint-plugin/docs/rules/ban-ts-comment.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import TabItem from '@theme/TabItem';
99
>
1010
> See **https://typescript-eslint.io/rules/ban-ts-comment** for documentation.
1111
12-
TypeScript provides several directive comments that can be used to alter how it processes files.
12+
TypeScript provides several comment directives that can be used to alter how it processes files.
1313
Using these to suppress TypeScript compiler errors reduces the effectiveness of TypeScript overall.
1414
Instead, it's generally better to correct the types of code, to make directives unnecessary.
1515

16-
The directive comments supported by TypeScript are:
16+
The comment directives supported by TypeScript are:
1717

1818
```ts
1919
// @ts-expect-error
@@ -22,7 +22,7 @@ The directive comments supported by TypeScript are:
2222
// @ts-check
2323
```
2424

25-
This rule lets you set which directive comments you want to allow in your codebase.
25+
This rule lets you set which comment directives you want to allow in your codebase.
2626

2727
## Options
2828

packages/eslint-plugin/src/util/astUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export * from '@typescript-eslint/utils/ast-utils';
1111
// https://github.com/eslint/eslint/blob/145aec1ab9052fbca96a44d04927c595951b1536/lib/rules/utils/ast-utils.js#L1751-L1779
1212
// Could be export { getNameLocationInGlobalDirectiveComment } from 'eslint/lib/rules/utils/ast-utils'
1313
/**
14-
* Get the `loc` object of a given name in a `/*globals` directive comment.
14+
* Get the `loc` object of a given name in a `/*globals` comment directive.
1515
* @param sourceCode The source code to convert index to loc.
16-
* @param comment The `/*globals` directive comment which include the name.
16+
* @param comment The `/*globals` comment directive which include the name.
1717
* @param name The name to find.
1818
* @returns The `loc` object.
1919
*/

packages/scope-manager/src/variable/ESLintScopeVariable.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ export class ESLintScopeVariable extends VariableBase {
1717

1818
/**
1919
* Written to by ESLint.
20-
* This property is undefined if there are no globals directive comments.
21-
* The array of globals directive comments which defined this global variable in the source code file.
20+
* This property is undefined if there are no globals comment directives.
21+
* The array of globals comment directives which defined this global variable in the source code file.
2222
*/
2323
public eslintExplicitGlobal?: boolean;
2424

2525
/**
2626
* Written to by ESLint.
27-
* The configured value in config files. This can be different from `variable.writeable` if there are globals directive comments.
27+
* The configured value in config files. This can be different from `variable.writeable` if there are globals comment directives.
2828
*/
2929
public eslintImplicitGlobalSetting?: 'readonly' | 'writable';
3030

3131
/**
3232
* Written to by ESLint.
3333
* If this key exists, it is a global variable added by ESLint.
34-
* If `true`, this global variable was defined by a globals directive comment in the source code file.
34+
* If `true`, this global variable was defined by a globals comment directive in the source code file.
3535
*/
3636
public eslintExplicitGlobalComments?: TSESTree.Comment[];
3737
}

packages/utils/src/ts-eslint/Config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export namespace ClassicConfig {
7979
*/
8080
globals?: GlobalsConfig;
8181
/**
82-
* The flag that disables directive comments.
82+
* The flag that disables comment directives.
8383
*/
8484
noInlineConfig?: boolean;
8585
/**

packages/utils/src/ts-eslint/eslint/ESLintShared.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export declare class ESLintBase<
104104
}
105105
export interface ESLintOptions<Config extends Linter.ConfigType> {
106106
/**
107-
* If false is present, ESLint suppresses directive comments in source code.
107+
* If false is present, ESLint suppresses comment directives in source code.
108108
* If this option is false, it overrides the noInlineConfig setting in your configurations.
109109
* @default true
110110
*/

0 commit comments

Comments
 (0)