Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}'),
Boshen marked this conversation as resolved.
Show resolved Hide resolved
],
},
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
Loading