8000 fix: lint across codebase · CarsonF/typescript-eslint@96ebfa4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 96ebfa4

Browse files
committed
fix: lint across codebase
1 parent ae3291a commit 96ebfa4

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

packages/eslint-plugin/src/rules/ban-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default util.createRule<Options, MessageIds>({
5858
},
5959
fixable: 'code',
6060
messages: {
61-
bannedTypeMessage: "Don't use '{{name}}' as a type.{{customMessage}}",
61+
bannedTypeMessage: "Don't use `{{name}}` as a type.{{customMessage}}",
6262
},
6363
schema: [
6464
{

packages/experimental-utils/src/ts-eslint-scope/analyze.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ interface AnalysisOptions {
77
ignoreEval?: boolean;
88
nodejsScope?: boolean;
99
impliedStrict?: boolean;
10-
fallback?: string | ((node: {}) => string[]);
10+
fallback?: string | ((node: Record<string, unknown>) => string[]);
1111
sourceType?: 'script' | 'module';
1212
ecmaVersion?: number;
1313
}
1414
const analyze = ESLintAnalyze as (
15-
ast: {},
15+
ast: Record<string, unknown>,
1616
options?: AnalysisOptions,
1717
) => ScopeManager;
1818

packages/experimental-utils/src/ts-eslint/Rule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ interface RuleContext<
173173
* The shared settings from configuration.
174174
* We do not have any shared settings in this plugin.
175175
*/
176-
settings: {};
176+
settings: Record<string, unknown>;
177177
/**
178178
* The name of the parser from configuration.
179179
*/

packages/typescript-estree/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ interface ParseOptions {
8888
* When value is `false`, no logging will occur.
8989
* When value is not provided, `console.log()` will be used.
9090
*/
91-
loggerFn?: Function | false;
91+
loggerFn?: ((message: string) => void) | false;
9292

9393
/**
9494
* Controls whether the `range` property is included on AST nodes.

packages/typescript-estree/src/parser-options.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface Extra {
1515
filePath: string;
1616
jsx: boolean;
1717
loc: boolean;
18-
log: Function;
18+
log: (message: string) => void;
1919
preserveNodeMaps?: boolean;
2020
projects: string[];
2121
range: boolean;
@@ -93,7 +93,7 @@ export interface TSESTreeOptions {
9393
* When value is `false`, no logging will occur.
9494
* When value is not provided, `console.log()` will be used.
9595
*/
96-
loggerFn?: Function | false;
96+
loggerFn?: ((message: string) => void) | false;
9797

9898
/**
9999
* Allows the user to control whether or not two-way AST node maps are preserved

packages/typescript-estree/src/parser.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function applyParserOptionsToExtra(options: TSESTreeOptions): void {
202202
if (typeof options.loggerFn === 'function') {
203203
extra.log = options.loggerFn;
204204
} else if (options.loggerFn === false) {
205-
extra.log = Function.prototype;
205+
extra.log = (): void => {};
206206
}
207207

208208
if (typeof options.project === 'string') {
@@ -283,8 +283,11 @@ function warnAboutTSVersion(): void {
283283
// Parser
284284
//------------------------------------------------------------------------------
285285

286+
// the `{}` is safe in here, because {} & TSESTree.Program === TSESTree.Program
286287
type AST<T extends TSESTreeOptions> = TSESTree.Program &
288+
// eslint-disable-next-line @typescript-eslint/ban-types
287289
(T['tokens'] extends true ? { tokens: TSESTree.Token[] } : {}) &
290+
// eslint-disable-next-line @typescript-eslint/ban-types
288291
(T['comment'] extends true ? { comments: TSESTree.Comment[] } : {});
289292

290293
interface ParseAndGenerateServicesResult<T extends TSESTreeOptions> {

0 commit comments

Comments
 (0)
0