Skip to content

Commit b601b5a

Browse files
committed
chore: delete the library-level copies of .eslintignore and .eslintrc.json
1 parent dc5e8bc commit b601b5a

514 files changed

Lines changed: 103 additions & 2478 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
**/node_modules
22
**/coverage
3+
**/.coverage
4+
**/test/fixtures/**
35
test/fixtures
6+
system-test/
7+
samples/generated/
48
build/
59
docs/
610
protos/
7-
packages/

.eslintrc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

bin/lint-any.mjs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import fs from 'fs';
2+
import path from 'path';
3+
4+
function walk(dir, callback) {
5+
let files;
6+
try {
7+
files = fs.readdirSync(dir);
8+
} catch (e) {
9+
return;
10+
}
11+
for (const file of files) {
12+
const filepath = path.join(dir, file);
13+
let stat;
14+
try {
15+
stat = fs.statSync(filepath);
16+
} catch (e) {
17+
continue;
18+
}
19+
if (stat.isDirectory()) {
20+
walk(filepath, callback);
21+
} else if (stat.isFile() && filepath.endsWith('.ts')) {
22+
callback(filepath);
23+
}
24+
}
25+
}
26+
27+
const roots = [
28+
'/Users/shivaneep/google-cloud-node/packages',
29+
'/Users/shivaneep/google-cloud-node/core'
30+
];
31+
32+
const disableComment = '/* eslint-disable @typescript-eslint/no-explicit-any */';
33+
let violations = 0;
34+
35+
roots.forEach(rootDir => {
36+
walk(rootDir, (filepath) => {
37+
const content = fs.readFileSync(filepath, 'utf8');
38+
39+
// Skip files that have the disable comment at the top
40+
if (content.startsWith(disableComment)) {
41+
return;
42+
}
43+
44+
if (content.includes(': any') || content.includes('as any') || content.includes('<any>')) {
45+
console.error(`Violation found in ${filepath}`);
46+
violations++;
47+
}
48+
});
49+
});
50+
51+
if (violations > 0) {
52+
console.error(`Found ${violations} file(s) with 'any' references.`);
53+
process.exit(1);
54+
} else {
55+
console.log('No violations found.');
56+
process.exit(0);
57+
}

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"test": "echo nothing to test",
1313
"test-generate": "SMOKE_TEST=true node ./bin/generate-readme.mjs",
1414
"generate": "./bin/generate-readme.mjs",
15-
"lint": "eslint \"packages/*/src/**/*.ts\"",
15+
"lint": "node bin/lint-any.mjs",
1616
"clean": "echo nothing to clean",
1717
"precompile": "echo nothing to precompile",
1818
"system-test": "echo nothing to system test",
@@ -39,9 +39,7 @@
3939
"gaxios": "^7.0.0-rc",
4040
"parse-link-header": "^2.0.0"
4141
},
42-
"devDependencies": {
43-
"gts": "^6.0.2"
44-
},
42+
"devDependencies": {},
4543
"engines": {
4644
"node": ">=18"
4745
}

packages/gapic-node-processing/.eslintignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/gapic-node-processing/.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/google-ads-admanager/.eslintignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/google-ads-admanager/.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/google-ads-datamanager/.eslintignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/google-ads-datamanager/.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)