diff --git a/Cargo.lock b/Cargo.lock index 51db842878..93bc6bbb65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1945,9 +1945,9 @@ dependencies = [ [[package]] name = "deno_lint" -version = "0.69.0" +version = "0.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802583d3ca6c7063e14cafa02ddc206fb34e804e095d52032baf375c56a99515" +checksum = "ac94db8d8597b96c92d30a68b11d4bec6822dcbb3e8675ab1e0136816a301a34" dependencies = [ "anyhow", "deno_ast", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 580420ede1..32bf639250 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -74,7 +74,7 @@ deno_doc = { version = "=0.164.0", features = ["rust", "comrak"] } deno_error.workspace = true deno_graph = { version = "=0.87.0" } deno_lib.workspace = true -deno_lint = { version = "0.69.0" } +deno_lint = { version = "0.70.0" } deno_lockfile.workspace = true deno_media_type = { workspace = true, features = ["data_url", "decoding", "module_specifier"] } deno_npm.workspace = true diff --git a/cli/rt/run.rs b/cli/rt/run.rs index c397ccfc58..89f413253b 100644 --- a/cli/rt/run.rs +++ b/cli/rt/run.rs @@ -197,8 +197,8 @@ impl ModuleLoader for EmbeddedModuleLoader { referrer_kind, NodeResolutionKind::Execution, ) - .map_err(JsErrorBox::from_err)? - .into_url(), + .and_then(|res| res.into_url()) + .map_err(JsErrorBox::from_err)?, ); } @@ -338,7 +338,7 @@ impl ModuleLoader for EmbeddedModuleLoader { ) .map_err(JsErrorBox::from_err)?; if let Some(res) = maybe_res { - return Ok(res.into_url()); + return Ok(res.into_url().map_err(JsErrorBox::from_err)?); } Err(JsErrorBox::from_err(err).into()) } diff --git a/cli/schemas/lint-rules.v1.json b/cli/schemas/lint-rules.v1.json index cfec281952..87bd4e2600 100644 --- a/cli/schemas/lint-rules.v1.json +++ b/cli/schemas/lint-rules.v1.json @@ -8,7 +8,6 @@ "ban-untagged-ignore", "ban-untagged-todo", "ban-unused-ignore", - "button-has-type", "camelcase", "constructor-super", "default-param-last", @@ -21,11 +20,11 @@ "getter-return", "guard-for-in", "jsx-boolean-value", + "jsx-button-has-type", "jsx-curly-braces", "jsx-key", "jsx-no-children-prop", "jsx-no-comment-text-nodes", - "jsx-no-danger-with-children", "jsx-no-duplicate-props", "jsx-no-unescaped-entities", "jsx-no-useless-fragment", @@ -44,7 +43,6 @@ "no-const-assign", "no-constant-condition", "no-control-regex", - "no-danger", "no-debugger", "no-delete-var", "no-deprecated-deno-api", @@ -115,9 +113,11 @@ "prefer-const", "prefer-namespace-keyword", "prefer-primordials", + "react-no-danger", + "react-no-danger-with-children", + "react-rules-of-hooks", "require-await", "require-yield", - "rules-of-hooks", "single-var-declarator", "triple-slash-reference", "use-isnan", diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index 53429ef893..e4c7c66dda 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -409,6 +409,12 @@ async fn install_global( .load_and_type_check_files(&[install_flags_global.module_url.clone()]) .await?; + if matches!(flags.config_flag, ConfigFlag::Discover) + && cli_options.workspace().deno_jsons().next().is_some() + { + log::warn!("{} discovered config file will be ignored in the installed command. Use the --config flag if you wish to include it.", crate::colors::yellow("Warning")); + } + // create the install shim create_install_shim(http_client, &flags, install_flags_global).await } diff --git a/cli/tsc/mod.rs b/cli/tsc/mod.rs index 64ee415f63..943c202af5 100644 --- a/cli/tsc/mod.rs +++ b/cli/tsc/mod.rs @@ -1009,8 +1009,8 @@ fn resolve_non_graph_specifier_types( resolution_mode, NodeResolutionKind::Types, ) - .ok() - .map(|res| res.into_url()), + .and_then(|res| res.into_url()) + .ok(), ))) } else if let Ok(npm_req_ref) = NpmPackageReqReference::from_str(raw_specifier) diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js index 5a9f32cb00..e26d48506c 100644 --- a/ext/crypto/00_crypto.js +++ b/ext/crypto/00_crypto.js @@ -48,6 +48,7 @@ import { op_crypto_verify_ed25519, op_crypto_verify_key, op_crypto_wrap_key, + op_crypto_x25519_public_key, } from "ext:core/ops"; const { ArrayBufferIsView, @@ -4532,17 +4533,18 @@ function exportKeyX25519(format, key, innerKey) { return TypedArrayPrototypeGetBuffer(pkcs8Der); } case "jwk": { - if (key[_type] === "private") { - throw new DOMException("Not implemented", "NotSupportedError"); - } - const x = op_crypto_base64url_encode(innerKey); const jwk = { kty: "OKP", crv: "X25519", - x, "key_ops": key.usages, ext: key[_extractable], }; + if (key[_type] === "private") { + jwk.x = op_crypto_x25519_public_key(innerKey); + jwk.d = op_crypto_base64url_encode(innerKey); + } else { + jwk.x = op_crypto_base64url_encode(innerKey); + } return jwk; } default: diff --git a/ext/crypto/lib.rs b/ext/crypto/lib.rs index 0d6eecb911..9a5b71500b 100644 --- a/ext/crypto/lib.rs +++ b/ext/crypto/lib.rs @@ -98,6 +98,7 @@ deno_core::extension!(deno_crypto, op_crypto_base64url_decode, op_crypto_base64url_encode, x25519::op_crypto_generate_x25519_keypair, + x25519::op_crypto_x25519_public_key, x25519::op_crypto_derive_bits_x25519, x25519::op_crypto_import_spki_x25519, x25519::op_crypto_import_pkcs8_x25519, diff --git a/ext/crypto/x25519.rs b/ext/crypto/x25519.rs index 226ed89e40..aee8ae0e29 100644 --- a/ext/crypto/x25519.rs +++ b/ext/crypto/x25519.rs @@ -1,5 +1,6 @@ // Copyright 2018-2025 the Deno authors. MIT license. +use base64::prelude::BASE64_URL_SAFE_NO_PAD; use curve25519_dalek::montgomery::MontgomeryPoint; use deno_core::op2; use deno_core::ToJsBuffer; @@ -20,17 +21,16 @@ pub enum X25519Error { #[error(transparent)] Der(#[from] spki::der::Error), } - +// u-coordinate of the base point. +const X25519_BASEPOINT_BYTES: [u8; 32] = [ + 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, +]; #[op2(fast)] pub fn op_crypto_generate_x25519_keypair( #[buffer] pkey: &mut [u8], #[buffer] pubkey: &mut [u8], ) { - // u-coordinate of the base point. - const X25519_BASEPOINT_BYTES: [u8; 32] = [ - 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - ]; let mut rng = OsRng; rng.fill_bytes(pkey); // https://www.rfc-editor.org/rfc/rfc7748#section-6.1 @@ -42,6 +42,17 @@ pub fn op_crypto_generate_x25519_keypair( pubkey.copy_from_slice(&x25519_dalek::x25519(pkey, X25519_BASEPOINT_BYTES)); } +#[op2] +#[string] +pub fn op_crypto_x25519_public_key(#[buffer] private_key: &[u8]) -> String { + use base64::Engine; + + let private_key: [u8; 32] = + private_key.try_into().expect("Expected byteLength 32"); + BASE64_URL_SAFE_NO_PAD + .encode(x25519_dalek::x25519(private_key, X25519_BASEPOINT_BYTES)) +} + const MONTGOMERY_IDENTITY: MontgomeryPoint = MontgomeryPoint([0; 32]); #[op2(fast)] diff --git a/resolvers/deno/lib.rs b/resolvers/deno/lib.rs index 2c0d79ec02..0ac073821c 100644 --- a/resolvers/deno/lib.rs +++ b/resolvers/deno/lib.rs @@ -255,10 +255,12 @@ impl< { return node_resolver .resolve(raw_specifier, referrer, resolution_mode, resolution_kind) - .map(|res| DenoResolution { - url: res.into_url(), - found_package_json_dep, - maybe_diagnostic, + .and_then(|res| { + Ok(DenoResolution { + url: res.into_url()?, + found_package_json_dep, + maybe_diagnostic, + }) }) .map_err(|e| e.into()); } @@ -498,9 +500,9 @@ impl< })?; if let Some(res) = maybe_resolution { match res { - NodeResolution::Module(url) => { + NodeResolution::Module(ref _url) => { return Ok(DenoResolution { - url, + url: res.into_url()?, maybe_diagnostic, found_package_json_dep, }) diff --git a/resolvers/node/resolution.rs b/resolvers/node/resolution.rs index 3bbef283e6..1f6e711711 100644 --- a/resolvers/node/resolution.rs +++ b/resolvers/node/resolution.rs @@ -116,21 +116,19 @@ impl NodeResolutionKind { #[derive(Debug)] pub enum NodeResolution { - Module(Url), + Module(UrlOrPath), BuiltIn(String), } impl NodeResolution { - pub fn into_url(self) -> Url { + pub fn into_url(self) -> Result { match self { - Self::Module(u) => u, - Self::BuiltIn(specifier) => { - if specifier.starts_with("node:") { - Url::parse(&specifier).unwrap() - } else { - Url::parse(&format!("node:{specifier}")).unwrap() - } - } + Self::Module(u) => Ok(u.into_url()?), + Self::BuiltIn(specifier) => Ok(if specifier.starts_with("node:") { + Url::parse(&specifier).unwrap() + } else { + Url::parse(&format!("node:{specifier}")).unwrap() + }), } } } @@ -221,7 +219,7 @@ impl< if let Ok(url) = Url::parse(specifier) { if url.scheme() == "data" { - return Ok(NodeResolution::Module(url)); + return Ok(NodeResolution::Module(UrlOrPath::Url(url))); } if let Some(module_name) = @@ -246,7 +244,7 @@ impl< let url = referrer .join(specifier) .map_err(|source| DataUrlReferrerError { source })?; - return Ok(NodeResolution::Module(url)); + return Ok(NodeResolution::Module(UrlOrPath::Url(url))); } } @@ -274,8 +272,8 @@ impl< url }; - let url = self.finalize_resolution(url, Some(&referrer))?; - let resolve_response = NodeResolution::Module(url.into_url()?); + let url_or_path = self.finalize_resolution(url, Some(&referrer))?; + let resolve_response = NodeResolution::Module(url_or_path); // TODO(bartlomieju): skipped checking errors for commonJS resolution and // "preserveSymlinksMain"/"preserveSymlinks" options. Ok(resolve_response) diff --git a/tests/specs/install/global/warn_config_file/__test__.jsonc b/tests/specs/install/global/warn_config_file/__test__.jsonc new file mode 100644 index 0000000000..1d36d4c143 --- /dev/null +++ b/tests/specs/install/global/warn_config_file/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "install --root ./bins -g --name my-cli main.js", + "output": "install.out" +} diff --git a/tests/specs/install/global/warn_config_file/deno.json b/tests/specs/install/global/warn_config_file/deno.json new file mode 100644 index 0000000000..2c63c08510 --- /dev/null +++ b/tests/specs/install/global/warn_config_file/deno.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/specs/install/global/warn_config_file/install.out b/tests/specs/install/global/warn_config_file/install.out new file mode 100644 index 0000000000..4ce57be390 --- /dev/null +++ b/tests/specs/install/global/warn_config_file/install.out @@ -0,0 +1,3 @@ +Warning discovered config file will be ignored in the installed command. Use the --config flag if you wish to include it. +✅ Successfully installed my-cli +[WILDCARD] diff --git a/tests/specs/install/global/warn_config_file/main.js b/tests/specs/install/global/warn_config_file/main.js new file mode 100644 index 0000000000..296d5492b0 --- /dev/null +++ b/tests/specs/install/global/warn_config_file/main.js @@ -0,0 +1 @@ +console.log(1); diff --git a/tests/specs/lint/bom/mod.out b/tests/specs/lint/bom/mod.out index eea1e531d7..18d9927958 100644 --- a/tests/specs/lint/bom/mod.out +++ b/tests/specs/lint/bom/mod.out @@ -5,7 +5,7 @@ error[no-unused-vars]: `t` is never used | ^ = hint: If this is intentional, prefix it with an underscore like `_t` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars Found 1 problem diff --git a/tests/specs/lint/gitignore/expected.out b/tests/specs/lint/gitignore/expected.out index 8024b51d19..ac982926bd 100644 --- a/tests/specs/lint/gitignore/expected.out +++ b/tests/specs/lint/gitignore/expected.out @@ -5,7 +5,7 @@ error[no-empty]: Empty block statement | ^^ = hint: Add code or comment to the empty block - docs: https://lint.deno.land/rules/no-empty + docs: https://docs.deno.com/lint/rules/no-empty Found 1 problem diff --git a/tests/specs/lint/jsr_tag/package.out b/tests/specs/lint/jsr_tag/package.out index 5169d9815f..ff26e5104f 100644 --- a/tests/specs/lint/jsr_tag/package.out +++ b/tests/specs/lint/jsr_tag/package.out @@ -5,7 +5,7 @@ error[verbatim-module-syntax]: All import identifiers are used in types | ^^^^^^ = hint: Change `import` to `import type` and optionally add an explicit side effect import - docs: https://lint.deno.land/rules/verbatim-module-syntax + docs: https://docs.deno.com/lint/rules/verbatim-module-syntax Found 1 problem (1 fixable via --fix) diff --git a/tests/specs/lint/jsx/react-jsx.out b/tests/specs/lint/jsx/react-jsx.out index c8c7007791..3aba846e67 100644 --- a/tests/specs/lint/jsx/react-jsx.out +++ b/tests/specs/lint/jsx/react-jsx.out @@ -5,7 +5,7 @@ error[no-unused-vars]: `React` is never used | ^^^^^ = hint: If this is intentional, prefix it with an underscore like `_React` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars Found 1 problem diff --git a/tests/specs/lint/node_globals_no_duplicate_imports/lint.out b/tests/specs/lint/node_globals_no_duplicate_imports/lint.out index d9ff7f77e2..7f2fcf7860 100644 --- a/tests/specs/lint/node_globals_no_duplicate_imports/lint.out +++ b/tests/specs/lint/node_globals_no_duplicate_imports/lint.out @@ -5,7 +5,7 @@ error[no-node-globals]: NodeJS globals are not available in Deno | ^^^^^^^^^^^^ = hint: Add `import { setImmediate } from "node:timers";` - docs: https://lint.deno.land/rules/no-node-globals + docs: https://docs.deno.com/lint/rules/no-node-globals error[no-node-globals]: NodeJS globals are not available in Deno @@ -15,7 +15,7 @@ error[no-node-globals]: NodeJS globals are not available in Deno | ^^^^^^^^^^^^ = hint: Add `import { setImmediate } from "node:timers";` - docs: https://lint.deno.land/rules/no-node-globals + docs: https://docs.deno.com/lint/rules/no-node-globals Found 2 problems (2 fixable via --fix) diff --git a/tests/specs/lint/opt_out_top_level_exclude_via_lint_inexclude/main_unix.out b/tests/specs/lint/opt_out_top_level_exclude_via_lint_inexclude/main_unix.out index 39a3e7746c..c603aab53a 100644 --- a/tests/specs/lint/opt_out_top_level_exclude_via_lint_inexclude/main_unix.out +++ b/tests/specs/lint/opt_out_top_level_exclude_via_lint_inexclude/main_unix.out @@ -6,7 +6,7 @@ error[no-unused-vars]: `a` is never used | ^ = hint: If this is intentional, prefix it with an underscore like `_a` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `a` is never used @@ -16,7 +16,7 @@ error[no-unused-vars]: `a` is never used | ^ = hint: If this is intentional, prefix it with an underscore like `_a` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars [UNORDERED_END] diff --git a/tests/specs/lint/opt_out_top_level_exclude_via_lint_inexclude/main_windows.out b/tests/specs/lint/opt_out_top_level_exclude_via_lint_inexclude/main_windows.out index 8edf1133ea..ccd4faaad7 100644 --- a/tests/specs/lint/opt_out_top_level_exclude_via_lint_inexclude/main_windows.out +++ b/tests/specs/lint/opt_out_top_level_exclude_via_lint_inexclude/main_windows.out @@ -6,7 +6,7 @@ error[no-unused-vars]: `a` is never used | ^ = hint: If this is intentional, prefix it with an underscore like `_a` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `a` is never used @@ -16,7 +16,7 @@ error[no-unused-vars]: `a` is never used | ^ = hint: If this is intentional, prefix it with an underscore like `_a` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars [UNORDERED_END] diff --git a/tests/specs/lint/quiet/expected_quiet.out b/tests/specs/lint/quiet/expected_quiet.out index 91c1a29cf1..3e154a49fd 100644 --- a/tests/specs/lint/quiet/expected_quiet.out +++ b/tests/specs/lint/quiet/expected_quiet.out @@ -5,7 +5,7 @@ error[ban-untagged-ignore]: Ignore directive requires lint rule name(s) | ^^^^^^^^^^^^^^^^^^^ = hint: Add one or more lint rule names. E.g. // deno-lint-ignore adjacent-overload-signatures - docs: https://lint.deno.land/rules/ban-untagged-ignore + docs: https://docs.deno.com/lint/rules/ban-untagged-ignore error[no-empty]: Empty block statement @@ -15,6 +15,6 @@ error[no-empty]: Empty block statement | ^^ = hint: Add code or comment to the empty block - docs: https://lint.deno.land/rules/no-empty + docs: https://docs.deno.com/lint/rules/no-empty diff --git a/tests/specs/lint/stdin/expected_from_stdin.out b/tests/specs/lint/stdin/expected_from_stdin.out index f65331ebd9..58f0804481 100644 --- a/tests/specs/lint/stdin/expected_from_stdin.out +++ b/tests/specs/lint/stdin/expected_from_stdin.out @@ -5,7 +5,7 @@ error[no-explicit-any]: `any` type is not allowed | ^^^ = hint: Use a specific type other than `any` - docs: https://lint.deno.land/rules/no-explicit-any + docs: https://docs.deno.com/lint/rules/no-explicit-any Found 1 problem diff --git a/tests/specs/lint/syntax_error_reporting/lint.out b/tests/specs/lint/syntax_error_reporting/lint.out index 31e4c576b6..c317faa205 100644 --- a/tests/specs/lint/syntax_error_reporting/lint.out +++ b/tests/specs/lint/syntax_error_reporting/lint.out @@ -9,7 +9,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars Found 1 problem diff --git a/tests/specs/lint/with_config/with_config.out b/tests/specs/lint/with_config/with_config.out index f527bb7121..caccc81aba 100644 --- a/tests/specs/lint/with_config/with_config.out +++ b/tests/specs/lint/with_config/with_config.out @@ -5,7 +5,7 @@ error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue) | ^^^^^^^^^^^^ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123) - docs: https://lint.deno.land/rules/ban-untagged-todo + docs: https://docs.deno.com/lint/rules/ban-untagged-todo error[no-unused-vars]: `add` is never used @@ -15,7 +15,7 @@ error[no-unused-vars]: `add` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_add` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars Found 2 problems diff --git a/tests/specs/lint/with_config_and_flags/with_config_and_flags.out b/tests/specs/lint/with_config_and_flags/with_config_and_flags.out index 78e21ef8d8..c42ecbe3d8 100644 --- a/tests/specs/lint/with_config_and_flags/with_config_and_flags.out +++ b/tests/specs/lint/with_config_and_flags/with_config_and_flags.out @@ -5,7 +5,7 @@ error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123) - docs: https://lint.deno.land/rules/ban-untagged-todo + docs: https://docs.deno.com/lint/rules/ban-untagged-todo error[no-unused-vars]: `subtract` is never used @@ -15,7 +15,7 @@ error[no-unused-vars]: `subtract` is never used | ^^^^^^^^ = hint: If this is intentional, prefix it with an underscore like `_subtract` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars Found 2 problems diff --git a/tests/specs/lint/with_config_without_args/with_config_without_tags.out b/tests/specs/lint/with_config_without_args/with_config_without_tags.out index f527bb7121..caccc81aba 100644 --- a/tests/specs/lint/with_config_without_args/with_config_without_tags.out +++ b/tests/specs/lint/with_config_without_args/with_config_without_tags.out @@ -5,7 +5,7 @@ error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue) | ^^^^^^^^^^^^ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123) - docs: https://lint.deno.land/rules/ban-untagged-todo + docs: https://docs.deno.com/lint/rules/ban-untagged-todo error[no-unused-vars]: `add` is never used @@ -15,7 +15,7 @@ error[no-unused-vars]: `add` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_add` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars Found 2 problems diff --git a/tests/specs/lint/with_glob_config/with_glob_config_unix.out b/tests/specs/lint/with_glob_config/with_glob_config_unix.out index fad285cbe7..1224bd5f90 100644 --- a/tests/specs/lint/with_glob_config/with_glob_config_unix.out +++ b/tests/specs/lint/with_glob_config/with_glob_config_unix.out @@ -6,7 +6,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -16,7 +16,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -26,7 +26,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -36,7 +36,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -46,7 +46,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -56,7 +56,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -66,7 +66,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -76,7 +76,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -86,7 +86,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars [UNORDERED_END] diff --git a/tests/specs/lint/with_glob_config/with_glob_config_windows.out b/tests/specs/lint/with_glob_config/with_glob_config_windows.out index 2ba0787912..a09ac13155 100644 --- a/tests/specs/lint/with_glob_config/with_glob_config_windows.out +++ b/tests/specs/lint/with_glob_config/with_glob_config_windows.out @@ -6,7 +6,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -16,7 +16,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -26,7 +26,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -36,7 +36,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -46,7 +46,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -56,7 +56,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -66,7 +66,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -76,7 +76,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -86,7 +86,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars [UNORDERED_END] diff --git a/tests/specs/lint/with_glob_config_and_flags/with_glob_config_and_flags_unix.out b/tests/specs/lint/with_glob_config_and_flags/with_glob_config_and_flags_unix.out index 9afca955ba..7e8cb919eb 100644 --- a/tests/specs/lint/with_glob_config_and_flags/with_glob_config_and_flags_unix.out +++ b/tests/specs/lint/with_glob_config_and_flags/with_glob_config_and_flags_unix.out @@ -6,7 +6,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -16,7 +16,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -26,7 +26,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -36,7 +36,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -46,7 +46,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -56,7 +56,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -66,7 +66,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -76,7 +76,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -86,7 +86,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -96,7 +96,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -106,7 +106,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars [UNORDERED_END] diff --git a/tests/specs/lint/with_glob_config_and_flags/with_glob_config_and_flags_windows.out b/tests/specs/lint/with_glob_config_and_flags/with_glob_config_and_flags_windows.out index 9446796ab9..3832a4a65c 100644 --- a/tests/specs/lint/with_glob_config_and_flags/with_glob_config_and_flags_windows.out +++ b/tests/specs/lint/with_glob_config_and_flags/with_glob_config_and_flags_windows.out @@ -6,7 +6,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -16,7 +16,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -26,7 +26,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -36,7 +36,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -46,7 +46,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -56,7 +56,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -66,7 +66,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -76,7 +76,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -86,7 +86,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -96,7 +96,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-unused-vars]: `foo` is never used @@ -106,7 +106,7 @@ error[no-unused-vars]: `foo` is never used | ^^^ = hint: If this is intentional, prefix it with an underscore like `_foo` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars [UNORDERED_END] diff --git a/tests/specs/lint/workspace/a.out b/tests/specs/lint/workspace/a.out index 52f05af990..002fc886c3 100644 --- a/tests/specs/lint/workspace/a.out +++ b/tests/specs/lint/workspace/a.out @@ -5,7 +5,7 @@ error[no-eval]: `eval` call is not allowed | ^^^^^^^^ = hint: Remove the use of `eval` - docs: https://lint.deno.land/rules/no-eval + docs: https://docs.deno.com/lint/rules/no-eval error[no-await-in-loop]: Unexpected `await` inside a loop. @@ -15,7 +15,7 @@ error[no-await-in-loop]: Unexpected `await` inside a loop. | ^^^^^^^^^^^^^^^^^^^^^^^ = hint: Remove `await` in loop body, store all promises generated and then `await Promise.all(storedPromises)` after the loop - docs: https://lint.deno.land/rules/no-await-in-loop + docs: https://docs.deno.com/lint/rules/no-await-in-loop error[no-explicit-any]: `any` type is not allowed @@ -25,7 +25,7 @@ error[no-explicit-any]: `any` type is not allowed | ^^^ = hint: Use a specific type other than `any` - docs: https://lint.deno.land/rules/no-explicit-any + docs: https://docs.deno.com/lint/rules/no-explicit-any Found 3 problems diff --git a/tests/specs/lint/workspace/root.out b/tests/specs/lint/workspace/root.out index 1d892a93f0..e2db1a6e09 100644 --- a/tests/specs/lint/workspace/root.out +++ b/tests/specs/lint/workspace/root.out @@ -5,7 +5,7 @@ error[no-eval]: `eval` call is not allowed | ^^^^^^^^ = hint: Remove the use of `eval` - docs: https://lint.deno.land/rules/no-eval + docs: https://docs.deno.com/lint/rules/no-eval error[no-unused-vars]: `unused` is never used @@ -15,7 +15,7 @@ error[no-unused-vars]: `unused` is never used | ^^^^^^ = hint: If this is intentional, prefix it with an underscore like `_unused` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars error[no-explicit-any]: `any` type is not allowed @@ -25,7 +25,7 @@ error[no-explicit-any]: `any` type is not allowed | ^^^ = hint: Use a specific type other than `any` - docs: https://lint.deno.land/rules/no-explicit-any + docs: https://docs.deno.com/lint/rules/no-explicit-any error[no-eval]: `eval` call is not allowed @@ -35,7 +35,7 @@ error[no-eval]: `eval` call is not allowed | ^^^^^^^^ = hint: Remove the use of `eval` - docs: https://lint.deno.land/rules/no-eval + docs: https://docs.deno.com/lint/rules/no-eval error[no-await-in-loop]: Unexpected `await` inside a loop. @@ -45,7 +45,7 @@ error[no-await-in-loop]: Unexpected `await` inside a loop. | ^^^^^^^^^^^^^^^^^^^^^^^ = hint: Remove `await` in loop body, store all promises generated and then `await Promise.all(storedPromises)` after the loop - docs: https://lint.deno.land/rules/no-await-in-loop + docs: https://docs.deno.com/lint/rules/no-await-in-loop error[no-explicit-any]: `any` type is not allowed @@ -55,7 +55,7 @@ error[no-explicit-any]: `any` type is not allowed | ^^^ = hint: Use a specific type other than `any` - docs: https://lint.deno.land/rules/no-explicit-any + docs: https://docs.deno.com/lint/rules/no-explicit-any error[no-eval]: `eval` call is not allowed @@ -65,7 +65,7 @@ error[no-eval]: `eval` call is not allowed | ^^^^^^^^ = hint: Remove the use of `eval` - docs: https://lint.deno.land/rules/no-eval + docs: https://docs.deno.com/lint/rules/no-eval error[no-unused-vars]: `unused` is never used @@ -75,7 +75,7 @@ error[no-unused-vars]: `unused` is never used | ^^^^^^ = hint: If this is intentional, prefix it with an underscore like `_unused` - docs: https://lint.deno.land/rules/no-unused-vars + docs: https://docs.deno.com/lint/rules/no-unused-vars Found 8 problems diff --git a/tests/unit/webcrypto_test.ts b/tests/unit/webcrypto_test.ts index bc5b307de5..1732bb2635 100644 --- a/tests/unit/webcrypto_test.ts +++ b/tests/unit/webcrypto_test.ts @@ -2085,3 +2085,20 @@ Deno.test(async function x25519SharedSecret() { assertEquals(sharedSecret1.byteLength, 16); assertEquals(new Uint8Array(sharedSecret1), new Uint8Array(sharedSecret2)); }); + +Deno.test(async function x25519ExportJwk() { + const keyPair = await crypto.subtle.generateKey( + { + name: "X25519", + }, + true, + ["deriveBits"], + ) as CryptoKeyPair; + + const jwk = await crypto.subtle.exportKey("jwk", keyPair.privateKey); + + assertEquals(jwk.kty, "OKP"); + assertEquals(jwk.crv, "X25519"); + assert(jwk.d); + assert(jwk.x); +}); diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 6d2cc38562..01a4e0b5e9 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -845,14 +845,6 @@ "Good parameters: Ed448 bits (jwk, object(crv, d, x, kty), {name: Ed448}, false, [sign])", "Good parameters: Ed448 bits (pkcs8, buffer(73), {name: Ed448}, false, [sign, sign])", "Good parameters: Ed448 bits (jwk, object(crv, d, x, kty), {name: Ed448}, false, [sign, sign])", - "Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveKey])", - "Good parameters with ignored JWK alg: X25519 (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveKey])", - "Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits, deriveKey])", - "Good parameters with ignored JWK alg: X25519 (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits, deriveKey])", - "Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits])", - "Good parameters with ignored JWK alg: X25519 (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits])", - "Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits])", - "Good parameters with ignored JWK alg: X25519 (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits])", "Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, true, [deriveKey])", "Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, true, [deriveKey])", "Good parameters with ignored JWK alg: X448 (jwk, object(crv, d, x, kty), {name: X448}, true, [deriveKey])", @@ -902,14 +894,6 @@ "Good parameters: Ed448 bits (jwk, object(crv, d, x, kty), {name: Ed448}, false, [sign])", "Good parameters: Ed448 bits (pkcs8, buffer(73), {name: Ed448}, false, [sign, sign])", "Good parameters: Ed448 bits (jwk, object(crv, d, x, kty), {name: Ed448}, false, [sign, sign])", - "Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveKey])", - "Good parameters with ignored JWK alg: X25519 (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveKey])", - "Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits, deriveKey])", - "Good parameters with ignored JWK alg: X25519 (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits, deriveKey])", - "Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits])", - "Good parameters with ignored JWK alg: X25519 (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits])", - "Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits])", - "Good parameters with ignored JWK alg: X25519 (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits])", "Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, true, [deriveKey])", "Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, true, [deriveKey])", "Good parameters with ignored JWK alg: X448 (jwk, object(crv, d, x, kty), {name: X448}, true, [deriveKey])",