Skip to content

Commit 018aa22

Browse files
committed
Forbid concurrency option
1 parent b61012f commit 018aa22

File tree

5 files changed

+15
-26
lines changed

5 files changed

+15
-26
lines changed

lib/eslint.d.ts

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
11
import type { ESLint, Linter } from 'eslint';
22

3-
type ESLintrcOptions = ESLint.LegacyOptions;
4-
5-
type FlatESLintOptions = ESLint.Options;
6-
7-
// In @types/eslint `ESLint.LintResultData` lacks the `maxWarningsExceeded` property.
8-
type FormatterContext = ESLint.LintResultData & ResultsMeta;
9-
10-
type FormatterFunction =
11-
(results: ESLint.LintResult[], context: FormatterContext) => string | Promise<string>;
12-
13-
type LintMessage = Linter.LintMessage;
14-
15-
type LintResult = ESLint.LintResult;
16-
17-
interface LoadedFormatter
18-
{ format(results: ESLint.LintResult[], resultsMeta?: ResultsMeta): string | Promise<string>; }
19-
20-
interface ResultsMeta
21-
{
22-
maxWarningsExceeded?:
23-
{
24-
foundWarnings: number;
25-
maxWarnings: number;
26-
};
27-
}
3+
type ESLintrcOptions = ESLint.LegacyOptions;
4+
type FlatESLintOptions = ESLint.Options;
5+
type FormatterFunction = ESLint.FormatterFunction;
6+
type LintMessage = Linter.LintMessage;
7+
type LintResult = ESLint.LintResult;
8+
type LintResultData = ESLint.LintResultData;
9+
type LoadedFormatter = ESLint.LoadedFormatter;
10+
type ResultsMeta = ESLint.ResultsMeta;

lib/gulp-eslint-new.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ declare namespace gulpESLintNew
2424
warnIgnored?: boolean | undefined;
2525
}
2626

27-
type FormatterContext = eslint.FormatterContext;
27+
type FormatterContext = eslint.LintResultData;
2828

2929
type FormatterFunction = eslint.FormatterFunction;
3030

@@ -143,6 +143,7 @@ declare namespace gulpESLintNew
143143
| 'cache'
144144
| 'cacheLocation'
145145
| 'cacheStrategy'
146+
| 'concurrency'
146147
| 'errorOnUnmatchedPattern'
147148
| 'globInputPaths'
148149
| 'passOnNoPatterns'

lib/util.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ const FORBIDDEN_OPTIONS =
277277
'cacheFile',
278278
'cacheLocation',
279279
'cacheStrategy',
280+
'concurrency',
280281
'errorOnUnmatchedPattern',
281282
'extensions',
282283
'globInputPaths',

test/organize-options.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ describe
8787
cacheFile: '\0',
8888
cacheLocation: '\0',
8989
cacheStrategy: 'metadata',
90+
concurrency: 'off',
9091
errorOnUnmatchedPattern: true,
9192
extensions: [],
9293
globInputPaths: false,

test/ts-defs-test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ gulpESLintNew({ cacheLocation: undefined });
124124
// @ts-expect-error Invalid option.
125125
gulpESLintNew({ cacheStrategy: undefined });
126126

127+
// @ts-expect-error Invalid option.
128+
gulpESLintNew({ concurrency: undefined });
129+
127130
// @ts-expect-error Invalid option.
128131
gulpESLintNew({ errorOnUnmatchedPattern: undefined });
129132

0 commit comments

Comments
 (0)