summaryrefslogtreecommitdiff
path: root/cli/tools/lint
AgeCommit message (Collapse)Author
2024-11-18feat: fmt and lint respect .gitignore file (#26897)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/26573
2024-11-16feat(watch): log which file changed on HMR or watch change (#25801)HasanAlrimawi
Closes #25504
2024-11-14fix: otel resiliency (#26857)snek
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-13feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a ↵David Sherret
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-09-28refactor: extract out sloppy imports resolution from CLI crate (#25920)David Sherret
This is slow progress towards creating a `deno_resolver` crate. Waiting on: * https://github.com/denoland/deno/pull/25918 * https://github.com/denoland/deno/pull/25916
2024-09-19fix: don't include extensionless files in file collection for lint & fmt by ↵Leo Kettmeir
default (#25721) When using the `ext` flag, it will still attempt formatting them with the provided extension
2024-09-18feat: default to TS for file extension and support ext flag in more ↵Leo Kettmeir
scenarios (#25472) Closes #11220 Currently does lint, fmt, and repl
2024-09-05feat: include version number in all --json based outputs (#25335)Kamil Ogórek
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-08-20feat(unstable): ability to use a local copy of jsr packages (#25068)David Sherret
2024-08-19fix(lint): support linting tsx/jsx from stdin (#24955)Yazan AbdAl-Rahman
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-08-15feat(lint): Add lint for usage of node globals (with autofix) (#25048)Nathan Whitaker
From upgrading `deno_lint`. Previously if you had a node project that used a bunch of node globals (`process.env`, etc), you would have to fix the errors by hand. This PR includes a new lint that detects usages of node globals (`process`, `setImmediate`, `Buffer`, etc.) and provides an autofix to import the correct value. For instance: ```ts // main.ts const _foo = process.env.FOO; ``` `deno lint` gives you ```ts error[no-node-globals]: NodeJS globals are not available in Deno --> /home/foo.ts:1:14 | 1 | const _foo = process.env.FOO; | ^^^^^^^ = hint: Add `import process from "node:process";` docs: https://lint.deno.land/rules/no-node-globals Found 1 problem (1 fixable via --fix) Checked 1 file ``` And `deno lint --fix` adds the import for you: ```ts // main.ts import process from "node:process"; const _foo = process.env.FOO; ```
2024-08-07fix(compile): support workspace members importing other members (#24909)David Sherret
2024-07-27refactor(lint): move reporters to separate module (#24757)David Sherret
2024-07-25fix(unstable): move sloppy-import warnings to lint rule (#24710)David Sherret
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-23fix(upgrade): do not error if config in cwd invalid (#24689)David Sherret
``` > 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-23fix: enable the reporting of parsing related problems when running deno lint ↵HasanAlrimawi
(#24332)
2024-07-19refactor: update to deno_config 0.25 (#24645)David Sherret
- 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-08fix(workspace): better cli file argument handling (#24447)David Sherret
Closes https://github.com/denoland/deno/issues/24422
2024-07-05refactor: move `FileCollector` to deno_config (#24433)David Sherret
2024-07-04feat: npm workspace and better Deno workspace support (#24334)David Sherret
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-06-26refactor: move PackageJson to deno_config (#24348)David Sherret
2024-06-07fix: do not panic linting files with UTF-8 BOM (#24136)David Sherret
Closes #24122
2024-06-05fix: better handling of npm resolution occurring on workers (#24094)David Sherret
Closes https://github.com/denoland/deno/issues/24063
2024-05-30feat(lint): add `no-boolean-literal-for-arguments` rule and enable ↵Luca Casonato
`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-08chore: enable clippy::print_stdout and clippy::print_stderr (#23732)David Sherret
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-03-27fix: less aggressive vendor folder ignoring (#23100)David Sherret
This is slightly breaking as some users want the `vendor` folder excluded and may not have that specified in their deno.json. Closes #22833
2024-03-26refactor(lsp): unify config file data into ConfigTree (#23032)Nayeem Rahman
2024-03-25feat(lint): automatically opt-in packages to `jsr` lint tag (#23072)David Sherret
This automatically opts packages (deno.json's with a name, version, and exports field) into the "jsr" lint tag.
2024-03-21feat(lint): `deno lint --fix` and lsp quick fixes (#22615)David Sherret
Adds a `--fix` option to deno lint. This currently doesn't work for basically any rules, but we can add them over time to deno lint.
2024-03-11chore: enable clippy unused_async rule (#22834)David Sherret
2024-03-07fix(publish): make include and exclude work (#22720)David Sherret
1. Stops `deno publish` using some custom include/exclude behaviour from other sub commands 2. Takes ancestor directories into account when resolving gitignore 3. Backards compatible change that adds ability to unexclude an exclude by using a negated glob at a more specific level for all sub commands (see https://github.com/denoland/deno_config/pull/44).
2024-03-07fix(publish): properly display graph validation errors (#22775)David Sherret
The graph validation errors were displaying cryptically during publish. This fixes that.
2024-02-20perf(jsr): fast check cache and lazy fast check graph (#22485)David Sherret
2024-02-19feat(unstable/lint): no-slow-types for JSR packages (#22430)David Sherret
1. Renames zap/fast-check to instead be a `no-slow-types` lint rule. 1. This lint rule is automatically run when doing `deno lint` for packages (deno.json files with a name, version, and exports field) 1. This lint rules still occurs on publish. It can be skipped by running with `--no-slow-types`