Skip to content

Commit 45eb2e6

Browse files
committed
cleanup eslintignore file and create cleanup script
1 parent 567ca5a commit 45eb2e6

File tree

2 files changed

+45
-17
lines changed

2 files changed

+45
-17
lines changed

.eslintignore

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
pythonExtensionApi/out/
21

32
# The following files were grandfathered out of eslint. They can be removed as time permits.
43

@@ -42,7 +41,6 @@ src/test/utils/fs.ts
4241

4342
src/test/api.functional.test.ts
4443

45-
src/test/testing/mocks.ts
4644
src/test/testing/common/debugLauncher.unit.test.ts
4745
src/test/testing/common/services/configSettingService.unit.test.ts
4846

@@ -85,9 +83,7 @@ src/test/common/application/commands/reloadCommand.unit.test.ts
8583

8684
src/test/common/installer/channelManager.unit.test.ts
8785
src/test/common/installer/pipInstaller.unit.test.ts
88-
src/test/common/installer/installer.invalidPath.unit.test.ts
8986
src/test/common/installer/pipEnvInstaller.unit.test.ts
90-
src/test/common/installer/productPath.unit.test.ts
9187

9288
src/test/common/socketCallbackHandler.test.ts
9389

@@ -103,27 +99,22 @@ src/test/common/process/proc.unit.test.ts
10399
src/test/common/interpreterPathService.unit.test.ts
104100

105101

106-
src/test/python_files/formatting/dummy.ts
107102

108103
src/test/debugger/extension/adapter/adapter.test.ts
109104
src/test/debugger/extension/adapter/outdatedDebuggerPrompt.unit.test.ts
110105
src/test/debugger/extension/adapter/factory.unit.test.ts
111-
src/test/debugger/extension/adapter/activator.unit.test.ts
112106
src/test/debugger/extension/adapter/logging.unit.test.ts
113107
src/test/debugger/extension/hooks/childProcessAttachHandler.unit.test.ts
114108
src/test/debugger/extension/hooks/childProcessAttachService.unit.test.ts
115109
src/test/debugger/utils.ts
116-
src/test/debugger/common/protocolparser.test.ts
117110
src/test/debugger/envVars.test.ts
118111

119112
src/test/telemetry/index.unit.test.ts
120113
src/test/telemetry/envFileTelemetry.unit.test.ts
121114

122115
src/test/application/diagnostics/checks/macPythonInterpreter.unit.test.ts
123116
src/test/application/diagnostics/checks/pythonInterpreter.unit.test.ts
124-
src/test/application/diagnostics/checks/invalidLaunchJsonDebugger.unit.test.ts
125117
src/test/application/diagnostics/checks/powerShellActivation.unit.test.ts
126-
src/test/application/diagnostics/checks/invalidPythonPathInDebugger.unit.test.ts
127118
src/test/application/diagnostics/checks/envPathVariable.unit.test.ts
128119
src/test/application/diagnostics/applicationDiagnostics.unit.test.ts
129120
src/test/application/diagnostics/promptHandler.unit.test.ts
@@ -154,25 +145,18 @@ src/client/activation/extensionSurvey.ts
154145
src/client/activation/common/analysisOptions.ts
155146
src/client/activation/languageClientMiddleware.ts
156147

157-
src/client/formatters/serviceRegistry.ts
158-
src/client/formatters/helper.ts
159-
src/client/formatters/dummyFormatter.ts
160-
src/client/formatters/baseFormatter.ts
161148

162149
src/client/testing/serviceRegistry.ts
163150
src/client/testing/main.ts
164151
src/client/testing/configurationFactory.ts
165152
src/client/testing/common/constants.ts
166153
src/client/testing/common/testUtils.ts
167-
src/client/testing/common/socketServer.ts
168-
src/client/testing/common/runner.ts
169154

170155
src/client/common/helpers.ts
171156
src/client/common/net/browser.ts
172157
src/client/common/net/socket/socketCallbackHandler.ts
173158
src/client/common/net/socket/socketServer.ts
174159
src/client/common/net/socket/SocketStream.ts
175-
src/client/common/editor.ts
176160
src/client/common/contextKey.ts
177161
src/client/common/experiments/telemetry.ts
178162
src/client/common/platform/serviceRegistry.ts
@@ -257,7 +241,6 @@ src/client/debugger/extension/attachQuickPick/psProcessParser.ts
257241
src/client/debugger/extension/attachQuickPick/picker.ts
258242

259243
src/client/application/serviceRegistry.ts
260-
src/client/application/diagnostics/surceMapSupportService.ts
261244
src/client/application/diagnostics/base.ts
262245
src/client/application/diagnostics/applicationDiagnostics.ts
263246
src/client/application/diagnostics/filter.ts
@@ -267,3 +250,4 @@ src/client/application/diagnostics/commands/ignore.ts
267250
src/client/application/diagnostics/commands/factory.ts
268251
src/client/application/diagnostics/commands/execVSCCommand.ts
269252
src/client/application/diagnostics/commands/launchBrowser.ts
253+

scripts/cleanup-eslintignore.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const baseDir = process.cwd();
5+
const eslintignorePath = path.join(baseDir, '.eslintignore');
6+
7+
fs.readFile(eslintignorePath, 'utf8', (err, data) => {
8+
if (err) {
9+
console.error('Error reading .eslintignore file:', err);
10+
return;
11+
}
12+
13+
const lines = data.split('\n');
14+
const files = lines.map((line) => line.trim()).filter((line) => line && !line.startsWith('#'));
15+
const nonExistentFiles = [];
16+
17+
files.forEach((file) => {
18+
const filePath = path.join(baseDir, file);
19+
if (!fs.existsSync(filePath)) {
20+
nonExistentFiles.push(file);
21+
}
22+
});
23+
24+
if (nonExistentFiles.length > 0) {
25+
console.log('The following files listed in .eslintignore do not exist:');
26+
nonExistentFiles.forEach((file) => console.log(file));
27+
28+
const updatedLines = lines.filter((line) => {
29+
const trimmedLine = line.trim();
30+
return !nonExistentFiles.includes(trimmedLine);
31+
});
32+
const updatedData = `${updatedLines.join('\n')}\n`;
33+
34+
fs.writeFile(eslintignorePath, updatedData, 'utf8', (err) => {
35+
if (err) {
36+
console.error('Error writing to .eslintignore file:', err);
37+
return;
38+
}
39+
console.log('Non-existent files have been removed from .eslintignore.');
40+
});
41+
} else {
42+
console.log('All files listed in .eslintignore exist.');
43+
}
44+
});

0 commit comments

Comments
 (0)