fix(vscode)!: use .oxlintrc.json as default value for oxc.configPath (#7442)

**BREAKING CHANGE**: VSCode-Client does not watch for `eslint`
configuration files. Default value for `oxc.configPath` is now
`.oxlintrc.json` instead of `.eslintrc`
This commit is contained in:
Alexander S. 2024-11-24 05:32:44 +01:00 committed by GitHub
parent 84fcc43cf5
commit b04041d1cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 10 deletions

View file

@ -19,7 +19,7 @@ export class Config implements ConfigInterface {
this._runTrigger = conf.get<Trigger>('lint.run') || 'onType'; this._runTrigger = conf.get<Trigger>('lint.run') || 'onType';
this._enable = conf.get<boolean>('enable') ?? true; this._enable = conf.get<boolean>('enable') ?? true;
this._trace = conf.get<TraceLevel>('trace.server') || 'off'; this._trace = conf.get<TraceLevel>('trace.server') || 'off';
this._configPath = conf.get<string>('configPath') || '.eslintrc'; this._configPath = conf.get<string>('configPath') || '.oxlintrc.json';
this._binPath = conf.get<string>('path.server'); this._binPath = conf.get<string>('path.server');
} }
@ -124,7 +124,7 @@ interface ConfigInterface {
* *
* `oxc.configPath` * `oxc.configPath`
* *
* @default ".eslintrc" * @default ".oxlintrc.json"
*/ */
configPath: string; configPath: string;
/** /**

View file

@ -16,7 +16,7 @@ suite('Config', () => {
strictEqual(config.runTrigger, 'onType'); strictEqual(config.runTrigger, 'onType');
strictEqual(config.enable, true); strictEqual(config.enable, true);
strictEqual(config.trace, 'off'); strictEqual(config.trace, 'off');
strictEqual(config.configPath, '.eslintrc'); strictEqual(config.configPath, '.oxlintrc.json');
strictEqual(config.binPath, ''); strictEqual(config.binPath, '');
}); });

View file

@ -142,8 +142,7 @@ export async function activate(context: ExtensionContext) {
synchronize: { synchronize: {
// Notify the server about file config changes in the workspace // Notify the server about file config changes in the workspace
fileEvents: [ fileEvents: [
workspace.createFileSystemWatcher('**/.eslintr{c,c.json}'), workspace.createFileSystemWatcher('**/.oxlint{.json,rc.json}'),
workspace.createFileSystemWatcher('**/.oxlint{.json,rc.json,rc}'),
workspace.createFileSystemWatcher('**/oxlint{.json,rc.json}'), workspace.createFileSystemWatcher('**/oxlint{.json,rc.json}'),
], ],
}, },

View file

@ -92,7 +92,7 @@
"oxc.configPath": { "oxc.configPath": {
"type": "string", "type": "string",
"scope": "window", "scope": "window",
"default": ".eslintrc", "default": ".oxlintrc.json",
"description": "Path to ESlint configuration." "description": "Path to ESlint configuration."
}, },
"oxc.path.server": { "oxc.path.server": {
@ -108,8 +108,7 @@
"oxlintrc.json", "oxlintrc.json",
"oxlint.json", "oxlint.json",
".oxlintrc.json", ".oxlintrc.json",
".oxlint.json", ".oxlint.json"
".oxlintrc"
], ],
"url": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json" "url": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json"
} }
@ -121,8 +120,7 @@
"oxlintrc.json", "oxlintrc.json",
"oxlint.json", "oxlint.json",
".oxlintrc.json", ".oxlintrc.json",
".oxlint.json", ".oxlint.json"
".oxlintrc"
] ]
} }
] ]