Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

denolint: no way to use a config file and check only some folders #635

Open
Conaclos opened this issue May 20, 2022 · 1 comment · May be fixed by #645 or #647
Open

denolint: no way to use a config file and check only some folders #635

Conaclos opened this issue May 20, 2022 · 1 comment · May be fixed by #645 or #647

Comments

@Conaclos
Copy link

Hi!

I would like to include some linting rules and exclude the dist directory.
The files field seems not supported in the config file. The combination of a config file and a path as argument seem not supported either (the path is ignored).

I tried the following config file:

{
  "files": {
    "include": ["src/"],
    "exclude": ["dist/"]
  },
  "rules": {
    "tags": ["recommended"],
    "include": [
      "camelcase"
    ]
  }
}

And the following commands:

npx denolint --config denolint.json
npx denolint --config denolint.json src/

It could be nice whether one of this (or both) could be supported.

Conaclos added a commit to bare-ts/bare that referenced this issue May 20, 2022
Note that we also lint tests-corpus to ensure that
bare-ts generates high-quality codes.

For now, we do not use the config file because
it does not take into account the field `files`.
I opened an issue for that:

  napi-rs/node-rs#635

I added a config files for deno lint command.
This allows to manually check extra rules:

  deno lint --config .deno.json

Note that some rules are violated.
I excluded scripts and tests-corpus to avoid excessive rule vilation.
These two problems come from bugs that are reported:

  denoland/deno_lint#1018
  denoland/deno_lint#1048
  denoland/deno_lint#1049
Conaclos added a commit to bare-ts/bare that referenced this issue May 24, 2022
Note that we also lint tests-corpus to ensure that
bare-ts generates high-quality codes.

For now, we do not use the config file because
it does not take into account the field `files`.
I opened an issue for that:

  napi-rs/node-rs#635

I added a config files for deno lint command.
This allows to manually check extra rules:

  deno lint --config .deno.json

Note that some rules are violated.
I excluded scripts and tests-corpus to avoid excessive rule vilation.
These two problems come from bugs that are reported:

  denoland/deno_lint#1018
  denoland/deno_lint#1048
  denoland/deno_lint#1049
Conaclos added a commit to bare-ts/bare that referenced this issue May 24, 2022
Note that we also lint tests-corpus to ensure that
bare-ts generates high-quality codes.

For now, we do not use the config file because
it does not take into account the field `files`.
I opened an issue for that:

  napi-rs/node-rs#635

I added a config files for deno lint command.
This allows to manually check extra rules:

  deno lint --config .deno.json

Note that some rules are violated.
I excluded scripts and tests-corpus to avoid excessive rule vilation.
These two problems come from bugs that are reported:

  denoland/deno_lint#1018
  denoland/deno_lint#1048
  denoland/deno_lint#1049
Conaclos added a commit to bare-ts/bare that referenced this issue May 24, 2022
Note that we also lint tests-corpus to ensure that
bare-ts generates high-quality codes.

For now, we do not use the config file because
it does not take into account the field `files`.
I opened an issue for that:

  napi-rs/node-rs#635

I added a config files for deno lint command.
This allows to manually check extra rules:

  deno lint --config .deno.json

Note that some rules are violated.
I excluded scripts and tests-corpus to avoid excessive rule vilation.
These two problems come from bugs that are reported:

  denoland/deno_lint#1018
  denoland/deno_lint#1048
  denoland/deno_lint#1049
@prantlf
Copy link
Contributor

prantlf commented Sep 24, 2022

This seems to be a duplicate of #631.

UPDATE: On a second thought, it's not an exact duplicate. Although you could use the lint function for each file, you'd have to write your own script wrapper. And if you did, you wouldn't be able to specify excluded rules. Supporting files.include in .denolint.json seems to be the easiest way how to support projects which don't want to check all files in the current directory.

prantlf added a commit to prantlf/denolint that referenced this issue Sep 28, 2022
This is the first version released after forking the [customisation] of the [original project].

* Scan specific directories ([631], [647])
* Scan directories configured by `files.include` ([635], [645])
* Fix handling of the configuration `files.exclude` ([635], [646])
* Support disabling rules in souces using `eslint-disable` ([630], [642])
* Support including and excluding rules in the `lint` method ([631], [643])
* Execute the command-line tool `denolint` without loading the Node.js VM ([648])
* Allow specifying directories, files and patterns as input for checking

[customisation]: https://github.com/prantlf/node-rs/commits/combined
[original project]: https://github.com/napi-rs/node-rs/tree/main/packages/deno-lint
[630]: napi-rs/node-rs#630
[631]: napi-rs/node-rs#631
[635]: napi-rs/node-rs#635
[642]: napi-rs/node-rs#642
[643]: napi-rs/node-rs#643
[645]: napi-rs/node-rs#645
[646]: napi-rs/node-rs#646
[647]: napi-rs/node-rs#647
[648]: napi-rs/node-rs#648
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants