Skip to content
Open
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
126 changes: 0 additions & 126 deletions .eslintrc.js

This file was deleted.

153 changes: 153 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/*!
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
Comment thread
lahirumaramba marked this conversation as resolved.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
Comment thread
lahirumaramba marked this conversation as resolved.
* limitations under the License.
*/

import { defineConfig } from 'eslint/config';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import globals from 'globals';

export default defineConfig([
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ['src/**/*.ts', 'test/**/*.ts'],
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
// Following checks are temporarily disabled. We shall incrementally enable them in the
// future, fixing any violations as we go.
'@typescript-eslint/no-non-null-assertion': 0,

// Disabled checks
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-require-imports': 0,
'@typescript-eslint/no-unused-expressions': 0,

// Required checks
'indent': ['error', 2],
'keyword-spacing': ['error'],
'max-len': [
'error',
{
'code': 120,
'ignoreUrls': true
}
],
'object-curly-spacing': [2, 'always'],
'@typescript-eslint/explicit-function-return-type': [
'error',
{
'allowExpressions': true,
'allowTypedFunctionExpressions': true,
'allowHigherOrderFunctions': true
}
],
'no-unused-vars': 'off', // Must be disabled to enable the next rule
'@typescript-eslint/no-unused-vars': [
'error',
{
'varsIgnorePattern': '^_',
'argsIgnorePattern': '^_',
'caughtErrors': 'none'
}
],
'quotes': ['error', 'single', {'avoidEscape': true}],
'@typescript-eslint/naming-convention': [
'error',
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
},
{
"selector": "parameter",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},

{
"selector": "memberLike",
"format": ["camelCase"]
},

{
"selector": "typeLike",
"format": ["PascalCase"]
},

// Ignore properties that require quotes (HTTP headers, names that include spaces or dashes etc.).
{
"selector": [
"classProperty",
"objectLiteralProperty",
"typeProperty",
"classMethod",
"objectLiteralMethod",
"typeMethod",
"accessor",
"enumMember"
],
"format": null,
"modifiers": ["requiresQuotes"]
},

// Ignore destructured property names.
{
"selector": "variable",
"modifiers": ["destructured"],
"format": null
},

// Following types are temporarily disabled. We shall incrementally enable them in the
// future, fixing any violations as we go.
{
"selector": [
"classProperty",
"objectLiteralProperty",
"typeProperty",
"enumMember"
],
"format": null
}
],
}
},
{
files: ['test/**/*.ts'],
languageOptions: {
globals: {
...globals.mocha,
},
},
},
{
ignores: [
'lib/',
'node_modules/',
'temp/',
'docgen/',
'dist/',
'coverage/',
'**/*.d.ts',
'**/*.js',
'firebase-admin-*.tgz'
]
}
]);
Loading
Loading