Skip to content

Commit b04041d

Browse files
authored
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`
1 parent 84fcc43 commit b04041d

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

editors/vscode/client/Config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class Config implements ConfigInterface {
1919
this._runTrigger = conf.get<Trigger>('lint.run') || 'onType';
2020
this._enable = conf.get<boolean>('enable') ?? true;
2121
this._trace = conf.get<TraceLevel>('trace.server') || 'off';
22-
this._configPath = conf.get<string>('configPath') || '.eslintrc';
22+
this._configPath = conf.get<string>('configPath') || '.oxlintrc.json';
2323
this._binPath = conf.get<string>('path.server');
2424
}
2525

@@ -124,7 +124,7 @@ interface ConfigInterface {
124124
*
125125
* `oxc.configPath`
126126
*
127-
* @default ".eslintrc"
127+
* @default ".oxlintrc.json"
128128
*/
129129
configPath: string;
130130
/**

editors/vscode/client/config.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ suite('Config', () => {
1616
strictEqual(config.runTrigger, 'onType');
1717
strictEqual(config.enable, true);
1818
strictEqual(config.trace, 'off');
19-
strictEqual(config.configPath, '.eslintrc');
19+
strictEqual(config.configPath, '.oxlintrc.json');
2020
strictEqual(config.binPath, '');
2121
});
2222

editors/vscode/client/extension.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ export async function activate(context: ExtensionContext) {
142142
synchronize: {
143143
// Notify the server about file config changes in the workspace
144144
fileEvents: [
145-
workspace.createFileSystemWatcher('**/.eslintr{c,c.json}'),
146-
workspace.createFileSystemWatcher('**/.oxlint{.json,rc.json,rc}'),
145+
workspace.createFileSystemWatcher('**/.oxlint{.json,rc.json}'),
147146
workspace.createFileSystemWatcher('**/oxlint{.json,rc.json}'),
148147
],
149148
},

editors/vscode/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"oxc.configPath": {
9393
"type": "string",
9494
"scope": "window",
95-
"default": ".eslintrc",
95+
"default": ".oxlintrc.json",
9696
"description": "Path to ESlint configuration."
9797
},
9898
"oxc.path.server": {
@@ -108,8 +108,7 @@
108108
"oxlintrc.json",
109109
"oxlint.json",
110110
".oxlintrc.json",
111-
".oxlint.json",
112-
".oxlintrc"
111+
".oxlint.json"
113112
],
114113
"url": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json"
115114
}
@@ -121,8 +120,7 @@
121120
"oxlintrc.json",
122121
"oxlint.json",
123122
".oxlintrc.json",
124-
".oxlint.json",
125-
".oxlintrc"
123+
".oxlint.json"
126124
]
127125
}
128126
]

0 commit comments

Comments
 (0)