Skip to content

Commit

Permalink
Update rules and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed Jul 23, 2024
1 parent 51403a5 commit 0922f0f
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 123 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"update-dist": "node dev/update-dist.js"
},
"dependencies": {
"@types/eslint": "8",
"@types/eslint": "9",
"semver": "^7.5.2"
},
"devDependencies": {
Expand All @@ -33,8 +33,8 @@
"@eslint-community/eslint-plugin-eslint-comments": ">=4.1",
"@origin-1/eslint-plugin": ">=0.16",
"@stylistic/eslint-plugin": "^2.1",
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.40",
"@typescript-eslint/parser": "8.0.0-alpha.40",
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.51",
"@typescript-eslint/parser": "8.0.0-alpha.51",
"eslint": "^9.3",
"eslint-plugin-n": "17"
},
Expand Down
12 changes: 6 additions & 6 deletions src/lib/create-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ from './rules.js';
import type { ESLint, Linter } from 'eslint';
import semver from 'semver';

export type ConfigData = Linter.FlatConfig & LanguageConfigData;
export type ConfigData = Linter.Config & LanguageConfigData;

export interface LanguageConfigData
{
Expand Down Expand Up @@ -140,15 +140,15 @@ function createCommonEntries(): { plugins: string[]; rules: Record<string, Linte
return commonEntries;
}

export async function createConfig(...configDataList: ConfigData[]): Promise<Linter.FlatConfig[]>
export async function createConfig(...configDataList: ConfigData[]): Promise<Linter.Config[]>
{
const promises = configDataList.map(createSingleFlatConfig);
return Promise.all(promises);
}

export { createConfig as createFlatConfig };

async function createSingleFlatConfig(configData: ConfigData): Promise<Linter.FlatConfig>
async function createSingleFlatConfig(configData: ConfigData): Promise<Linter.Config>
{
const { jsVersion: rawJSVersion, tsVersion: rawTSVersion, ...config } = configData;
if (rawJSVersion != null && rawTSVersion != null)
Expand Down Expand Up @@ -191,7 +191,7 @@ async function createSingleFlatConfig(configData: ConfigData): Promise<Linter.Fl
);
config.languageOptions = languageOptions;
config.linterOptions = linterOptions;
config.plugins = Object.assign(plugins, config.plugins);
config.plugins = Object.assign(plugins, config.plugins);
config.rules = Object.assign(rules, config.rules);
}
return config;
Expand Down Expand Up @@ -229,9 +229,9 @@ function getLanguage(configData: LanguageConfigData): 'js' | 'ts' | undefined
return 'js';
}

async function importParser(parserName: string): Promise<Linter.ParserModule>
async function importParser(parserName: string): Promise<Linter.Parser>
{
const parser = await import(parserName) as Linter.ParserModule;
const parser = await import(parserName) as Linter.Parser;
return parser;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/normalize-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { inspect } from 'node:util';
import semver from 'semver';

const JS_VERSION_SET =
new Set([5, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024] as const);
new Set([5, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025] as const);

export type JSVersion = typeof JS_VERSION_SET extends Set<infer T> ? T : never;

Expand Down
Loading

0 comments on commit 0922f0f

Please sign in to comment.