Commit graph

2 commits

Author SHA1 Message Date
camchenry
e88cf1bfd6 fix(linter): make overrides globs relative to config path (#7407)
- fixes https://github.com/oxc-project/oxc/issues/7365

currently, we are matching globs on the absolute path to the file, which means that in order to properly match, all globs would need to start with `**/`. this is not consistent with the behavior in ESLint, which is defined here:  https://eslint.org/docs/v8.x/use/configure/configuration-files#how-do-overrides-work

> **The patterns are applied against the file path relative to the directory of the config file.** For example, if your config file has the path `/Users/john/workspace/any-project/.eslintrc.js` and the file you want to lint has the path `/Users/john/workspace/any-project/lib/util.js`, then the pattern provided in `.eslintrc.js` is executed against the relative path `lib/util.js`.

This PR adds the ability to store the path to the configuration file along with the configuration data, so that we can later use it to resolve the relative paths of the files in the overrides section.

I'm not exactly sure if this will still make sense with nested configuration files, but I think it makes sense to store a path to each configuration file, alongside where the overrides are stored.
2024-11-22 14:37:45 +00:00
DonIsaac
2268a0ef90 feat(linter): support overrides config field (#6974)
Part of #5653
2024-11-13 05:40:59 +00:00