Summary
Rslint should consider supporting the ESLint flat config basePath option on config entries.
In ESLint, basePath sets a subdirectory base for a config object. Relative basePath values are resolved from the config file directory, or from cwd when using an alternate config via --config; files and ignores in that object are then resolved relative to that base path.
Why
Rslint recently aligned explicit --config handling with ESLint by resolving files, ignores, and parserOptions.project from cwd. Supporting basePath would close the next compatibility gap for users sharing or migrating ESLint flat configs.
Without support, configs like this are silently interpreted with the wrong match base:
export default [
{
basePath: 'packages/foo',
files: ['src/**/*.ts'],
ignores: ['fixtures/**'],
},
];
Suggested behavior
- Add
basePath?: string to config entries.
- Resolve relative
basePath from the config directory for auto-discovered configs.
- Resolve relative
basePath from cwd for explicit --config configs.
- Resolve that entry's
files, ignores, and languageOptions.parserOptions.project relative to the effective base path.
- Treat
{ basePath, ignores } as a global ignore entry, matching ESLint's intent for scoped global ignores.
References
Summary
Rslint should consider supporting the ESLint flat config
basePathoption on config entries.In ESLint,
basePathsets a subdirectory base for a config object. RelativebasePathvalues are resolved from the config file directory, or from cwd when using an alternate config via--config;filesandignoresin that object are then resolved relative to that base path.Why
Rslint recently aligned explicit
--confighandling with ESLint by resolvingfiles,ignores, andparserOptions.projectfrom cwd. SupportingbasePathwould close the next compatibility gap for users sharing or migrating ESLint flat configs.Without support, configs like this are silently interpreted with the wrong match base:
Suggested behavior
basePath?: stringto config entries.basePathfrom the config directory for auto-discovered configs.basePathfrom cwd for explicit--configconfigs.files,ignores, andlanguageOptions.parserOptions.projectrelative to the effective base path.{ basePath, ignores }as a global ignore entry, matching ESLint's intent for scoped global ignores.References