0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-12 16:59:32 -05:00
Commit graph

59 commits

Author SHA1 Message Date
Bartek Iwańczuk
a446c89620
remove --plugins flag support for now 2024-12-22 21:35:29 +01:00
Bartek Iwańczuk
8479e9541d
update a todo 2024-12-22 21:04:55 +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
Bartek Iwańczuk
53a680bded
Merge branch 'main' into lint_plugins 2024-12-18 05:35:56 +01:00
Bartek Iwańczuk
f9add94e17
refactor(lint): renames and code flattening (#27386)
Working on loading plugin configuration for
https://github.com/denoland/deno/pull/27203
I encountered a lot of complexity, so did some drive-by cleanups to make
it easier to grok the code and have fewer duplicate names.
2024-12-17 01:35:26 +00:00
Marvin Hagemeister
f167277561 remove dead code 2024-12-15 22:57:55 +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
Marvin Hagemeister
c83f722039 Refactor binary ast 2024-12-12 22:16:49 +01:00
Marvin Hagemeister
dda408b019 fix: clippy 2024-12-12 10:53:12 +01:00
Bartek Iwańczuk
dd42a64c43
refactor(lint): manage schema files for linter in Deno repo (#27324)
This commit provides schema files for lint rules and lint tags
in this repo instead of pulling them from `deno_lint` repository.

A unit test was added to ensure all available rules are listed
in the schema file. A unit test for tags can be done once 
https://github.com/denoland/deno/pull/27162 lands.
2024-12-11 02:06:04 +01:00
Marvin Hagemeister
c734214c41 WIP 2024-12-06 21:31:28 +01:00
Marvin Hagemeister
a14820586f fix: only invoke lint plugin runner when there are plugins 2024-12-04 12:08:19 +01:00
Bartek Iwańczuk
052a035c23
plugins can be authored in TS 2024-12-04 02:59:39 +01:00
Bartek Iwańczuk
3e1e46d4b1
almost working with regular cli worker 2024-12-04 02:37:04 +01:00
Bartek Iwańczuk
106b1f135c
load plugins from a config file 2024-12-04 01:43:19 +01:00
Marvin Hagemeister
5a950e5cf0 drop!: temporary disable lint cache 2024-12-03 15:34:39 +01:00
Marvin Hagemeister
77526ca036 fix: show correct specifier in error output 2024-12-03 15:34:27 +01:00
Bartek Iwańczuk
37bafdc66a
remove debug log, lint 2024-12-03 13:56:47 +01:00
Bartek Iwańczuk
5a6c12861f
add basic traversal 2024-12-03 02:51:29 +01:00
Bartek Iwańczuk
f9291e419f
basic range 2024-12-02 18:29:30 +01:00
Bartek Iwańczuk
5639379e45
declarative 2024-12-02 17:00:49 +01:00
Bartek Iwańczuk
c9fa293b9d
load plugins from a flag 2024-12-02 15:34:53 +01:00
Bartek Iwańczuk
7f45875211
first diagnostic from a plugin! 2024-12-02 02:27:30 +01:00
Bartek Iwańczuk
bc00517f9e
req -> resp 2024-12-02 01:57:49 +01:00
Bartek Iwańczuk
1fdcbd926a
PluginRunner and PluginRunnerProxy 2024-12-02 01:38:54 +01:00
Bartek Iwańczuk
99d70c9529
actually pass AST to plugin 2024-12-01 14:26:15 +01:00
Bartek Iwańczuk
79b5c3e625
basic plugin loading 2024-12-01 03:21:16 +01:00
Bartek Iwańczuk
106d47a013
feat: fmt and lint respect .gitignore file (#26897)
Closes https://github.com/denoland/deno/issues/26573
2024-11-18 23:54:28 +01:00
HasanAlrimawi
abf06eb87f
feat(watch): log which file changed on HMR or watch change (#25801)
Closes #25504
2024-11-16 15:59:31 +01:00
snek
4e899d48cf
fix: otel resiliency (#26857)
Improving the breadth of collected data, and ensuring that the collected
data is more likely to be successfully reported.

- Use `log` crate in more places
- Hook up `log` crate to otel
- Switch to process-wide otel processors
- Handle places that use `process::exit`

Also adds a more robust testing framework, with a deterministic tracing
setting.

Refs: https://github.com/denoland/deno/issues/26852
2024-11-14 12:16:28 +00:00
David Sherret
f091d1ad69
feat(node): stabilize detecting if CJS via "type": "commonjs" in a package.json (#26439)
This will respect `"type": "commonjs"` in a package.json to determine if
`.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to
be ESM it will be loaded as ESM though.
2024-11-13 15:10:09 +00:00
Leo Kettmeir
bb45446fa7
fix: don't include extensionless files in file collection for lint & fmt by default (#25721)
When using the `ext` flag, it will still attempt formatting them with
the provided extension
2024-09-19 11:25:48 +02:00
Leo Kettmeir
a1d0a427e8
feat: default to TS for file extension and support ext flag in more scenarios (#25472)
Closes #11220
Currently does lint, fmt, and repl
2024-09-18 21:15:13 +02:00
Kamil Ogórek
2c4d99a458
feat: include version number in all --json based outputs (#25335)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-05 08:51:40 +00:00
Yazan AbdAl-Rahman
4285cb339d
fix(lint): support linting tsx/jsx from stdin (#24955)
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-08-19 20:42:13 +00:00
David Sherret
9956737941
refactor(lint): move reporters to separate module (#24757) 2024-07-27 09:01:42 -04:00
David Sherret
763f05e74d
fix(unstable): move sloppy-import warnings to lint rule (#24710)
Adds a new `no-sloppy-imports` lint rule and cleans up the lint code.

Closes #22844
Closes https://github.com/denoland/deno_lint/issues/1293
2024-07-25 09:07:59 -04:00
David Sherret
9114a2df69
fix(upgrade): do not error if config in cwd invalid (#24689)
```
> deno upgrade
error: Unsupported lockfile version 'invalid'. Try upgrading Deno or recreating the lockfile.
V:\scratch
> V:\deno\target\debug\deno upgrade
Looking up latest version
Local deno version 1.45.3 is the most recent release
```

Closes #24517
Closes #20729
2024-07-23 19:00:48 -04:00
HasanAlrimawi
f0df54fc70
fix: enable the reporting of parsing related problems when running deno lint (#24332) 2024-07-23 21:17:17 +00:00
David Sherret
afcae364be
refactor: update to deno_config 0.25 (#24645)
- Gets rid of WorkspaceMemberContext. It's now `Workspace` and
`WorkspaceDirectory`
- Uses the workspace cache in the lsp

* https://github.com/denoland/deno_config/pull/95
* https://github.com/denoland/deno_config/pull/96
2024-07-19 15:56:07 -04:00
David Sherret
86010bec09
fix(workspace): better cli file argument handling (#24447)
Closes https://github.com/denoland/deno/issues/24422
2024-07-08 14:12:10 +00:00
David Sherret
80df9aec1d
refactor: move FileCollector to deno_config (#24433) 2024-07-05 17:53:09 -04:00
David Sherret
147411e64b
feat: npm workspace and better Deno workspace support (#24334)
Adds much better support for the unstable Deno workspaces as well as
support for npm workspaces. npm workspaces is still lacking in that we
only install packages into the root node_modules folder. We'll make it
smarter over time in order for it to figure out when to add node_modules
folders within packages.

This includes a breaking change in config file resolution where we stop
searching for config files on the first found package.json unless it's
in a workspace. For the previous behaviour, the root deno.json needs to
be updated to be a workspace by adding `"workspace":
["./path-to-pkg-json-folder-goes-here"]`. See details in
https://github.com/denoland/deno_config/pull/66

Closes #24340
Closes #24159
Closes #24161
Closes #22020
Closes #18546
Closes #16106
Closes #24160
2024-07-04 00:54:33 +00:00
David Sherret
0da01c0ca6
refactor: move PackageJson to deno_config (#24348) 2024-06-26 21:24:10 +00:00
David Sherret
78774dd664
fix: do not panic linting files with UTF-8 BOM (#24136)
Closes #24122
2024-06-07 17:02:47 +00:00
David Sherret
7ed90a20d0
fix: better handling of npm resolution occurring on workers (#24094)
Closes https://github.com/denoland/deno/issues/24063
2024-06-05 17:04:16 +02:00
Luca Casonato
e084fe10a9
feat(lint): add no-boolean-literal-for-arguments rule and enable no-unused-vars for jsx files (#24034)
* https://github.com/denoland/deno_lint/pull/1271
* https://github.com/denoland/deno_lint/pull/1277

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-30 00:09:16 +00:00
David Sherret
47f7bed677
chore: enable clippy::print_stdout and clippy::print_stderr (#23732)
1. Generally we should prefer to use the `log` crate.
2. I very often accidentally commit `eprintln`s.

When we should use `println` or `eprintln`, it's not too bad to be a bit
more verbose and ignore the lint rule.
2024-05-08 22:45:06 -04:00