Adds support for re-exporting an ES module from a CJS one and then
importing the CJS module from ESM. Also fixes a bug where require esm
wasn't working in deno compile.
We did not serialize the `AssignmentPattern` node inside `ObjectPattern`
properties.
```ts
({ a = b } = {})
```
This is a bit different in SWC and looks like I got confused with the
different AST formats.
Fixes https://github.com/denoland/deno/issues/28399
This adds support for installing `file:` dependencies in a local
package.json.
In order to use these, you must not set `--node-modules-dir=...` when
using a package.json and it should use the default of
`--node-modules-dir=manual`.
Closes https://github.com/denoland/deno/issues/18701
This PR adds support for `:has/:is/:where()` and `:not()`. The latter
was already present, but found a bunch of issues with it and I'd say
that it didn't really work before this PR.
Fixes https://github.com/denoland/deno/issues/28335
Internally, we use a group node for array-like children, which is hidden
from the user. When we're asking for a parent of a node we need to take
group nodes into account and walk over them.
Fixes one issue reported in
https://github.com/denoland/deno/issues/28355
The `PropertyDefinition` node also allows `PrivateIdentifier` as a type
for the `key`. Example:
```ts
class Foo {
#foo = 2;
}
```
Fixes one issue reported in
https://github.com/denoland/deno/issues/28355
This PR adds support for field selectors (`.<field>`) in the lint plugin
API. This is supported in ESLint as well, but was missing in our
implementation.
```css
/* Only search the test expression of an IfStatement */
IfStatement.test
```
Fixes https://github.com/denoland/deno/issues/28314
The code to support regex matching on attribute values was already
there. I just forgot to wire it up properly in the selector matching
code.
Fixes https://github.com/denoland/deno/issues/28336
Ref https://github.com/denoland/deno/issues/28258
This commit forces lint plugins to run with `--no-prompt` flag,
bringing parity between running plugins in the LSP and via
`deno lint`.
There's no agreement how to handle permissions in the lint
plugins yet, so it's better to make both subcommands behave
identically for the time being.
Updates to use rust 1.85. Doesn't move to the 2024 edition, as that's a
fair bit more involved.
A nice side benefit is that the new rustc version seems to lead to a
slight reduction in binary size (at least on mac):
```
FILE SIZE
--------------
+4.3% +102Ki __DATA_CONST,__const
[NEW] +69.3Ki __TEXT,__literals
[NEW] +68.5Ki Rebase Info
+5.0% +39.9Ki __TEXT,__unwind_info
+57% +8.85Ki [__TEXT]
[NEW] +8.59Ki Lazy Binding Info
[NEW] +5.16Ki __TEXT,__stub_helper
[NEW] +3.58Ki Export Info
[NEW] +3.42Ki __DATA,__la_symbol_ptr
-0.1% -726 [12 Others]
-21.4% -3.10Ki [__DATA_CONST]
-95.8% -3.39Ki __DATA_CONST,__got
-20.9% -3.43Ki [__DATA]
-0.5% -4.52Ki Code Signature
-100.0% -11.6Ki [__LINKEDIT]
-1.0% -43.5Ki Symbol Table
-1.6% -44.0Ki __TEXT,__gcc_except_tab
-0.2% -48.1Ki __TEXT,__const
-3.3% -78.6Ki __TEXT,__eh_frame
-0.7% -320Ki __TEXT,__text
-1.5% -334Ki String Table
-0.5% -586Ki TOTAL
```
When all Rust-based rules where filtered out we were bailing out early
instead of checking if there are plugin rules we need to run. This meant
we errored out with a "No lint rules to run" message, even though plugin
rules were active.
Fixes https://github.com/denoland/deno/issues/28267
Speeds up the caching part of this arbitrary `"nodeModulesDir": "auto"`
project by about 22%
We write the tags associated with a given npm package to the
`.initialized` file, so that byonm can correctly resolve tags. When
setting up the node modules dir, we read that file to see if we need to
update the tags.
If we don't have any tags associated with the package though, we can
just check for existence (which is a fair bit faster than trying to
`open` + `read` a file).
```
❯ hyperfine --warmup 3 "deno check src/**/*.ts" "../deno/target/release-lite/deno check src/**/*.ts"
Benchmark 1: deno check src/**/*.ts
Time (mean ± σ): 369.9 ms ± 5.5 ms [User: 286.9 ms, System: 128.9 ms]
Range (min … max): 361.7 ms … 377.7 ms 10 runs
Benchmark 2: ../deno/target/release-lite/deno check src/**/*.ts
Time (mean ± σ): 303.5 ms ± 5.9 ms [User: 210.9 ms, System: 124.5 ms]
Range (min … max): 292.7 ms … 315.0 ms 10 runs
Summary
../deno/target/release-lite/deno check src/**/*.ts ran
1.22 ± 0.03 times faster than deno check src/**/*.ts
```
Fixes https://github.com/denoland/deno/issues/28223
This is kind of an ugly fix, but it works, and I think is the easiest
way to handle the fact that when caching the module graph we might
encounter imports that won't actually error at runtime (for instance in
files that will be bundled).
The `:exit` selectors were called at the wrong time during visiting.
They need to be called when going upwards and a node and all its
children have been fully visited. Instead we called it when the node +
all its sibling were visited which is wrong.
Fixes https://github.com/denoland/deno/issues/28227