Skip to content

Commit

Permalink
Drop support for TypeScript < 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed Oct 26, 2024
1 parent 68aaab9 commit 9812fb0
Show file tree
Hide file tree
Showing 6 changed files with 468 additions and 522 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Make sure that you are using a version of Node.js supported by your version of ESLint.
See prerequisites for [ESLint 8](https://eslint.org/docs/v8.x/use/getting-started#prerequisites) and [ESLint 9](https://eslint.org/docs/v9.x/use/getting-started#prerequisites).
For TypeScript support, you need TypeScript 4.6 or later.
For TypeScript support, you need TypeScript 4.8 or later.

To install gulp-eslint-new, [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm):

Expand Down
7 changes: 2 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ const globals = require('globals');
module.exports =
createConfig
(
{
ignores: ['**/.*', 'coverage', 'example/demo'],
},
{ ignores: ['**/.*', 'coverage', 'example/demo'] },
{
files: ['**/*.js'],
jsVersion: 2020,
Expand All @@ -21,8 +19,7 @@ createConfig
},
{
files: ['**/*.ts'],
tsVersion: '4.6.0',
languageOptions: { parserOptions: { project: 'tsconfig.json' } },
tsVersion: '4.8.0',
plugins: { 'tsdoc': eslintPluginTsdoc },
rules: { 'tsdoc/syntax': 'error' },
},
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ function tsTest(tsVersion, tsPkgName)
return task;
}

task('ts-test', parallel(tsTest('4.6', 'typescript_4.6'), tsTest('5', 'typescript_5')));
task('ts-test', parallel(tsTest('4.8', 'typescript_4.8'), tsTest('5', 'typescript_5')));

task('default', series('clean', parallel('lint', 'ts-test'), 'test'));
5 changes: 3 additions & 2 deletions lib/eslint.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ type ESLintrcOptions = ESLint.LegacyOptions;

type FlatESLintOptions = ESLint.Options;

// In @types/eslint `ESLint.LintResultData` lacks the `maxWarningsExceeded` property.
type FormatterContext = ESLint.LintResultData & ResultsMeta;

type FormatterFunction =
(results: ESLint.LintResult[], context?: FormatterContext) => string | Promise<string>;
(results: ESLint.LintResult[], context: FormatterContext) => string | Promise<string>;

type LintMessage = Linter.LintMessage;

type LintResult = ESLint.LintResult;

interface LoadedFormatter
{ format(results: ESLint.LintResult[], resultsMeta: ResultsMeta): string | Promise<string>; }
{ format(results: ESLint.LintResult[], resultsMeta?: ResultsMeta): string | Promise<string>; }

interface ResultsMeta
{
Expand Down
Loading

0 comments on commit 9812fb0

Please sign in to comment.