0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-06 02:52:05 -05:00
Commit graph

638 commits

Author SHA1 Message Date
Bartek Iwańczuk
46e150dcb0
more types 2025-01-30 23:44:41 +01:00
Bartek Iwańczuk
b3ddde1d4d
simplify types 2025-01-30 23:35:58 +01:00
Bartek Iwańczuk
9b36c6f218
Merge branch 'main' into lint_plugins 2025-01-27 00:13:41 +01:00
Bartek Iwańczuk
974e2f44b2
refactor: add 'deno_os' crate (#27655)
This commit creates "deno_os" extension crate and moves
numerous ops from "runtime/" crate to the new crate.
2025-01-14 17:29:36 +01:00
Bartek Iwańczuk
a8c647e0ec
Merge branch 'main' into lint_plugins 2025-01-14 15:02:22 +01:00
Marvin Hagemeister
3fb8fc1ba7
feat(unstable): refactor js lint plugin AST (#27615)
This PR changes the underlying buffer backed AST format we use for
JavaScript-based linting plugins. It adds support for various new types,
makes traversal code a lot easier and is more polished compared to
previous iterations.

Here is a quick summary (in no particular order):

- Node prop data is separate from traversal, which makes traversal code
so much easier to reason about. Previously, it was interleaved with node
prop data
- spans are in a separate table as well, as they are rarely needed.
- schema is separate from SWC conversion logic, which makes 
- supports recursive plain objects
- supports numbers
- supports bigint
- supports regex
- adds all SWC nodes

Apologies, this is kinda a big PR, but it's worth it imo.

_Marking as draft because I need to update some tests tomorrow._
2025-01-14 13:31:02 +01:00
Bartek Iwańczuk
807cf19157
Merge branch 'main' into lint_plugins 2025-01-09 15:13:39 +01:00
Bartek Iwańczuk
900ef00c94
fix print functions 2025-01-09 14:11:54 +01:00
Marvin Hagemeister
cabdfa8c2d
fix(lint): fix single char selectors being ignored (#27576)
The selector splitting code that's used for JS linting plugins didn't
properly account for selectors being a single character. This can happen
in the case of `*`.

Instead of comparing against the length, we'll now check if the
remaining string portion is not empty, which is more robust. It also
allows us to detect trailing whitespace, which we didn't before.
2025-01-08 00:21:50 +01:00
Bartek Iwańczuk
f7051e2058
install all plugins in one go 2025-01-07 00:47:43 +01:00
Bartek Iwańczuk
ad41ab7c65
foo 2025-01-06 23:38:54 +01:00
Bartek Iwańczuk
5af9453f0c
testing helpers 2025-01-03 18:20:29 +01:00
Marvin Hagemeister
b972fc996b fix: add missing null check 2025-01-03 12:18:44 +01:00
Marvin Hagemeister
0c1f93e6ee chore: remove cancellation branch 2025-01-03 12:16:29 +01:00
Marvin Hagemeister
6cf3a274d1 fix: missing argument 2025-01-03 11:31:26 +01:00
Marvin Hagemeister
b85974b2db feat: add missing fixer methods 2025-01-03 11:29:05 +01:00
Marvin Hagemeister
adc25f85a1 feat: support excluding rules from lint plugins 2025-01-03 11:03:28 +01:00
Bartek Iwańczuk
2edd30904a
update for deno_lint changes 2025-01-02 19:07:55 +01:00
Marvin Hagemeister
321e37bf2e feat: support js lint plugins fixes 2025-01-02 16:28:13 +01:00
Bartek Iwańczuk
554bce98b5
Merge branch 'main' into lint_plugins 2025-01-02 10:35:12 +01:00
Kenta Moriuchi
8fb073d7b4
chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
Marvin Hagemeister
fdd0edf23c
fix(unstable): don't error on non-existing attrs or type attr (#27456)
When running selectors for JS linting plugins we would error when
encountering an unknown attribute name:

```js
// selector
Foo[non-existant]

// error
Error: Missing string id: <number>
```

This was caused by using `0` as the invalid marker, but also overloading
`0` with an actual node type. So the fix is to reserve `0` as the
invalid marker and move the property type to the next index.
2024-12-27 22:46:29 +01:00
Bartek Iwańczuk
a6d1f1116f
add support for hint 2024-12-26 13:38:52 +01:00
Bartek Iwańczuk
2d7ef0660d
revert 2024-12-26 11:32:54 +01:00
Bartek Iwańczuk
1a0a61d059
cleanup 2024-12-26 11:26:04 +01:00
Bartek Iwańczuk
f8e8f251a4
smaller diff 2024-12-26 11:19:34 +01:00
Bartek Iwańczuk
c1e3357d2c
add CancellationToken, but not wired up yet 2024-12-26 11:18:49 +01:00
Bartek Iwańczuk
05a89f5ffb
add PluginLogger, finally works in the LSP 2024-12-25 15:18:50 +01:00
Bartek Iwańczuk
7be95bbb6d
revert types change 2024-12-23 09:41:39 +01:00
Bartek Iwańczuk
fdea4eaa7e
type 2024-12-23 08:53:30 +01:00
Bartek Iwańczuk
a6d1032891
remove duplicate types 2024-12-23 08:52:46 +01:00
Bartek Iwańczuk
46db6dd14d
Merge branch 'main' into lint_plugins 2024-12-23 08:50:34 +01:00
Marvin Hagemeister
1a809b8115
feat(unstable): support selectors in JS lint plugins (#27452)
This PR adds support for using selectors in the JS linting plugin API.
Supported at the moment are:

- `Foo Bar` (descendant)
- `Foo > Bar` (child combinator)
- `Foo + Foo` (next sibling)
- `Foo ~ Foo` (subsequent sibling)
- `[attr]`, `[attr=value]` (attribute selectors, supported operators:
`=`, `!=`, `<`, `>`, `<=`, `>=`)
- `:first-child`
- `:last-child`
- `:nth-child(2)`, `:nth-child(2n + 1)`
2024-12-23 08:45:47 +01:00
Bartek Iwańczuk
06ddb574f3
remove dead code 2024-12-22 21:25:42 +01:00
Bartek Iwańczuk
66f22d83a2
fix the plugin 2024-12-22 21:02:39 +01:00
Bartek Iwańczuk
c831535ac9
revert selector changes 2024-12-21 16:28:17 +01:00
Bartek Iwańczuk
67e2d06c34
Try to load files differently 2024-12-21 16:08:47 +01:00
Bartek Iwańczuk
fcfd4c09b5
wip after merge 2024-12-21 02:38:23 +01:00
Bartek Iwańczuk
d3e41a770a
Merge branch 'main' into lint_plugins 2024-12-21 02:28:39 +01:00
Marvin Hagemeister
26425a137b
feat(unstable): add JS linting plugin infrastructure (#27416)
This PR extracts the core part of
https://github.com/denoland/deno/pull/27203 to make it easier to review
and land in parts.

It contains:
-  The JS plugin code the deserializes and walks the buffer
- The Rust portion to serialize SWC to the buffer format (a bunch of
nodes are still todos, but imo these can land anytime later)
- Basic lint plugin types, without the AST node types to make this PR
easier to review
- Added more code comments to explain the format etc.


More fixes and changes will be done in follow-up PRs.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-12-21 00:58:03 +01:00
Marvin Hagemeister
321a1fe57e fix: sibling selectors 2024-12-18 11:31:11 +01:00
Marvin Hagemeister
dde9f52dd0 fix: descendant selector 2024-12-17 23:44:25 +01:00
Marvin Hagemeister
6e70ba2c77 get selector integration working 2024-12-17 12:04:12 +01:00
Marvin Hagemeister
d9fd959820 integrate selctors part 1 2024-12-17 01:20:21 +01:00
Marvin Hagemeister
132db5604f fix nth child 2024-12-17 00:22:02 +01:00
Marvin Hagemeister
e542ba8b4e fix selector parser 2024-12-16 19:32:47 +01:00
Marvin Hagemeister
2f18594ca8 WIP 2024-12-16 18:16:29 +01:00
Marvin Hagemeister
86fc6e64cb WIP 2024-12-16 16:17:02 +01:00
Marvin Hagemeister
3f9ee0d6df feat(lint): support visitor selector syntax 2024-12-15 22:56:50 +01:00
Marvin Hagemeister
ea11f95029 make js plugins independent of ast strucure 2024-12-15 19:18:30 +01:00