Skip to content

Commit f6c582d

Browse files
Lint
1 parent fa67d00 commit f6c582d

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

packages/firestore/.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ module.exports = {
4747
]
4848
},
4949
overrides: [
50+
{
51+
files: ['**/*.d.ts'],
52+
rules: {
53+
'camelcase': 'off',
54+
'import/no-duplicates': 'off',
55+
'@typescript-eslint/no-explicit-any': 'off',
56+
'@typescript-eslint/no-unused-vars': 'off'
57+
}
58+
},
5059
{
5160
files: ['**/*.test.ts', '**/test/**/*.ts'],
5261
rules: {

packages/firestore/scripts/prune-dts.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import * as fs from 'fs';
3232
* @param inputLocation The file path to the .d.ts produced by API explorer.
3333
* @param outputLocation The output location for the pruned .d.ts file.
3434
*/
35-
function main(inputLocation: string, outputLocation: string) {
35+
function main(inputLocation: string, outputLocation: string): void {
3636
const compilerOptions = {};
3737
const host = ts.createCompilerHost(compilerOptions);
3838
const program = ts.createProgram([inputLocation], compilerOptions, host);
@@ -68,7 +68,9 @@ function isExported(modifiers?: ts.ModifiersArray): boolean {
6868
* Returns either the modified constructor or the existing constructor if no
6969
* modification was needed.
7070
*/
71-
function maybeHideConstructor(node: ts.ConstructorDeclaration) {
71+
function maybeHideConstructor(
72+
node: ts.ConstructorDeclaration
73+
): ts.ConstructorDeclaration {
7274
const hideConstructorTag = ts
7375
.getJSDocTags(node)
7476
?.find(t => t.tagName.escapedText === 'hideconstructor');
@@ -132,7 +134,7 @@ function prunePrivateImports<
132134
sourceFile,
133135
type.expression
134136
);
135-
if (publicName && publicName != currentName) {
137+
if (publicName && publicName !== currentName) {
136138
// If there is a public type that we can refer to, update the import
137139
// statement to refer to the public type.
138140
exportedTypes.push(
@@ -225,7 +227,7 @@ function extractPublicName(
225227
// private type.
226228
for (const symbol of allPublicSymbols) {
227229
// Short circuit if the local types is already part of the public types.
228-
if (symbol.name == localSymbolName) {
230+
if (symbol.name === localSymbolName) {
229231
return symbol.name;
230232
}
231233

@@ -238,7 +240,7 @@ function extractPublicName(
238240
for (const type of heritageClause.types || []) {
239241
if (ts.isIdentifier(type.expression)) {
240242
const subclassName = type.expression.escapedText;
241-
if (subclassName == localSymbolName) {
243+
if (subclassName === localSymbolName) {
242244
publicSymbolsForLocalType.push(symbol.name);
243245
}
244246
}
@@ -256,7 +258,7 @@ const dropPrivateApiTransformer = (
256258
context: ts.TransformationContext
257259
) => {
258260
return (sourceFile: ts.SourceFile) => {
259-
function visit(node: ts.Node): any {
261+
function visit(node: ts.Node): ts.Node {
260262
if (
261263
ts.isInterfaceDeclaration(node) ||
262264
ts.isClassDeclaration(node) ||

0 commit comments

Comments
 (0)