diff --git a/.chronus/changes/upgrade-deps-sep-2024-2024-8-13-0-37-48.md b/.chronus/changes/upgrade-deps-sep-2024-2024-8-13-0-37-48.md new file mode 100644 index 0000000000..5dcf0fdf5b --- /dev/null +++ b/.chronus/changes/upgrade-deps-sep-2024-2024-8-13-0-37-48.md @@ -0,0 +1,27 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: dependencies +packages: + - "@typespec/bundler" + - "@typespec/compiler" + - "@typespec/eslint-plugin" + - "@typespec/html-program-viewer" + - "@typespec/http-server-csharp" + - "@typespec/http-server-javascript" + - "@typespec/http" + - "@typespec/internal-build-utils" + - "@typespec/json-schema" + - "@typespec/library-linter" + - "@typespec/openapi" + - "@typespec/openapi3" + - "@typespec/playground" + - "@typespec/prettier-plugin-typespec" + - "@typespec/protobuf" + - "@typespec/rest" + - tmlanguage-generator + - typespec-vscode + - "@typespec/versioning" + - "@typespec/xml" +--- + +Bump dependencies diff --git a/api-extractor.base.json b/api-extractor.base.json index 35ca8d61a8..c5e45a67c7 100644 --- a/api-extractor.base.json +++ b/api-extractor.base.json @@ -18,6 +18,10 @@ "compilerMessageReporting": { "default": { "logLevel": "error" + }, + "TS2552": { + "logLevel": "none", // False positive with non support for 5.6 yet + "addToApiReportFile": false } }, diff --git a/eslint.config.js b/eslint.config.js index 933c7a0986..ec0d351174 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,12 +1,9 @@ // @ts-check import eslint from "@eslint/js"; -import deprecation from "eslint-plugin-deprecation"; import reactHooks from "eslint-plugin-react-hooks"; import unicorn from "eslint-plugin-unicorn"; import vitest from "eslint-plugin-vitest"; -import { dirname } from "path"; import tsEslint from "typescript-eslint"; -import { fileURLToPath } from "url"; /** Config that will apply to all files */ const allFilesConfig = tsEslint.config({ @@ -22,13 +19,23 @@ const allFilesConfig = tsEslint.config({ "@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-interface": "off", + "@typescript-eslint/no-empty-object-type": "off", "@typescript-eslint/no-unused-vars": [ "warn", - { varsIgnorePattern: "^_", argsIgnorePattern: ".*", ignoreRestSiblings: true }, + { + varsIgnorePattern: "^_", + argsIgnorePattern: ".*", + ignoreRestSiblings: true, + caughtErrorsIgnorePattern: ".*", + }, ], // This rule is bugged https://github.com/typescript-eslint/typescript-eslint/issues/6538 "@typescript-eslint/no-misused-promises": "off", + "@typescript-eslint/no-unused-expressions": [ + "warn", + { allowShortCircuit: true, allowTernary: true }, + ], /** * Unicorn @@ -65,21 +72,21 @@ const allFilesConfig = tsEslint.config({ */ export function getTypeScriptProjectRules(root) { return tsEslint.config({ - files: ["**/*.ts", "**/*.tsx"], - ignores: ["packages/http-client-csharp/**/*"], // Ignore isolated modules - plugins: { - deprecation, - }, + files: ["**/packages/*/src/**/*.ts", "**/packages/*/src/**/*.tsx"], + ignores: ["**/packages/http-client-csharp/**/*", "**/packages/http-client-java/**/*"], // Ignore isolated modules + plugins: {}, languageOptions: { parserOptions: { - project: "./tsconfig.json", + projectService: { + allowDefaultProject: ["packages/*/vitest.config.ts"], + }, tsconfigRootDir: root, }, }, rules: { // Only put rules here that need typescript project information "@typescript-eslint/no-floating-promises": "error", - "deprecation/deprecation": ["warn"], + "@typescript-eslint/no-deprecated": "warn", }, }); } @@ -140,5 +147,5 @@ export default tsEslint.config( ], }, ...TypeSpecCommonEslintConfigs, - ...getTypeScriptProjectRules(dirname(fileURLToPath(import.meta.url))) + ...getTypeScriptProjectRules(import.meta.dirname) ); diff --git a/package.json b/package.json index 9efc889da7..377a99714d 100644 --- a/package.json +++ b/package.json @@ -36,38 +36,38 @@ "sync-labels": "tsx ./eng/common/scripts/labels/sync-labels.ts --config ./eng/common/config/labels.ts" }, "devDependencies": { - "@chronus/chronus": "^0.11.0", - "@chronus/github": "^0.4.1", - "@eslint/js": "^8.57.0", - "@microsoft/api-extractor": "^7.47.7", + "@chronus/chronus": "^0.12.1", + "@chronus/github": "^0.4.3", + "@eslint/js": "^9.10.0", + "@microsoft/api-extractor": "^7.47.9", "@octokit/core": "^6.1.2", "@octokit/plugin-paginate-graphql": "^5.2.2", "@octokit/plugin-rest-endpoint-methods": "^13.2.4", "@pnpm/find-workspace-packages": "^6.0.9", "@types/micromatch": "^4.0.9", - "@types/node": "~18.11.19", - "@typescript-eslint/parser": "^7.17.0", - "@typescript-eslint/utils": "^7.17.0", - "@vitest/coverage-v8": "^2.0.4", + "@types/node": "~22.5.4", + "@typescript-eslint/parser": "^8.5.0", + "@typescript-eslint/utils": "^8.5.0", + "@vitest/coverage-v8": "^2.1.0", "c8": "^10.1.2", - "cspell": "^8.12.1", - "eslint": "^8.57.0", + "cspell": "^8.14.2", + "eslint": "^9.10.0", "eslint-plugin-deprecation": "^3.0.0", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-react-hooks": "^4.6.2", - "eslint-plugin-unicorn": "^54.0.0", + "eslint-plugin-import": "^2.30.0", + "eslint-plugin-react-hooks": "^5.1.0-rc-94e652d5-20240912", + "eslint-plugin-unicorn": "^55.0.0", "eslint-plugin-vitest": "^0.5.4", - "micromatch": "^4.0.7", - "picocolors": "~1.0.1", + "micromatch": "^4.0.8", + "picocolors": "~1.1.0", "prettier": "~3.3.3", "prettier-plugin-organize-imports": "~4.0.0", "rimraf": "~6.0.1", - "syncpack": "^12.3.3", - "tsx": "^4.16.2", - "typescript": "~5.5.4", - "typescript-eslint": "^7.17.0", - "vitest": "^2.0.4", - "yaml": "~2.4.5" + "syncpack": "^13.0.0", + "tsx": "^4.19.1", + "typescript": "~5.6.2", + "typescript-eslint": "^8.5.0", + "vitest": "^2.1.0", + "yaml": "~2.5.1" }, "syncpack": { "dependencyTypes": [ diff --git a/packages/best-practices/package.json b/packages/best-practices/package.json index 6d25e70488..deaad58540 100644 --- a/packages/best-practices/package.json +++ b/packages/best-practices/package.json @@ -44,13 +44,13 @@ "@typespec/compiler": "workspace:~" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/bundle-uploader/package.json b/packages/bundle-uploader/package.json index 800c7b739f..4c8cfe64a8 100644 --- a/packages/bundle-uploader/package.json +++ b/packages/bundle-uploader/package.json @@ -37,22 +37,22 @@ "!dist/test/**" ], "dependencies": { - "@azure/identity": "~4.4.0", + "@azure/identity": "~4.4.1", "@azure/storage-blob": "~12.24.0", "@pnpm/find-workspace-packages": "^6.0.9", "@typespec/bundler": "workspace:~", "json5": "^2.2.3", - "picocolors": "~1.0.1", + "picocolors": "~1.1.0", "semver": "^7.6.3" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@types/semver": "^7.5.8", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/bundler/package.json b/packages/bundler/package.json index 377d86b1b9..77f0546132 100644 --- a/packages/bundler/package.json +++ b/packages/bundler/package.json @@ -49,19 +49,19 @@ "@rollup/plugin-node-resolve": "~15.2.3", "@rollup/plugin-virtual": "~3.0.2", "@typespec/compiler": "workspace:~", - "picocolors": "~1.0.1", - "rollup": "~4.19.0", + "picocolors": "~1.1.0", + "rollup": "~4.21.3", "yargs": "~17.7.2" }, "devDependencies": { - "@types/node": "~18.11.19", - "@types/yargs": "~17.0.32", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@types/node": "~22.5.4", + "@types/yargs": "~17.0.33", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vite": "^5.3.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vite": "^5.4.4", + "vitest": "^2.1.0" } } diff --git a/packages/bundler/src/bundler.ts b/packages/bundler/src/bundler.ts index 8661d557f6..4182d6b976 100644 --- a/packages/bundler/src/bundler.ts +++ b/packages/bundler/src/bundler.ts @@ -2,14 +2,7 @@ import commonjs from "@rollup/plugin-commonjs"; import json from "@rollup/plugin-json"; import nodeResolve from "@rollup/plugin-node-resolve"; import virtual from "@rollup/plugin-virtual"; -import { - compile, - getNormalizedAbsolutePath, - joinPaths, - NodeHost, - normalizePath, - resolvePath, -} from "@typespec/compiler"; +import { compile, joinPaths, NodeHost, normalizePath, resolvePath } from "@typespec/compiler"; import { mkdir, readFile, realpath, writeFile } from "fs/promises"; import { basename, join, resolve } from "path"; import { OutputChunk, rollup, RollupBuild, RollupOptions, watch } from "rollup"; @@ -91,7 +84,6 @@ export async function watchTypeSpecBundle( }, }); - // eslint-disable-next-line @typescript-eslint/no-misused-promises watcher.on("event", async (event) => { switch (event.code) { case "BUNDLE_START": @@ -257,7 +249,6 @@ function createBundleEntrypoint({ const relativeTypeSpecFiles: Record = {}; for (const [name, content] of Object.entries(typespecSourceFiles)) { relativeTypeSpecFiles[relativeTo(libraryPath, name)] = content; - getNormalizedAbsolutePath; } return [ `export * from "${absoluteMain}";`, diff --git a/packages/compiler/package.json b/packages/compiler/package.json index caab7d2e7f..098b4b377d 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -87,34 +87,34 @@ "change-case": "~5.4.4", "globby": "~14.0.2", "mustache": "~4.2.0", - "picocolors": "~1.0.1", + "picocolors": "~1.1.0", "prettier": "~3.3.3", "prompts": "~2.4.2", "semver": "^7.6.3", "temporal-polyfill": "^0.2.5", "vscode-languageserver": "~9.0.1", - "vscode-languageserver-textdocument": "~1.0.11", - "yaml": "~2.4.5", + "vscode-languageserver-textdocument": "~1.0.12", + "yaml": "~2.5.1", "yargs": "~17.7.2" }, "devDependencies": { "@types/babel__code-frame": "~7.0.6", "@types/mustache": "~4.2.5", - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@types/prompts": "~2.4.9", "@types/semver": "^7.5.8", - "@types/yargs": "~17.0.32", + "@types/yargs": "~17.0.33", "@typespec/internal-build-utils": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "grammarkdown": "~3.3.2", "rimraf": "~6.0.1", "source-map-support": "~0.5.21", "tmlanguage-generator": "workspace:~", "ts-node": "~10.9.2", - "typescript": "~5.5.4", - "vitest": "^2.0.4", + "typescript": "~5.6.2", + "vitest": "^2.1.0", "vscode-oniguruma": "~2.0.1", "vscode-textmate": "~9.1.0" } diff --git a/packages/compiler/src/core/checker.ts b/packages/compiler/src/core/checker.ts index 4ba4013550..22ef661934 100644 --- a/packages/compiler/src/core/checker.ts +++ b/packages/compiler/src/core/checker.ts @@ -5285,7 +5285,7 @@ export function createChecker(program: Program): Checker { const defaultValue = checkDefaultValue(prop.default, type.type); if (defaultValue !== null) { type.defaultValue = defaultValue; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated type.default = checkLegacyDefault(prop.default); } } diff --git a/packages/compiler/src/core/cli/actions/compile/compile.ts b/packages/compiler/src/core/cli/actions/compile/compile.ts index 5b634aa64c..99c7d8e1f1 100644 --- a/packages/compiler/src/core/cli/actions/compile/compile.ts +++ b/packages/compiler/src/core/cli/actions/compile/compile.ts @@ -161,7 +161,6 @@ function logProgramResult( console.log(); // Insert a newline if (program.emitters.length === 0 && !program.compilerOptions.noEmit) { - // eslint-disable-next-line no-console log( "No emitter was configured, no output was generated. Use `--emit ` to pick emitter or specify it in the TypeSpec config." ); diff --git a/packages/compiler/src/core/cli/actions/compile/watch.ts b/packages/compiler/src/core/cli/actions/compile/watch.ts index 52fc3d37e1..21e77e9ebb 100644 --- a/packages/compiler/src/core/cli/actions/compile/watch.ts +++ b/packages/compiler/src/core/cli/actions/compile/watch.ts @@ -25,7 +25,7 @@ export function createWatcher( function watchFile(file: string): FSWatcher { const watcher = watch( file, - dupFilter((event: WatchEventType, _name: string) => { + dupFilter((event: WatchEventType, _name: string | null) => { onFileChanged(event, file); }) ); @@ -67,8 +67,11 @@ export function createWatchHost(host: CliCompilerHost): WatchHost { } function createDupsFilter() { let memo: Record = {}; - return function (fn: (e: WatchEventType, name: string) => void) { - return function (event: WatchEventType, name: string) { + return function (fn: (e: WatchEventType, name: string | null) => void) { + return function (event: WatchEventType, name: string | null) { + if (name === null) { + return; + } memo[name] = [event, name]; setTimeout(function () { Object.values(memo).forEach((args) => { diff --git a/packages/compiler/src/core/helpers/index.ts b/packages/compiler/src/core/helpers/index.ts index eff952f7f1..1716befcd4 100644 --- a/packages/compiler/src/core/helpers/index.ts +++ b/packages/compiler/src/core/helpers/index.ts @@ -6,7 +6,6 @@ export * from "./projected-names-utils.js"; export { explainStringTemplateNotSerializable, - // eslint-disable-next-line deprecation/deprecation stringTemplateToString, } from "./string-template-utils.js"; export { printIdentifier as formatIdentifier, printIdentifier } from "./syntax-utils.js"; diff --git a/packages/compiler/src/core/index.ts b/packages/compiler/src/core/index.ts index 1166028cef..5f85e245ce 100644 --- a/packages/compiler/src/core/index.ts +++ b/packages/compiler/src/core/index.ts @@ -29,14 +29,12 @@ export { type Discriminator, } from "./intrinsic-type-state.js"; export { - // eslint-disable-next-line deprecation/deprecation createCadlLibrary, createLinterRule as createRule, createTypeSpecLibrary, defineLinter, definePackageFlags, paramMessage, - // eslint-disable-next-line deprecation/deprecation setCadlNamespace, setTypeSpecNamespace, } from "./library.js"; diff --git a/packages/compiler/src/core/library.ts b/packages/compiler/src/core/library.ts index e9041ea85a..e456a82d4a 100644 --- a/packages/compiler/src/core/library.ts +++ b/packages/compiler/src/core/library.ts @@ -142,7 +142,7 @@ function getCaller() { function getCallStack() { const _prepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = (_, stack) => stack; - const stack = (new Error() as any).stack.slice(1); // eslint-disable-line unicorn/error-message + const stack = (new Error() as any).stack.slice(1); Error.prepareStackTrace = _prepareStackTrace; return stack; } diff --git a/packages/compiler/src/core/logger/support-hyperlinks.ts b/packages/compiler/src/core/logger/support-hyperlinks.ts index f261ffbc5e..05274e71bb 100644 --- a/packages/compiler/src/core/logger/support-hyperlinks.ts +++ b/packages/compiler/src/core/logger/support-hyperlinks.ts @@ -49,7 +49,6 @@ export function supportsHyperlink(stream: NodeJS.WriteStream) { case "WezTerm": return version.major >= 20200620; case "vscode": - // eslint-disable-next-line no-mixed-operators return version.major > 1 || (version.major === 1 && version.minor >= 72); // No default } diff --git a/packages/compiler/src/core/path-utils.ts b/packages/compiler/src/core/path-utils.ts index 55e3beeff8..25eb662de6 100644 --- a/packages/compiler/src/core/path-utils.ts +++ b/packages/compiler/src/core/path-utils.ts @@ -601,7 +601,7 @@ export function getRelativePathFromDirectory( fromDirectory: string, to: string, getCanonicalFileName: GetCanonicalFileName -): string; // eslint-disable-line @typescript-eslint/unified-signatures +): string; export function getRelativePathFromDirectory( fromDirectory: string, to: string, diff --git a/packages/compiler/src/core/program.ts b/packages/compiler/src/core/program.ts index c0ec4f9fd8..2e8c661f58 100644 --- a/packages/compiler/src/core/program.ts +++ b/packages/compiler/src/core/program.ts @@ -197,12 +197,12 @@ export async function compile( let emit = options.emit; let emitterOptions = options.options; - /* eslint-disable deprecation/deprecation */ + /* eslint-disable @typescript-eslint/no-deprecated */ if (options.emitters) { emit ??= Object.keys(options.emitters); emitterOptions ??= options.emitters; } - /* eslint-enable deprecation/deprecation */ + /* eslint-enable @typescript-eslint/no-deprecated */ await loadEmitters(basedir, emit ?? [], emitterOptions ?? {}); @@ -439,7 +439,7 @@ export async function compile( const libDefinition: TypeSpecLibrary | undefined = entrypoint?.esmExports.$lib; const metadata = computeLibraryMetadata(module, libDefinition); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated const linterDef = entrypoint?.esmExports.$linter ?? libDefinition?.linter; return { ...resolution, @@ -899,7 +899,7 @@ export async function compile( * Resolve compiler options from input options. */ function resolveOptions(options: CompilerOptions): CompilerOptions { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated const outputDir = options.outputDir ?? options.outputPath; return { ...options, diff --git a/packages/compiler/src/core/projector.ts b/packages/compiler/src/core/projector.ts index 7b96f601a0..6037e3956e 100644 --- a/packages/compiler/src/core/projector.ts +++ b/packages/compiler/src/core/projector.ts @@ -291,7 +291,7 @@ export function createProjector( if (model.templateMapper) { projectedModel.templateMapper = projectTemplateMapper(model.templateMapper); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated projectedModel.templateArguments = mutate(projectedModel.templateMapper.args); } @@ -357,7 +357,7 @@ export function createProjector( if (scalar.templateMapper) { projectedScalar.templateMapper = projectTemplateMapper(scalar.templateMapper); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated projectedScalar.templateArguments = mutate(projectedScalar.templateMapper.args); } @@ -423,7 +423,7 @@ export function createProjector( if (op.templateMapper) { projectedOp.templateMapper = projectTemplateMapper(op.templateMapper); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated projectedOp.templateArguments = mutate(projectedOp.templateMapper.args); } @@ -455,7 +455,7 @@ export function createProjector( if (iface.templateMapper) { projectedIface.templateMapper = projectTemplateMapper(iface.templateMapper); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated projectedIface.templateArguments = mutate(projectedIface.templateMapper.args); } @@ -486,7 +486,7 @@ export function createProjector( if (union.templateMapper) { projectedUnion.templateMapper = projectTemplateMapper(union.templateMapper); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated projectedUnion.templateArguments = mutate(projectedUnion.templateMapper.args); } diff --git a/packages/compiler/src/emitter-framework/type-emitter.ts b/packages/compiler/src/emitter-framework/type-emitter.ts index 75e813626a..07f9c73e39 100644 --- a/packages/compiler/src/emitter-framework/type-emitter.ts +++ b/packages/compiler/src/emitter-framework/type-emitter.ts @@ -877,7 +877,6 @@ export class CodeTypeEmitter> ex let i = 0; for (const v of tuple.values) { i++; - ``; builder.push(code`${this.emitter.emitTypeReference(v)}${i < tuple.values.length ? "," : ""}`); } return builder.reduce(); diff --git a/packages/compiler/src/lib/decorators.ts b/packages/compiler/src/lib/decorators.ts index 90961eca1c..4a98f88ea7 100644 --- a/packages/compiler/src/lib/decorators.ts +++ b/packages/compiler/src/lib/decorators.ts @@ -944,7 +944,7 @@ export const $withoutDefaultValues: WithoutDefaultValuesDecorator = ( ) => { // remove all read-only properties from the target type target.properties.forEach((p) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated delete p.default; delete p.defaultValue; }); @@ -957,7 +957,6 @@ const listPropertiesKey = createStateSymbol("listProperties"); /** * @deprecated Use the `listsResource` decorator in `@typespec/rest` instead. */ -// eslint-disable-next-line deprecation/deprecation export const $list: ListDecorator = ( context: DecoratorContext, target: Operation, @@ -1229,7 +1228,6 @@ export const $withDefaultKeyVisibility: WithDefaultKeyVisibilityDecorator = ( * model Foo {} * ``` */ -// eslint-disable-next-line deprecation/deprecation export const $deprecated: DeprecatedDecorator = ( context: DecoratorContext, target: Type, diff --git a/packages/compiler/src/lib/service.ts b/packages/compiler/src/lib/service.ts index 299d20f658..213e741c61 100644 --- a/packages/compiler/src/lib/service.ts +++ b/packages/compiler/src/lib/service.ts @@ -102,7 +102,7 @@ export const $service: ServiceDecorator = ( versionProp ); if (version.kind === "String") { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated serviceDetails.version = version.value; } else { reportDiagnostic(context.program, { diff --git a/packages/compiler/src/lib/tsp-index.ts b/packages/compiler/src/lib/tsp-index.ts index 2b82bdee65..6046e5ff9e 100644 --- a/packages/compiler/src/lib/tsp-index.ts +++ b/packages/compiler/src/lib/tsp-index.ts @@ -72,7 +72,6 @@ export const $decorators = { minValueExclusive: $minValueExclusive, maxValueExclusive: $maxValueExclusive, secret: $secret, - // eslint-disable-next-line deprecation/deprecation list: $list, tag: $tag, friendlyName: $friendlyName, diff --git a/packages/compiler/src/server/server.ts b/packages/compiler/src/server/server.ts index 48d88a1567..8d5a2c0bee 100644 --- a/packages/compiler/src/server/server.ts +++ b/packages/compiler/src/server/server.ts @@ -161,10 +161,8 @@ function profile any>(func: T): T { return (async (...args: any[]) => { profileSession!.post("Profiler.enable", () => { - // eslint-disable-next-line @typescript-eslint/no-misused-promises profileSession!.post("Profiler.start", async () => { const ret = await func.apply(undefined!, args); - // eslint-disable-next-line @typescript-eslint/no-misused-promises profileSession!.post("Profiler.stop", async (err, args) => { if (!err && args.profile) { await mkdir(profileDir!, { recursive: true }); diff --git a/packages/compiler/src/server/serverlib.ts b/packages/compiler/src/server/serverlib.ts index 9076b332cb..5e69be1eb7 100644 --- a/packages/compiler/src/server/serverlib.ts +++ b/packages/compiler/src/server/serverlib.ts @@ -210,28 +210,28 @@ export function createServer(host: ServerHost): Server { changeNotifications: true, }, }; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated } else if (params.rootUri) { workspaceFolders = [ { name: "", - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated uri: params.rootUri, path: ensureTrailingDirectorySeparator( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated await fileService.fileURLToRealPath(params.rootUri) ), }, ]; - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated } else if (params.rootPath) { workspaceFolders = [ { name: "", - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated uri: compilerHost.pathToFileURL(params.rootPath), path: ensureTrailingDirectorySeparator( - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated await getNormalizedRealPath(compilerHost, params.rootPath) ), }, diff --git a/packages/compiler/src/utils/misc.ts b/packages/compiler/src/utils/misc.ts index 15d3913292..9af69e8b49 100644 --- a/packages/compiler/src/utils/misc.ts +++ b/packages/compiler/src/utils/misc.ts @@ -244,7 +244,6 @@ export function resolveRelativeUrlOrPath(base: string, relativeOrAbsolute: strin * A specially typed version of `Array.isArray` to work around [this issue](https://github.com/microsoft/TypeScript/issues/17002). */ export function isArray( - // eslint-disable-next-line @typescript-eslint/ban-types arg: T | {} ): arg is T extends readonly any[] ? (unknown extends T ? never : readonly any[]) : any[] { return Array.isArray(arg); diff --git a/packages/compiler/test/checker/clone-type.test.ts b/packages/compiler/test/checker/clone-type.test.ts index bb913b0917..066819cb11 100644 --- a/packages/compiler/test/checker/clone-type.test.ts +++ b/packages/compiler/test/checker/clone-type.test.ts @@ -130,9 +130,7 @@ describe("compiler: type cloning", () => { strictEqual(test.kind, "ModelProperty" as const); strictEqual(test.type.kind, "Model" as const); const clone = testHost.program.checker.cloneType(test.type); - // eslint-disable-next-line deprecation/deprecation strictEqual(clone.templateArguments?.length, 2); - // eslint-disable-next-line deprecation/deprecation deepStrictEqual(test.type.templateArguments, clone.templateArguments); deepStrictEqual(test.type.templateMapper, clone.templateMapper); }); diff --git a/packages/compiler/test/checker/model.test.ts b/packages/compiler/test/checker/model.test.ts index 9bcc3d65fa..e0d6c6c800 100644 --- a/packages/compiler/test/checker/model.test.ts +++ b/packages/compiler/test/checker/model.test.ts @@ -212,7 +212,6 @@ describe("compiler: models", () => { ` ); const { foo } = (await testHost.compile("main.tsp")) as { foo: ModelProperty }; - // eslint-disable-next-line deprecation/deprecation expect({ ...foo.default }).toMatchObject(expectedValue); }); @@ -224,7 +223,6 @@ describe("compiler: models", () => { ` ); const { foo } = (await testHost.compile("main.tsp")) as { foo: ModelProperty }; - // eslint-disable-next-line deprecation/deprecation deepStrictEqual(foo.default, undefined); }); @@ -236,7 +234,6 @@ describe("compiler: models", () => { ` ); const { foo } = (await testHost.compile("main.tsp")) as { foo: ModelProperty }; - // eslint-disable-next-line deprecation/deprecation deepStrictEqual(foo.default, undefined); }); }); diff --git a/packages/compiler/test/checker/references.test.ts b/packages/compiler/test/checker/references.test.ts index d954e41926..5b7534afe9 100644 --- a/packages/compiler/test/checker/references.test.ts +++ b/packages/compiler/test/checker/references.test.ts @@ -477,9 +477,7 @@ describe("compiler: references", () => { let linkedValue: Operation | undefined; beforeEach(() => { testHost.addJsFile("./test-link.js", { - $testLink: (_: any, t: any, value: Operation) => { - linkedValue; - }, + $testLink: (_: any, t: any, value: Operation) => {}, }); }); it("defined before", async () => { diff --git a/packages/compiler/test/helpers/string-template-utils.test.ts b/packages/compiler/test/helpers/string-template-utils.test.ts index b950b9d0ed..28348f5445 100644 --- a/packages/compiler/test/helpers/string-template-utils.test.ts +++ b/packages/compiler/test/helpers/string-template-utils.test.ts @@ -12,7 +12,6 @@ describe("compiler: stringTemplateToString (deprecated)", () => { }; strictEqual(value.type.kind, "StringTemplate"); - // eslint-disable-next-line deprecation/deprecation return stringTemplateToString(value.type); } diff --git a/packages/compiler/test/projection/projector-identity.test.ts b/packages/compiler/test/projection/projector-identity.test.ts index 8c038bcd21..466aa7b26f 100644 --- a/packages/compiler/test/projection/projector-identity.test.ts +++ b/packages/compiler/test/projection/projector-identity.test.ts @@ -363,9 +363,7 @@ describe("compiler: projector: Identity", () => { ok(projected.templateMapper !== original.templateMapper); ok(projected.templateMapper.args !== original.templateMapper.args); ok(projected.templateMapper.map !== original.templateMapper.map); - // eslint-disable-next-line deprecation/deprecation ok(projected.templateArguments !== original.templateArguments); - // eslint-disable-next-line deprecation/deprecation ok(projected.templateArguments === projected.templateMapper.args); strictEqual(projected.templateMapper.args.length, original.templateMapper.args.length); strictEqual(projected.templateMapper.map.size, original.templateMapper.map.size); diff --git a/packages/eslint-plugin-typespec/package.json b/packages/eslint-plugin-typespec/package.json index 05c2f4782e..3dd431dbd2 100644 --- a/packages/eslint-plugin-typespec/package.json +++ b/packages/eslint-plugin-typespec/package.json @@ -37,22 +37,22 @@ "!dist/test/**" ], "peerDependencies": { - "eslint": "^8.57.0" + "eslint": "^9.10.0" }, "devDependencies": { - "@types/node": "~18.11.19", - "@typescript-eslint/parser": "^7.17.0", - "@typescript-eslint/rule-tester": "^7.17.0", - "@typescript-eslint/types": "^7.17.0", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@types/node": "~22.5.4", + "@typescript-eslint/parser": "^8.5.0", + "@typescript-eslint/rule-tester": "^8.5.0", + "@typescript-eslint/types": "^8.5.0", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", - "eslint": "^8.57.0", + "eslint": "^9.10.0", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" }, "dependencies": { - "@typescript-eslint/utils": "^7.17.0" + "@typescript-eslint/utils": "^8.5.0" } } diff --git a/packages/eslint-plugin-typespec/src/rules/call-decorator.ts b/packages/eslint-plugin-typespec/src/rules/call-decorator.ts index f9d763a564..12d0ea9ebc 100644 --- a/packages/eslint-plugin-typespec/src/rules/call-decorator.ts +++ b/packages/eslint-plugin-typespec/src/rules/call-decorator.ts @@ -54,7 +54,6 @@ export const callDecoratorRule = createRule({ meta: { docs: { description: "Calling a TypeSpec decorator from JS/TS code should be done with context.call", - recommended: "recommended", }, hasSuggestions: true, messages, diff --git a/packages/eslint-plugin-typespec/test/rules/call-decorator.test.ts b/packages/eslint-plugin-typespec/test/rules/call-decorator.test.ts index b1ccf5ee00..f90434896e 100644 --- a/packages/eslint-plugin-typespec/test/rules/call-decorator.test.ts +++ b/packages/eslint-plugin-typespec/test/rules/call-decorator.test.ts @@ -5,10 +5,11 @@ import { getFixturesRootDir } from "./utils"; const rootDir = getFixturesRootDir(); const ruleTester = new RuleTester({ - parser: "@typescript-eslint/parser", - parserOptions: { - project: "./tsconfig.json", - tsconfigRootDir: rootDir, + languageOptions: { + parserOptions: { + project: "./tsconfig.json", + tsconfigRootDir: rootDir, + }, }, }); diff --git a/packages/html-program-viewer/package.json b/packages/html-program-viewer/package.json index 70b725b149..13cd4f1a80 100644 --- a/packages/html-program-viewer/package.json +++ b/packages/html-program-viewer/package.json @@ -52,32 +52,32 @@ "@typespec/compiler": "workspace:~" }, "dependencies": { - "@fluentui/react-components": "~9.54.5", - "@fluentui/react-icons": "^2.0.249", - "@fluentui/react-list-preview": "^0.3.1", + "@fluentui/react-components": "~9.54.15", + "@fluentui/react-icons": "^2.0.258", + "@fluentui/react-list-preview": "^0.3.6", "react": "~18.3.1", "react-dom": "~18.3.1", - "react-hotkeys-hook": "^4.5.0" + "react-hotkeys-hook": "^4.5.1" }, "devDependencies": { - "@babel/core": "^7.24.9", + "@babel/core": "^7.25.2", "@testing-library/dom": "^10.4.0", - "@testing-library/jest-dom": "^6.4.7", - "@testing-library/react": "^16.0.0", - "@types/node": "~18.11.19", - "@types/react": "~18.3.3", + "@testing-library/jest-dom": "^6.5.0", + "@testing-library/react": "^16.0.1", + "@types/node": "~22.5.4", + "@types/react": "~18.3.5", "@types/react-dom": "~18.3.0", "@typespec/compiler": "workspace:~", "@typespec/react-components": "workspace:~", "@vitejs/plugin-react": "~4.3.1", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vite": "^5.3.4", - "vite-plugin-checker": "^0.7.2", - "vite-plugin-dts": "4.0.0-beta.1", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vite": "^5.4.4", + "vite-plugin-checker": "^0.8.0", + "vite-plugin-dts": "4.2.1", + "vitest": "^2.1.0" } } diff --git a/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts b/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts index 361652d4eb..7374db298f 100644 --- a/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts @@ -46,7 +46,6 @@ op test(@body input: Pet): Pet; `, runner ); - runner.compileAndDiagnose; const context = createEmitterContext(program); const sdkContext = await createNetSdkContext(context); const root = createModel(sdkContext); @@ -343,7 +342,6 @@ op op5(@body body: ExtendsFooArray): ExtendsFooArray; `, runner ); - runner.compileAndDiagnose; const context = createEmitterContext(program); const sdkContext = await createNetSdkContext(context); const root = createModel(sdkContext); @@ -436,7 +434,6 @@ op op5(@body body: IsFooArray): IsFooArray; `, runner ); - runner.compileAndDiagnose; const context = createEmitterContext(program); const sdkContext = await createNetSdkContext(context); const root = createModel(sdkContext); @@ -488,7 +485,6 @@ op op1(): void; runner, { IsTCGCNeeded: true } ); - runner.compileAndDiagnose; const context = createEmitterContext(program); const sdkContext = await createNetSdkContext(context); const root = createModel(sdkContext); diff --git a/packages/http-client-csharp/emitter/test/Unit/property-type.test.ts b/packages/http-client-csharp/emitter/test/Unit/property-type.test.ts index 397255c309..d7846a1a61 100644 --- a/packages/http-client-csharp/emitter/test/Unit/property-type.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/property-type.test.ts @@ -24,7 +24,6 @@ describe("Test GetInputType for array", () => { `, runner ); - runner.compileAndDiagnose; const context = createEmitterContext(program); const sdkContext = await createNetSdkContext(context); const root = createModel(sdkContext); diff --git a/packages/http-client-csharp/emitter/test/Unit/scalar.test.ts b/packages/http-client-csharp/emitter/test/Unit/scalar.test.ts index 8d30025980..197cfba331 100644 --- a/packages/http-client-csharp/emitter/test/Unit/scalar.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/scalar.test.ts @@ -24,7 +24,6 @@ describe("Test GetInputType for scalar", () => { runner, { IsNamespaceNeeded: true, IsAzureCoreNeeded: true } ); - runner.compileAndDiagnose; const context = createEmitterContext(program); const sdkContext = await createNetSdkContext(context); const root = createModel(sdkContext); diff --git a/packages/http-server-csharp/package.json b/packages/http-server-csharp/package.json index 69fa2a7500..7087891a33 100644 --- a/packages/http-server-csharp/package.json +++ b/packages/http-server-csharp/package.json @@ -52,26 +52,26 @@ ], "peerDependencies": { "@typespec/compiler": "workspace:~", - "@typespec/rest": "workspace:~", "@typespec/http": "workspace:~", + "@typespec/rest": "workspace:~", "@typespec/versioning": "workspace:~" }, "dependencies": { "change-case": "~5.4.4" }, "devDependencies": { + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", - "@typespec/openapi": "workspace:~", - "@typespec/rest": "workspace:~", "@typespec/http": "workspace:~", - "@types/node": "~18.11.19", "@typespec/library-linter": "workspace:~", + "@typespec/openapi": "workspace:~", + "@typespec/rest": "workspace:~", "@typespec/tspd": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/http-server-csharp/src/interfaces.ts b/packages/http-server-csharp/src/interfaces.ts index d67750671d..e896a6cd92 100644 --- a/packages/http-server-csharp/src/interfaces.ts +++ b/packages/http-server-csharp/src/interfaces.ts @@ -101,7 +101,7 @@ export class NumericValue extends CSharpValue { this.value = value; } public emitValue(scope?: Scope | undefined): string { - return `${this.value}` ?? "0"; + return `${this.value ?? 0}`; } } @@ -112,7 +112,7 @@ export class BooleanValue extends CSharpValue { this.value = value; } public emitValue(scope?: Scope | undefined): string { - return `${this.value}` ?? false; + return `${this.value}`; } } diff --git a/packages/http-server-csharp/src/service.ts b/packages/http-server-csharp/src/service.ts index f144e4a024..f4ab9b239a 100644 --- a/packages/http-server-csharp/src/service.ts +++ b/packages/http-server-csharp/src/service.ts @@ -30,7 +30,6 @@ import { EmitEntity, EmittedSourceFile, EmitterOutput, - Placeholder, Scope, SourceFile, StringBuilder, @@ -306,9 +305,9 @@ export async function $onEmit(context: EmitContext) const [typeName, typeDefault] = this.#findPropertyType(property); const doc = getDoc(this.emitter.getProgram(), property); const attributes = getModelAttributes(this.emitter.getProgram(), property); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated const defaultValue = property.default - ? // eslint-disable-next-line deprecation/deprecation + ? // eslint-disable-next-line @typescript-eslint/no-deprecated code`${this.emitter.emitType(property.default)}` : typeDefault; return this.emitter.result @@ -772,9 +771,9 @@ export async function $onEmit(context: EmitContext) NameCasingType.Parameter ); const [emittedType, emittedDefault] = this.#findPropertyType(parameter); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated const defaultValue = parameter.default - ? // eslint-disable-next-line deprecation/deprecation + ? // eslint-disable-next-line @typescript-eslint/no-deprecated code`${this.emitter.emitType(parameter.default)}` : emittedDefault; return this.emitter.result.rawCode( @@ -884,6 +883,7 @@ export async function $onEmit(context: EmitContext) return context; } + // eslint-disable-next-line no-unused-private-class-members #getNamespaceFullName(namespace: Namespace | undefined): string { return namespace ? ensureCSharpIdentifier( @@ -909,8 +909,6 @@ export async function $onEmit(context: EmitContext) } scalarDeclaration(scalar: Scalar, name: string): EmitterOutput { - const foo: Placeholder = new Placeholder(); - foo.setValue; const scalarType = getCSharpTypeForScalar(this.emitter.getProgram(), scalar); return scalarType.getTypeReference(this.emitter.getContext().scope); } @@ -997,6 +995,8 @@ export async function $onEmit(context: EmitContext) return current; } + // TODO: remove? + // eslint-disable-next-line no-unused-private-class-members #getTemplateParameters(model: Model): EmitterOutput { if (!model.templateMapper) return ""; let i = 0; diff --git a/packages/http-server-javascript/package.json b/packages/http-server-javascript/package.json index 9b2c553846..5258be2569 100644 --- a/packages/http-server-javascript/package.json +++ b/packages/http-server-javascript/package.json @@ -46,10 +46,10 @@ "prettier": "~3.3.3" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", "@typespec/http": "workspace:~", - "tsx": "^4.16.2", - "typescript": "~5.5.4" + "tsx": "^4.19.1", + "typescript": "~5.6.2" } } diff --git a/packages/http-server-javascript/src/http/server/index.ts b/packages/http-server-javascript/src/http/server/index.ts index 7549b030e0..37c456caa4 100644 --- a/packages/http-server-javascript/src/http/server/index.ts +++ b/packages/http-server-javascript/src/http/server/index.ts @@ -282,6 +282,7 @@ function* emitRawServerOperation( yield ` const result = await operations.${operationNameCase.camelCase}(ctx, `; yield* indent(indent(paramLines)); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions yield ` );`, yield ""; yield* indent(emitResultProcessing(ctx, op.returnType, module)); diff --git a/packages/http/package.json b/packages/http/package.json index 7c7d422d1a..0a5ab626c5 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -56,15 +56,15 @@ "@typespec/compiler": "workspace:~" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", "@typespec/library-linter": "workspace:~", "@typespec/tspd": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/http/src/decorators.ts b/packages/http/src/decorators.ts index c9d0e9a0e1..051882f706 100644 --- a/packages/http/src/decorators.ts +++ b/packages/http/src/decorators.ts @@ -151,10 +151,10 @@ export const $query: QueryDecorator = ( if ( entity.type.kind === "Model" && isArrayModelType(context.program, entity.type) && - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated options.format === undefined ) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated options.format = userOptions.explode ? "multi" : "csv"; } context.program.stateMap(HttpStateKeys.query).set(entity, options); @@ -249,7 +249,7 @@ export const $statusCode: StatusCodeDecorator = ( ) => { context.program.stateSet(HttpStateKeys.statusCode).add(entity); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated setLegacyStatusCodeState(context, entity); }; diff --git a/packages/http/src/types.ts b/packages/http/src/types.ts index e7c6f12090..3300c61a5e 100644 --- a/packages/http/src/types.ts +++ b/packages/http/src/types.ts @@ -21,7 +21,6 @@ export type OperationDetails = HttpOperation; export type HttpVerb = "get" | "put" | "post" | "patch" | "delete" | "head"; /** @deprecated use Authentication */ -// eslint-disable-next-line @typescript-eslint/no-unused-vars export type ServiceAuthentication = Authentication; export interface Authentication { @@ -433,7 +432,7 @@ export interface RoutePath { export interface HttpOperationResponse { /** @deprecated use {@link statusCodes} */ - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated statusCode: StatusCode; /** diff --git a/packages/http/test/http-decorators.test.ts b/packages/http/test/http-decorators.test.ts index 9a8a07c54c..f6f95e43ee 100644 --- a/packages/http/test/http-decorators.test.ts +++ b/packages/http/test/http-decorators.test.ts @@ -1181,7 +1181,6 @@ describe("http: decorators", () => { @test op testPatch(): void; `); deepStrictEqual( - // eslint-disable-next-line deprecation/deprecation getRequestVisibility("patch"), resolveRequestVisibility(runner.program, testPatch as Operation, "patch") ); @@ -1193,7 +1192,6 @@ describe("http: decorators", () => { @patch @test op testPatch(): void; `); - // eslint-disable-next-line deprecation/deprecation deepStrictEqual(getRequestVisibility("patch"), Visibility.Update | Visibility.Patch); deepStrictEqual( resolveRequestVisibility(runner.program, testPatch as Operation, "patch"), diff --git a/packages/internal-build-utils/package.json b/packages/internal-build-utils/package.json index fa528b9404..c64fea9a9d 100644 --- a/packages/internal-build-utils/package.json +++ b/packages/internal-build-utils/package.json @@ -41,21 +41,21 @@ ], "dependencies": { "@pnpm/find-workspace-packages": "^6.0.9", - "cspell": "^8.12.1", + "cspell": "^8.14.2", "semver": "^7.6.3", "strip-json-comments": "~5.0.1", "yargs": "~17.7.2" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@types/semver": "^7.5.8", - "@types/yargs": "~17.0.32", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@types/yargs": "~17.0.33", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", - "chokidar": "~3.6.0", + "chokidar": "~4.0.0", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/json-schema/package.json b/packages/json-schema/package.json index b1b1bb11aa..663df42247 100644 --- a/packages/json-schema/package.json +++ b/packages/json-schema/package.json @@ -55,21 +55,21 @@ "@typespec/compiler": "workspace:~" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", "@typespec/internal-build-utils": "workspace:~", "@typespec/library-linter": "workspace:~", "@typespec/tspd": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "ajv": "~8.17.1", "ajv-formats": "~3.0.1", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" }, "dependencies": { - "yaml": "~2.4.5" + "yaml": "~2.5.1" } } diff --git a/packages/json-schema/src/json-schema-emitter.ts b/packages/json-schema/src/json-schema-emitter.ts index 9364e2570a..edb7d57efc 100644 --- a/packages/json-schema/src/json-schema-emitter.ts +++ b/packages/json-schema/src/json-schema-emitter.ts @@ -77,7 +77,6 @@ import { JSONSchemaEmitterOptions, reportDiagnostic } from "./lib.js"; export class JsonSchemaEmitter extends TypeEmitter, JSONSchemaEmitterOptions> { #idDuplicateTracker = new DuplicateTracker(); #typeForSourceFile = new Map, JsonSchemaDeclaration>(); - #refToDecl = new Map>>(); modelDeclaration(model: Model, name: string): EmitterOutput { const schema = this.#initializeSchema(model, name, { @@ -169,9 +168,9 @@ export class JsonSchemaEmitter extends TypeEmitter, JSONSche const result = new ObjectBuilder(propertyType.value); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated if (property.default) { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated result.default = this.#getDefaultValue(property.type, property.default); } diff --git a/packages/library-linter/package.json b/packages/library-linter/package.json index 5c4e5d095c..62c4663220 100644 --- a/packages/library-linter/package.json +++ b/packages/library-linter/package.json @@ -51,13 +51,13 @@ "@typespec/compiler": "workspace:~" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/monarch/package.json b/packages/monarch/package.json index 5488d3949d..c716c0e217 100644 --- a/packages/monarch/package.json +++ b/packages/monarch/package.json @@ -42,16 +42,16 @@ "!dist/test/**" ], "devDependencies": { - "@types/node": "~18.11.19", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@types/node": "~22.5.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", - "happy-dom": "^14.12.3", + "happy-dom": "^15.7.4", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" }, "dependencies": { - "monaco-editor-core": "^0.50.0" + "monaco-editor-core": "^0.51.0" } } diff --git a/packages/openapi/package.json b/packages/openapi/package.json index 7d8f7b1660..1ccc067496 100644 --- a/packages/openapi/package.json +++ b/packages/openapi/package.json @@ -57,17 +57,17 @@ "@typespec/http": "workspace:~" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", "@typespec/http": "workspace:~", "@typespec/library-linter": "workspace:~", "@typespec/rest": "workspace:~", "@typespec/tspd": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/openapi/src/decorators.ts b/packages/openapi/src/decorators.ts index b481cb94ad..6db5da9112 100644 --- a/packages/openapi/src/decorators.ts +++ b/packages/openapi/src/decorators.ts @@ -125,7 +125,7 @@ export const $defaultResponse: DefaultResponseDecorator = ( context: DecoratorContext, entity: Model ) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated setStatusCode(context.program, entity, ["*"]); context.program.stateSet(defaultResponseKey).add(entity); }; @@ -204,7 +204,7 @@ export function resolveInfo(program: Program, entity: Namespace): AdditionalInfo return omitUndefined({ ...info, title: info?.title ?? service?.title, - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated version: info?.version ?? service?.version, summary: info?.summary ?? getSummary(program, entity), description: info?.description ?? getDoc(program, entity), diff --git a/packages/openapi3/package.json b/packages/openapi3/package.json index 284c0b6e58..3c3167869a 100644 --- a/packages/openapi3/package.json +++ b/packages/openapi3/package.json @@ -58,7 +58,7 @@ ], "dependencies": { "@readme/openapi-parser": "~2.6.0", - "yaml": "~2.4.5" + "yaml": "~2.5.1" }, "peerDependencies": { "@typespec/compiler": "workspace:~", @@ -67,8 +67,8 @@ "@typespec/versioning": "workspace:~" }, "devDependencies": { - "@types/node": "~18.11.19", - "@types/yargs": "~17.0.32", + "@types/node": "~22.5.4", + "@types/yargs": "~17.0.33", "@typespec/compiler": "workspace:~", "@typespec/http": "workspace:~", "@typespec/library-linter": "workspace:~", @@ -76,12 +76,12 @@ "@typespec/rest": "workspace:~", "@typespec/tspd": "workspace:~", "@typespec/versioning": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "cross-env": "~7.0.3", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/openapi3/src/openapi.ts b/packages/openapi3/src/openapi.ts index 1c79edfb62..14d6bab258 100644 --- a/packages/openapi3/src/openapi.ts +++ b/packages/openapi3/src/openapi.ts @@ -1243,7 +1243,7 @@ function createOAPIEmitter( result.push(params.get(httpOpParam.param)); continue; } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated if (httpOpParam.type === "header" && isContentTypeHeader(program, httpOpParam.param)) { continue; } @@ -1462,6 +1462,7 @@ function createOAPIEmitter( attributes.explode = false; } + // eslint-disable-next-line @typescript-eslint/no-deprecated switch (parameter.format) { case "ssv": return { style: "spaceDelimited", explode: false }; @@ -1480,6 +1481,7 @@ function createOAPIEmitter( code: "invalid-format", format: { paramType: "query", + // eslint-disable-next-line @typescript-eslint/no-deprecated value: parameter.format, }, target: parameter.param, diff --git a/packages/openapi3/src/schema-emitter.ts b/packages/openapi3/src/schema-emitter.ts index 36a2993220..79a3649e8a 100644 --- a/packages/openapi3/src/schema-emitter.ts +++ b/packages/openapi3/src/schema-emitter.ts @@ -77,7 +77,12 @@ import { applyEncoding } from "./encoding.js"; import { OpenAPI3EmitterOptions, reportDiagnostic } from "./lib.js"; import { ResolvedOpenAPI3EmitterOptions } from "./openapi.js"; import { getSchemaForStdScalars } from "./std-scalar-schemas.js"; -import { OpenAPI3Discriminator, OpenAPI3Schema, OpenAPI3SchemaProperty } from "./types.js"; +import { + JsonType, + OpenAPI3Discriminator, + OpenAPI3Schema, + OpenAPI3SchemaProperty, +} from "./types.js"; import { VisibilityUsageTracker } from "./visibility-usage.js"; /** @@ -441,7 +446,7 @@ export class OpenAPI3SchemaEmitter extends TypeEmitter< return {}; } - const enumTypes = new Set(); + const enumTypes = new Set(); const enumValues = new Set(); for (const member of en.members.values()) { enumTypes.add(typeof member.value === "number" ? "number" : "string"); @@ -452,7 +457,10 @@ export class OpenAPI3SchemaEmitter extends TypeEmitter< reportDiagnostic(program, { code: "enum-unique-type", target: en }); } - const schema: OpenAPI3Schema = { type: enumTypes.values().next().value, enum: [...enumValues] }; + const schema: OpenAPI3Schema = { + type: enumTypes.values().next().value!, + enum: [...enumValues], + }; return this.#applyConstraints(en, schema); } @@ -850,36 +858,6 @@ export class OpenAPI3SchemaEmitter extends TypeEmitter< ): OpenAPI3Schema { return applyEncoding(this.emitter.getProgram(), typespecType, target as any, this.#options); } - #mergeFormatAndEncoding( - format: string | undefined, - encoding: string | undefined, - encodeAsFormat: string | undefined - ): string | undefined { - switch (format) { - case undefined: - return encodeAsFormat ?? encoding ?? format; - case "date-time": - switch (encoding) { - case "rfc3339": - return "date-time"; - case "unixTimestamp": - return "unixtime"; - case "rfc7231": - return "http-date"; - default: - return encoding; - } - case "duration": - switch (encoding) { - case "ISO8601": - return "duration"; - default: - return encodeAsFormat ?? encoding; - } - default: - return encodeAsFormat ?? encoding; - } - } intrinsic(intrinsic: IntrinsicType, name: string): EmitterOutput { switch (name) { diff --git a/packages/openapi3/test/output-file.test.ts b/packages/openapi3/test/output-file.test.ts index cb5f1c1ad1..4f97fc451d 100644 --- a/packages/openapi3/test/output-file.test.ts +++ b/packages/openapi3/test/output-file.test.ts @@ -104,35 +104,32 @@ describe("openapi3: output file", () => { describe("multiple outputs", () => { (["json", "yaml"] as const).forEach((fileType) => { describe(`when file-type is ${fileType}`, () => { - it("create distinct files for distinct services", () => { - async () => { - await compileOpenAPI( - { "file-type": fileType }, - ` + it("create distinct files for distinct services", async () => { + await compileOpenAPI( + { "file-type": fileType }, + ` @service namespace Service1 {} @service namespace Service2 {} ` - ); - - expectHasOutput(`custom.Service1.${fileType}`); - expectHasOutput(`custom.Service2.${fileType}`); - }; + ); + expectHasOutput(`openapi.Service1.${fileType}`); + expectHasOutput(`openapi.Service2.${fileType}`); }); - it("create distinct files for distinct versions", () => { - async () => { - await compileOpenAPI( - {}, - ` - @versioned(Versions) namespace Service1 { + it("create distinct files for distinct versions", async () => { + await compileOpenAPI( + { "file-type": fileType }, + ` + using Versioning; + + @versioned(Versions) @service namespace Service1 { enum Versions {v1, v2} } ` - ); + ); - expectHasOutput(`custom.v1.${fileType}`); - expectHasOutput(`custom.v2.${fileType}`); - }; + expectHasOutput(`openapi.v1.${fileType}`); + expectHasOutput(`openapi.v2.${fileType}`); }); }); }); diff --git a/packages/openapi3/test/tsp-openapi3/utils/spec-snapshot-testing.ts b/packages/openapi3/test/tsp-openapi3/utils/spec-snapshot-testing.ts index fb432ef0ba..af73110455 100644 --- a/packages/openapi3/test/tsp-openapi3/utils/spec-snapshot-testing.ts +++ b/packages/openapi3/test/tsp-openapi3/utils/spec-snapshot-testing.ts @@ -9,7 +9,7 @@ import { import { fail, ok, strictEqual } from "assert"; import { readdirSync } from "fs"; import { mkdir, readFile, readdir, rm, writeFile } from "fs/promises"; -import { File, Suite, afterAll, beforeAll, it } from "vitest"; +import { RunnerTestFile, RunnerTestSuite, afterAll, beforeAll, it } from "vitest"; import { convertAction } from "../../../src/cli/actions/convert/convert-file.js"; const shouldUpdateSnapshots = process.env.RECORD === "true"; @@ -40,7 +40,7 @@ export function defineSpecSnaphotTests(config: SpecSnapshotTestOptions) { existingSnapshots = await readFilesInDirRecursively(config.outputDir); }); - afterAll(async function (context: Readonly) { + afterAll(async function (context: Readonly) { if (context.tasks.some((x) => x.mode === "skip")) { return; // Not running the full test suite, so don't bother checking snapshots. } diff --git a/packages/playground-website/package.json b/packages/playground-website/package.json index 7a4e51eec5..159653d9df 100644 --- a/packages/playground-website/package.json +++ b/packages/playground-website/package.json @@ -53,8 +53,8 @@ "!dist/test/**" ], "dependencies": { - "@fluentui/react-components": "~9.54.5", - "@fluentui/react-icons": "^2.0.249", + "@fluentui/react-components": "~9.54.15", + "@fluentui/react-icons": "^2.0.258", "@typespec/compiler": "workspace:~", "@typespec/html-program-viewer": "workspace:~", "@typespec/http": "workspace:~", @@ -70,23 +70,23 @@ "react-dom": "~18.3.1" }, "devDependencies": { - "@babel/core": "^7.24.9", - "@playwright/test": "^1.45.3", + "@babel/core": "^7.25.2", + "@playwright/test": "^1.47.0", "@types/debounce": "~1.2.4", - "@types/node": "~18.11.19", - "@types/react": "~18.3.3", + "@types/node": "~22.5.4", + "@types/react": "~18.3.5", "@types/react-dom": "~18.3.0", "@types/swagger-ui": "~3.52.4", "@vitejs/plugin-react": "~4.3.1", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "cross-env": "~7.0.3", "rimraf": "~6.0.1", "rollup-plugin-visualizer": "~5.12.0", - "typescript": "~5.5.4", - "vite": "^5.3.4", - "vite-plugin-dts": "4.0.0-beta.1", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vite": "^5.4.4", + "vite-plugin-dts": "4.2.1", + "vitest": "^2.1.0" } } diff --git a/packages/playground/package.json b/packages/playground/package.json index 1da8b7077d..de6b31a493 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -74,8 +74,8 @@ "!dist/test/**" ], "dependencies": { - "@fluentui/react-components": "~9.54.5", - "@fluentui/react-icons": "^2.0.249", + "@fluentui/react-components": "~9.54.15", + "@fluentui/react-icons": "^2.0.258", "@typespec/bundler": "workspace:~", "@typespec/compiler": "workspace:~", "@typespec/html-program-viewer": "workspace:~", @@ -86,7 +86,7 @@ "@typespec/rest": "workspace:~", "@typespec/versioning": "workspace:~", "clsx": "^2.1.1", - "debounce": "~2.1.0", + "debounce": "~2.1.1", "lzutf8": "0.6.3", "monaco-editor": "~0.46.0", "react": "~18.3.1", @@ -94,20 +94,20 @@ "react-error-boundary": "^4.0.13", "swagger-ui-dist": "^5.17.14", "vscode-languageserver": "~9.0.1", - "vscode-languageserver-textdocument": "~1.0.11" + "vscode-languageserver-textdocument": "~1.0.12" }, "devDependencies": { - "@babel/core": "^7.24.9", - "@playwright/test": "^1.45.3", - "@storybook/addon-actions": "^8.2.5", - "@storybook/cli": "^8.2.5", - "@storybook/react": "^8.2.5", - "@storybook/react-vite": "^8.2.5", - "@storybook/test": "^8.2.5", - "@storybook/types": "^8.2.5", + "@babel/core": "^7.25.2", + "@playwright/test": "^1.47.0", + "@storybook/addon-actions": "^8.3.0", + "@storybook/cli": "^8.3.0", + "@storybook/react": "^8.3.0", + "@storybook/react-vite": "^8.3.0", + "@storybook/test": "^8.3.0", + "@storybook/types": "^8.3.0", "@types/debounce": "~1.2.4", - "@types/node": "~18.11.19", - "@types/react": "~18.3.3", + "@types/node": "~22.5.4", + "@types/react": "~18.3.5", "@types/react-dom": "~18.3.0", "@types/swagger-ui-dist": "~3.30.5", "@typespec/bundler": "workspace:~", @@ -117,9 +117,9 @@ "cross-env": "~7.0.3", "es-module-shims": "~1.10.0", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vite": "^5.3.4", - "vite-plugin-checker": "^0.7.2", - "vite-plugin-dts": "4.0.0-beta.1" + "typescript": "~5.6.2", + "vite": "^5.4.4", + "vite-plugin-checker": "^0.8.0", + "vite-plugin-dts": "4.2.1" } } diff --git a/packages/playground/src/react/settings/linter-form.tsx b/packages/playground/src/react/settings/linter-form.tsx index 7aa2bec9f7..024d4e87ec 100644 --- a/packages/playground/src/react/settings/linter-form.tsx +++ b/packages/playground/src/react/settings/linter-form.tsx @@ -15,7 +15,7 @@ export const LinterForm: FunctionComponent = ({ onLinterRuleSetChanged, }) => { const rulesets = Object.values(libraries).flatMap((lib) => { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated const linter = lib.linter ?? lib.definition?.linter; return Object.keys(linter?.ruleSets ?? {}).map((x) => `${lib.name}/${x}`) as RuleRef[]; }); diff --git a/packages/playground/src/services.ts b/packages/playground/src/services.ts index 5cd846032d..caa231a441 100644 --- a/packages/playground/src/services.ts +++ b/packages/playground/src/services.ts @@ -165,7 +165,7 @@ export async function registerMonacoLanguage(host: BrowserHost) { } function monacoHover(hover: lsp.Hover): monaco.languages.Hover { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated if (Array.isArray(hover.contents) || lsp.MarkedString.is(hover.contents)) { throw new Error("MarkedString (deprecated) not supported."); } diff --git a/packages/playground/tsconfig.json b/packages/playground/tsconfig.json index e3745a8d73..fe3eb5f068 100644 --- a/packages/playground/tsconfig.json +++ b/packages/playground/tsconfig.json @@ -14,6 +14,7 @@ "jsx": "react-jsx", "lib": ["DOM"] }, + "references": [{ "path": "../compiler/tsconfig.json" }], "include": [ ".storybook/**/*.ts", ".storybook/**/*.tsx", diff --git a/packages/prettier-plugin-typespec/package.json b/packages/prettier-plugin-typespec/package.json index e2317a9288..ec9e9d205f 100644 --- a/packages/prettier-plugin-typespec/package.json +++ b/packages/prettier-plugin-typespec/package.json @@ -21,8 +21,8 @@ "@rollup/plugin-replace": "~5.0.7", "@typespec/compiler": "workspace:~", "@typespec/internal-build-utils": "workspace:~", - "rollup": "~4.19.0", - "vitest": "^2.0.4" + "rollup": "~4.21.3", + "vitest": "^2.1.0" }, "files": [ "dist/**/*", diff --git a/packages/protobuf/package.json b/packages/protobuf/package.json index 93c5121b53..2b130cbb20 100644 --- a/packages/protobuf/package.json +++ b/packages/protobuf/package.json @@ -41,15 +41,15 @@ }, "devDependencies": { "@types/micromatch": "^4.0.9", - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", "@typespec/tspd": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", - "micromatch": "^4.0.7", + "micromatch": "^4.0.8", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/protobuf/src/transform/index.ts b/packages/protobuf/src/transform/index.ts index 1d506a9ebf..0c11e26f32 100644 --- a/packages/protobuf/src/transform/index.ts +++ b/packages/protobuf/src/transform/index.ts @@ -680,7 +680,7 @@ function tspToProto(program: Program, emitterOptions: ProtobufEmitterOptions): P reportDiagnostic(program, { code: "namespace-collision", format: { - name: `"${file.package}"` ?? "", + name: file.package ? `"${file.package}"` : "", }, target: file.source, }); diff --git a/packages/react-components/package.json b/packages/react-components/package.json index 29e5255f6c..6672cdc9ab 100644 --- a/packages/react-components/package.json +++ b/packages/react-components/package.json @@ -45,28 +45,28 @@ "!dist/test/**" ], "dependencies": { - "@fluentui/react-components": "~9.54.5", - "@fluentui/react-icons": "^2.0.249", + "@fluentui/react-components": "~9.54.15", + "@fluentui/react-icons": "^2.0.258", "react": "~18.3.1", "react-dom": "~18.3.1" }, "devDependencies": { - "@babel/core": "^7.24.9", + "@babel/core": "^7.25.2", "@testing-library/dom": "^10.4.0", - "@testing-library/jest-dom": "^6.4.7", - "@testing-library/react": "^16.0.0", - "@types/node": "~18.11.19", - "@types/react": "~18.3.3", + "@testing-library/jest-dom": "^6.5.0", + "@testing-library/react": "^16.0.1", + "@types/node": "~22.5.4", + "@types/react": "~18.3.5", "@types/react-dom": "~18.3.0", "@vitejs/plugin-react": "~4.3.1", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vite": "^5.3.4", - "vite-plugin-checker": "^0.7.2", - "vite-plugin-dts": "4.0.0-beta.1", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vite": "^5.4.4", + "vite-plugin-checker": "^0.8.0", + "vite-plugin-dts": "4.2.1", + "vitest": "^2.1.0" } } diff --git a/packages/rest/package.json b/packages/rest/package.json index e703922de8..a5dba11408 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -56,16 +56,16 @@ "@typespec/http": "workspace:~" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", "@typespec/http": "workspace:~", "@typespec/library-linter": "workspace:~", "@typespec/tspd": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/samples/package.json b/packages/samples/package.json index a47c55f8e9..a373253796 100644 --- a/packages/samples/package.json +++ b/packages/samples/package.json @@ -55,14 +55,14 @@ "@typespec/versioning": "workspace:~" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/internal-build-utils": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "autorest": "~3.7.1", "cross-env": "~7.0.3", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/samples/specs/rest-metadata-emitter/rest-metadata-emitter-sample.ts b/packages/samples/specs/rest-metadata-emitter/rest-metadata-emitter-sample.ts index 703986e01f..86ae7a5a2c 100644 --- a/packages/samples/specs/rest-metadata-emitter/rest-metadata-emitter-sample.ts +++ b/packages/samples/specs/rest-metadata-emitter/rest-metadata-emitter-sample.ts @@ -52,7 +52,6 @@ export async function $onEmit(context: EmitContext): Promise { projectedProgram, serviceNamespace, details?.title, - // eslint-disable-next-line deprecation/deprecation versionProjection.version ?? details?.version ); } @@ -137,7 +136,6 @@ export async function $onEmit(context: EmitContext): Promise { function emitResponses(responses: HttpOperationResponse[]) { for (const response of responses) { for (const content of response.responses) { - // eslint-disable-next-line deprecation/deprecation writeLine(`response: ${response.statusCode}${getContentTypeRemark(content.body)}`); indent(); diff --git a/packages/samples/src/sample-snapshot-testing.ts b/packages/samples/src/sample-snapshot-testing.ts index d2b3656e33..ca53f05de7 100644 --- a/packages/samples/src/sample-snapshot-testing.ts +++ b/packages/samples/src/sample-snapshot-testing.ts @@ -13,7 +13,7 @@ import { expectDiagnosticEmpty } from "@typespec/compiler/testing"; import { fail, ok, strictEqual } from "assert"; import { readdirSync } from "fs"; import { mkdir, readFile, readdir, rm, writeFile } from "fs/promises"; -import { File, Suite, afterAll, beforeAll, it } from "vitest"; +import { RunnerTestFile, RunnerTestSuite, afterAll, beforeAll, it } from "vitest"; const shouldUpdateSnapshots = process.env.RECORD === "true"; @@ -49,7 +49,7 @@ export function defineSampleSnaphotTests(config: SampleSnapshotTestOptions) { existingSnapshots = await readFilesInDirRecursively(config.outputDir); }); - afterAll(async function (context: Readonly) { + afterAll(async function (context: Readonly) { if (context.tasks.some((x) => x.mode === "skip")) { return; // Not running the full test suite, so don't bother checking snapshots. } diff --git a/packages/spec/package.json b/packages/spec/package.json index 0e2a99ad12..e6bccd3642 100644 --- a/packages/spec/package.json +++ b/packages/spec/package.json @@ -20,8 +20,8 @@ "watch": "node scripts/watch-spec.js" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/internal-build-utils": "workspace:~", - "ecmarkup": "~19.0.0" + "ecmarkup": "~19.1.0" } } diff --git a/packages/tmlanguage-generator/package.json b/packages/tmlanguage-generator/package.json index 6c3d0d0126..8591035251 100644 --- a/packages/tmlanguage-generator/package.json +++ b/packages/tmlanguage-generator/package.json @@ -37,9 +37,9 @@ "plist": "~3.1.0" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@types/plist": "~3.0.5", "rimraf": "~6.0.1", - "typescript": "~5.5.4" + "typescript": "~5.6.2" } } diff --git a/packages/tspd/package.json b/packages/tspd/package.json index af8d9c49ba..67bf8d1b51 100644 --- a/packages/tspd/package.json +++ b/packages/tspd/package.json @@ -57,24 +57,24 @@ ], "dependencies": { "@typespec/compiler": "workspace:~", - "picocolors": "~1.0.1", + "picocolors": "~1.1.0", "prettier": "~3.3.3", - "yaml": "~2.4.5", + "yaml": "~2.5.1", "yargs": "~17.7.2" }, "devDependencies": { - "@types/node": "~18.11.19", - "@types/yargs": "~17.0.32", + "@types/node": "~22.5.4", + "@types/yargs": "~17.0.33", "@typespec/compiler": "workspace:~", "@typespec/prettier-plugin-typespec": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", "source-map-support": "~0.5.21", - "typedoc": "^0.26.5", - "typedoc-plugin-markdown": "^4.2.2", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typedoc": "^0.26.7", + "typedoc-plugin-markdown": "^4.2.7", + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/tspd/src/ref-doc/extractor.ts b/packages/tspd/src/ref-doc/extractor.ts index 9dd7067cde..bb94033cca 100644 --- a/packages/tspd/src/ref-doc/extractor.ts +++ b/packages/tspd/src/ref-doc/extractor.ts @@ -112,7 +112,7 @@ export async function extractLibraryRefDocs( options: extractEmitterOptionsRefDoc(lib.emitter.options), }; } - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated const linter = entrypoint.$linter ?? lib?.linter; if (lib && linter) { refDoc.linter = extractLinterRefDoc(lib.name, resolveLinterDefinition(lib.name, linter)); @@ -344,7 +344,7 @@ function extractOperationRefDoc( reportDiagnostic(program, { code: "documentation-missing", messageId: "interfaceOperation", - format: { name: `${operation.interface.name}.${operation.name}` ?? "" }, + format: { name: `${operation.interface.name}.${operation.name}` }, target: NoTarget, }); } else { diff --git a/packages/typespec-vscode/package.json b/packages/typespec-vscode/package.json index ad43d66bdb..22908cf590 100644 --- a/packages/typespec-vscode/package.json +++ b/packages/typespec-vscode/package.json @@ -25,7 +25,7 @@ "type": "module", "main": "./dist/src/extension.cjs", "engines": { - "vscode": "^1.91.0" + "vscode": "^1.93.0" }, "activationEvents": [ "onLanguage:typespec", @@ -158,18 +158,18 @@ "@rollup/plugin-commonjs": "~26.0.1", "@rollup/plugin-node-resolve": "~15.2.3", "@rollup/plugin-typescript": "~11.1.6", - "@types/node": "~18.11.19", - "@types/vscode": "~1.91.0", + "@types/node": "~22.5.4", + "@types/vscode": "~1.93.0", "@typespec/compiler": "workspace:~", "@typespec/internal-build-utils": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", - "@vscode/vsce": "~2.31.1", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", + "@vscode/vsce": "~3.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "rollup": "~4.19.0", - "typescript": "~5.5.4", - "vitest": "^2.0.4", + "rollup": "~4.21.3", + "typescript": "~5.6.2", + "vitest": "^2.1.0", "vscode-languageclient": "~9.0.1" } } diff --git a/packages/typespec-vscode/src/typespec-log-output-channel.ts b/packages/typespec-vscode/src/typespec-log-output-channel.ts index 1497e330ce..4a19d4634b 100644 --- a/packages/typespec-vscode/src/typespec-log-output-channel.ts +++ b/packages/typespec-vscode/src/typespec-log-output-channel.ts @@ -45,7 +45,7 @@ export class TypeSpecLogOutputChannel implements LogOutputChannel { show(preserveFocus?: boolean | undefined): void; show(column?: vscode.ViewColumn | undefined, preserveFocus?: boolean | undefined): void; show(column?: unknown, preserveFocus?: unknown): void { - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated this.delegate.show(column as any, preserveFocus as any); } hide(): void { diff --git a/packages/versioning/package.json b/packages/versioning/package.json index e095976023..919067660c 100644 --- a/packages/versioning/package.json +++ b/packages/versioning/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/versioning", - "version": "0.60.1", + "version": "0.60.0", "author": "Microsoft Corporation", "description": "TypeSpec library for declaring and emitting versioned APIs", "homepage": "https://typespec.io", @@ -54,15 +54,15 @@ "@typespec/compiler": "workspace:~" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", "@typespec/library-linter": "workspace:~", "@typespec/tspd": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } } diff --git a/packages/versioning/src/projection.ts b/packages/versioning/src/projection.ts index 810470590b..0387f61f58 100644 --- a/packages/versioning/src/projection.ts +++ b/packages/versioning/src/projection.ts @@ -42,7 +42,7 @@ export function buildVersionProjections(program: Program, rootNs: Namespace): Ve const versionKey = indexTimeline( program, timeline, - timeline.get(resolution.versions.values().next().value) + timeline.get(resolution.versions.values().next().value!) ); return { version: resolution.rootVersion?.value, diff --git a/packages/versioning/src/validate.ts b/packages/versioning/src/validate.ts index a93713ad60..67d94ecf3c 100644 --- a/packages/versioning/src/validate.ts +++ b/packages/versioning/src/validate.ts @@ -137,13 +137,13 @@ export function $onValidate(program: Program) { const [_, versionMap] = getVersions(program, namespace); validateVersionEnumValuesUnique(program, namespace); const serviceProps = getService(program, namespace); - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated if (serviceProps?.version !== undefined && versionMap !== undefined) { reportDiagnostic(program, { code: "no-service-fixed-version", format: { name: getNamespaceFullName(namespace), - // eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line @typescript-eslint/no-deprecated version: serviceProps.version, }, target: namespace, diff --git a/packages/versioning/src/versioning-timeline.ts b/packages/versioning/src/versioning-timeline.ts index 8148665172..94e3bc892e 100644 --- a/packages/versioning/src/versioning-timeline.ts +++ b/packages/versioning/src/versioning-timeline.ts @@ -177,7 +177,7 @@ export class TimelineMoment { public constructor(versionMap: Map) { this.#versionMap = versionMap; - this.name = versionMap.values().next().value ?? ""; + this.name = versionMap.values().next().value?.name ?? ""; } getVersion(namespace: Namespace): Version | undefined { diff --git a/packages/versioning/test/versioning.test.ts b/packages/versioning/test/versioning.test.ts index fffcb7e53a..250f2a840e 100644 --- a/packages/versioning/test/versioning.test.ts +++ b/packages/versioning/test/versioning.test.ts @@ -1037,13 +1037,7 @@ describe("versioning: logic", () => { ` )) as { MyService: Namespace }; - const [v1, v2] = runProjections(runner.program, MyService); - const w1 = v1.projectedTypes.get(MyService) as Namespace; - const w2 = v2.projectedTypes.get(MyService) as Namespace; - w1.models.get("Widget")?.properties.size === 1; - w1.operations.get("create")?.parameters.properties.size === 1; - w2.models.get("Widget")?.properties.size === 2; - w2.operations.get("create")?.parameters.properties.size === 2; + runProjections(runner.program, MyService); }); it("can share a model reference between operations with different versions", async () => { diff --git a/packages/website/docusaurus.config.ts b/packages/website/docusaurus.config.ts index ed10ad3bf5..9910a8c987 100644 --- a/packages/website/docusaurus.config.ts +++ b/packages/website/docusaurus.config.ts @@ -10,7 +10,7 @@ import { themes } from "prism-react-renderer"; import { LightTheme } from "./themes/light"; function getMajorMinorVersion(pkgJsonPath): string { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const version = require(pkgJsonPath).version; const [major, minor] = version.split("."); return `${major}.${minor}.x`; diff --git a/packages/website/package.json b/packages/website/package.json index ff52318c28..4081088028 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -25,30 +25,30 @@ "author": "", "license": "ISC", "dependencies": { - "@docusaurus/core": "^3.4.0", - "@docusaurus/plugin-content-docs": "~3.4.0", - "@docusaurus/preset-classic": "^3.4.0", - "@docusaurus/theme-classic": "~3.4.0", - "@docusaurus/theme-common": "~3.4.0", - "@docusaurus/theme-mermaid": "^3.4.0", - "@fluentui/react-components": "~9.54.5", - "@fluentui/react-icons": "^2.0.249", + "@docusaurus/core": "^3.5.2", + "@docusaurus/plugin-content-docs": "~3.5.2", + "@docusaurus/preset-classic": "^3.5.2", + "@docusaurus/theme-classic": "~3.5.2", + "@docusaurus/theme-common": "~3.5.2", + "@docusaurus/theme-mermaid": "^3.5.2", + "@fluentui/react-components": "~9.54.15", + "@fluentui/react-icons": "^2.0.258", "@mdx-js/react": "^3.0.1", "@typespec/playground": "workspace:~", "clsx": "^2.1.1", "es-module-shims": "~1.10.0", - "prism-react-renderer": "^2.3.1", + "prism-react-renderer": "^2.4.0", "prismjs": "~1.29.0", "react": "~18.3.1", "react-dom": "~18.3.1" }, "devDependencies": { - "@docusaurus/module-type-aliases": "^3.4.0", - "@docusaurus/tsconfig": "^3.4.0", - "@docusaurus/types": "^3.4.0", - "@swc/core": "^1.7.0", - "@types/node": "~18.11.19", - "@types/react": "~18.3.3", + "@docusaurus/module-type-aliases": "^3.5.2", + "@docusaurus/tsconfig": "^3.5.2", + "@docusaurus/types": "^3.5.2", + "@swc/core": "^1.7.26", + "@types/node": "~22.5.4", + "@types/react": "~18.3.5", "@typespec/compiler": "workspace:~", "@typespec/http": "workspace:~", "@typespec/internal-build-utils": "workspace:~", @@ -64,14 +64,14 @@ "@typespec/xml": "workspace:~", "dotenv": "~16.4.5", "file-loader": "~6.2.0", - "mermaid": "~10.9.1", + "mermaid": "~11.2.0", "monaco-editor-webpack-plugin": "~7.1.0", - "playwright": "^1.45.3", + "playwright": "^1.47.0", "prism-themes": "~1.9.0", "raw-loader": "~4.0.2", "rimraf": "~6.0.1", "swc-loader": "^0.2.6", - "typescript": "~5.5.4" + "typescript": "~5.6.2" }, "browserslist": { "production": [ diff --git a/packages/website/src/theme/prism-include-languages.ts b/packages/website/src/theme/prism-include-languages.ts index c385f9e57d..95e15e6987 100644 --- a/packages/website/src/theme/prism-include-languages.ts +++ b/packages/website/src/theme/prism-include-languages.ts @@ -9,6 +9,7 @@ export default function prismIncludeLanguages(PrismObject) { globalThis.Prism = PrismObject; additionalLanguages.forEach((lang) => { + // eslint-disable-next-line @typescript-eslint/no-require-imports require(`prismjs/components/prism-${lang}`); }); delete globalThis.Prism; diff --git a/packages/xml/.eslintrc.cjs b/packages/xml/.eslintrc.cjs deleted file mode 100644 index bed8471c3f..0000000000 --- a/packages/xml/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -require("@typespec/eslint-config-typespec/patch/modern-module-resolution"); - -module.exports = { - plugins: ["@typespec/eslint-plugin"], - extends: ["@typespec/eslint-config-typespec", "plugin:@typespec/eslint-plugin/recommended"], - parserOptions: { tsconfigRootDir: __dirname, project: "tsconfig.config.json" }, -}; diff --git a/packages/xml/package.json b/packages/xml/package.json index 28dc9c8d15..f76e4d678b 100644 --- a/packages/xml/package.json +++ b/packages/xml/package.json @@ -50,15 +50,15 @@ "@typespec/compiler": "workspace:~" }, "devDependencies": { - "@types/node": "~18.11.19", + "@types/node": "~22.5.4", "@typespec/compiler": "workspace:~", "@typespec/library-linter": "workspace:~", "@typespec/tspd": "workspace:~", - "@vitest/coverage-v8": "^2.0.4", - "@vitest/ui": "^2.0.4", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", "c8": "^10.1.2", "rimraf": "~6.0.1", - "typescript": "~5.5.4", - "vitest": "^2.0.4" + "typescript": "~5.6.2", + "vitest": "^2.1.0" } }