oxc-project / oxc

⚓ A collection of JavaScript tools written in Rust.
https://oxc.rs
MIT License
12.29k stars 446 forks source link

linter: add support "files" in config #7096

Open pumano opened 4 days ago

pumano commented 4 days ago

What version of Oxlint are you using?

0.11.0

What command did you run?

No response

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

Proposed config:

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": ["import", "unicorn"],
  "files": ["**/*.ts", "**/*.tsx"],
  "rules": {
    "import/no-commonjs": "error",
    "import/no-cycle": "error",
    "import/no-duplicates": "error",
    "import/no-self-import": "error"
  }
}

What happened?

"files" should be supported, because it target some rules for specific file types. In my case i use import/no-commonjs rule against only *.ts files and skip *.js files

pumano commented 3 days ago

looks like "files" covered somehow only in upcoming "overrides" section: https://github.com/oxc-project/oxc/pull/6974/ but not in root too.

DonIsaac commented 3 days ago

Should be trivial to add once overrides PR is in.

Apologies, that one is blocked by me- I still need to perform more intense testing