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

linter: plugin tree_shaking is enabled by default #7031

Open
Sysix opened this issue Oct 30, 2024 · 0 comments · May be fixed by #7057
Open

linter: plugin tree_shaking is enabled by default #7031

Sysix opened this issue Oct 30, 2024 · 0 comments · May be fixed by #7057
Labels
A-linter Area - Linter C-bug Category - Bug good first issue Experience Level - Good for newcomers

Comments

@Sysix
Copy link
Contributor

Sysix commented Oct 30, 2024

What version of Oxlint are you using?

latest

What command did you run?

npx oxlint --config=oxlint.json --disable-typescript-plugin --disable-oxc-plugin --disable-unicorn-plugin --disable-react-plugin

What does your .oxlint.json config file look like?

{
  "categories": {
    "correctness": "off",
    "nursery": "deny"
  }
}

What happened?

With this configuration I get the eslint-plugin-tree-shaking enabled.

  × eslint-plugin-tree-shaking(no-side-effects-in-initialization): Cannot determine side-effects of calling member function
   ╭─[scripts/constants.ts:5:33]
 4 │ 
 5 │ export const TARGET_DIRECTORY = path.resolve(__dirname, '..', '.oxc_sparse');
   ·                                 ────────────
 6 │ export const VERSION_PREFIX = 'oxlint_v';
   ╰────

Finished in 18ms on 21 files with 5 rules using 24 threads.

I can't disable it

@Sysix Sysix added A-linter Area - Linter C-bug Category - Bug labels Oct 30, 2024
@Boshen Boshen added the good first issue Experience Level - Good for newcomers label Oct 31, 2024
Boshen pushed a commit to oxc-project/eslint-plugin-oxlint that referenced this issue Nov 2, 2024
closes #194 

Long way for the goal:

- [x] support simple "rules" block
- [x] support simple "categories" block
- [x] support simple "plugins" block
- [x] support "categories" on, and "rules" off *
- [x] support "plugins" on, and "rules off *
- [x] numbers instead of `off`, `warn` or `error`
- [x] configuration array like: `no-magic_numbers: ["off", {...}]`
- [x] filter rules which are not enabled by plugin
- [x] all other wierd combinations
- [x] enable eslint always
- [x] check import from `../scripts` folder in build file
- [x] support jsonc / comments in files
- [x] prepare for overrides oxc-project/oxc#6974
- [x] Docs
- [x] more tests
  - [x] test rules count with oxlint command
- [x] ~~depends on oxc-project/oxc#6896
workaround in tests
- [x] ~~depends on oxc-project/oxc#7031
disabled `nursery` in integration test

\* the rules block overrides the rules from the other blocks, so this
should be enabled in eslint

```json
{
  "categories": {
    "correctness": "error",
  }
  "rules": {
    "no-invalid-regexp": "off"
  }
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-bug Category - Bug good first issue Experience Level - Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants