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: import-plugin lints unexpected files #8631

Open
spmiller opened this issue Jan 21, 2025 · 0 comments
Open

linter: import-plugin lints unexpected files #8631

spmiller opened this issue Jan 21, 2025 · 0 comments
Labels
A-linter Area - Linter C-bug Category - Bug

Comments

@spmiller
Copy link

What version of Oxlint are you using?

latest

What command did you run?

npx oxlint@latest --import-plugin -A all

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

No config file

What happened?

Enabling the import-plugin starts linting files in the node_modules directory which cannot be disabled. Errors are not detected when the linter is run without the import-plugin enabled.

Steps to reproduce:

  1. Add a library with code that triggers a linting error (we used [email protected])
  2. Include at least one TS file that imports the library (the bug is not triggered without an import; both .ts and .mjs files trigger the issue)
  3. Run oxlint enabling the import-plugin

Expected output:

Finished in 12ms on 1 file with 0 rules using 16 threads.
Found 0 warnings and 0 errors.

Actual output:

  × '0'-prefixed octal literals and octal escape sequences are deprecated
     ╭─[node_modules/temp/lib/temp.js:226:21]
 225 │   var dirPath = generateName(affixes, 'd-');
 226 │   fs.mkdir(dirPath, 0700, function(err) {
     ·                     ────
 227 │     if (!err) {
     ╰────
  help: for octal literals use the '0o' prefix instead

....

Finished in 11ms on 1 file with 0 rules using 16 threads.
Found 0 warnings and 5 errors.

Using --ignore-pattern does not seem to have any effect, e.g. the bug is still reproduced when using --ignore-pattern "**/*.js" or --ignore-pattern "node_modules.

package.json:

{
  "name": "repo",
  "version": "1.0.0",
  "dependencies": {
    "temp": "^0.8.3"
  }
}

test.ts:

import * as temp from 'temp';
@spmiller spmiller added A-linter Area - Linter C-bug Category - Bug labels Jan 21, 2025
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
Projects
None yet
Development

No branches or pull requests

1 participant