Skip to content

Commit

Permalink
fix(vscode)!: use .oxlintrc.json as default value for `oxc.configPa…
Browse files Browse the repository at this point in the history
…th` (#7442)

**BREAKING CHANGE**: VSCode-Client does not watch for `eslint`
configuration files. Default value for `oxc.configPath` is now
`.oxlintrc.json` instead of `.eslintrc`
  • Loading branch information
Sysix authored Nov 24, 2024
1 parent 84fcc43 commit b04041d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions editors/vscode/client/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class Config implements ConfigInterface {
this._runTrigger = conf.get<Trigger>('lint.run') || 'onType';
this._enable = conf.get<boolean>('enable') ?? true;
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');
}

Expand Down Expand Up @@ -124,7 +124,7 @@ interface ConfigInterface {
*
* `oxc.configPath`
*
* @default ".eslintrc"
* @default ".oxlintrc.json"
*/
configPath: string;
/**
Expand Down
2 changes: 1 addition & 1 deletion editors/vscode/client/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ suite('Config', () => {
strictEqual(config.runTrigger, 'onType');
strictEqual(config.enable, true);
strictEqual(config.trace, 'off');
strictEqual(config.configPath, '.eslintrc');
strictEqual(config.configPath, '.oxlintrc.json');
strictEqual(config.binPath, '');
});

Expand Down
3 changes: 1 addition & 2 deletions editors/vscode/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ export async function activate(context: ExtensionContext) {
synchronize: {
// Notify the server about file config changes in the workspace
fileEvents: [
workspace.createFileSystemWatcher('**/.eslintr{c,c.json}'),
workspace.createFileSystemWatcher('**/.oxlint{.json,rc.json,rc}'),
workspace.createFileSystemWatcher('**/.oxlint{.json,rc.json}'),
workspace.createFileSystemWatcher('**/oxlint{.json,rc.json}'),
],
},
Expand Down
8 changes: 3 additions & 5 deletions editors/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"oxc.configPath": {
"type": "string",
"scope": "window",
"default": ".eslintrc",
"default": ".oxlintrc.json",
"description": "Path to ESlint configuration."
},
"oxc.path.server": {
Expand All @@ -108,8 +108,7 @@
"oxlintrc.json",
"oxlint.json",
".oxlintrc.json",
".oxlint.json",
".oxlintrc"
".oxlint.json"
],
"url": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json"
}
Expand All @@ -121,8 +120,7 @@
"oxlintrc.json",
"oxlint.json",
".oxlintrc.json",
".oxlint.json",
".oxlintrc"
".oxlint.json"
]
}
]
Expand Down

0 comments on commit b04041d

Please sign in to comment.