Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitlab pr bot #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
add gitlab pr bot
hyqshr committed May 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 895e53ca33f4c3a5ec28d6f5eb48d40b5c2b7b42
3 changes: 3 additions & 0 deletions pr-review-bot-gitlab/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
# .env
5 changes: 5 additions & 0 deletions pr-review-bot-gitlab/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.env
dist
!*.d.ts
.DS_Store
3 changes: 3 additions & 0 deletions pr-review-bot-gitlab/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
node_modules
6 changes: 6 additions & 0 deletions pr-review-bot-gitlab/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
10 changes: 10 additions & 0 deletions pr-review-bot-gitlab/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM --platform=linux/amd64 node:20-alpine3.17
RUN apk add --no-cache git
RUN mkdir -p /usr/app
WORKDIR /usr/app
ENV NODE_OPTIONS=--max_old_space_size=16384
EXPOSE 3000
COPY package.json .
RUN npm i --quiet
COPY . .
CMD ["npm", "start"]
18 changes: 18 additions & 0 deletions pr-review-bot-gitlab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Greiptile GitLab PR bot



## Set up
- Index your repo at greptile
- Set up personal access token for GitLab if you have not
- Configure GitLab Webhook URL
In you project, click Settings -> Webhooks -> Add new webhook
Add the webhook URL: abc

- Edit the webhook, include your personal access token in Secret token part

## Start the project
```
docker build -t pr-bot . && docker run -p 3000:3000 pr-bot
```

3,330 changes: 3,330 additions & 0 deletions pr-review-bot-gitlab/package-lock.json

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions pr-review-bot-gitlab/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "greptile-github-app",
"version": "0.0.1",
"description": "the greptile github app",
"main": "app.ts",
"scripts": {
"start": "tsc --build && node dist/app.js",
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --write ."
},
"author": "",
"license": "ISC",
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.552.0",
"@aws-sdk/util-dynamodb": "^3.552.0",
"@octokit/auth-app": "^6.1.1",
"@octokit/rest": "^20.1.0",
"axios": "^1.6.8",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"octokit": "^3.2.0",
"smee-client": "^2.0.1",
"winston": "^3.13.0",
"winston-cloudwatch": "^6.2.0"
},
"devDependencies": {
"@octokit/types": "^13.4.0",
"@types/express": "^4.17.21",
"prettier": "^3.2.5",
"typescript": "^5.4.5"
}
}
31 changes: 31 additions & 0 deletions pr-review-bot-gitlab/src/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* This is the main entry point for the application.
* It creates an express server and listens for incoming webhooks from GitHub
*/
import express from 'express'
import { processEvent } from './apps/webhook_processor'
import { getDb } from './db'
import env from './env'

const app = express()
app.use(express.json())

const db = getDb(env.DB_PROVIDER)

app.get('/', (req, res) => {
// for health checks
res.send('Hello, World!')
})

app.post('/webhook', (req, res) => {
console.log('Received MR webhook event');
// express header can be string | string[]
const gitlabToken = req.headers['x-gitlab-token'] as string;
processEvent(req.body, gitlabToken);
res.sendStatus(200);
});

// hard coded port for now
app.listen(3000, () => {
console.log('Server is running on port 3000')
})
357 changes: 357 additions & 0 deletions pr-review-bot-gitlab/src/apps/pr_review.ts

Large diffs are not rendered by default.

94 changes: 94 additions & 0 deletions pr-review-bot-gitlab/src/apps/processGitLab.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Import axios for making HTTP requests
import axios from 'axios';
import { extractPathWithNamespace, fetchAndDecodeFileContents, fetchGreptileComments, fetchGreptileOverallComment, getMainBranchLatestCommitSHA, postGitLabComments, postMultipleComments } from './util_gitlab';
import env from '../env'
import logger from '../logger';
import { CommentPayload, type Comment } from '../types';

// Define the GitLab API base URL

// Function to process GitLab Merge Request events
// This function will be called when a GitLab MR event is received, then
// 1. Fetch the diffs files in the MR
// 2: Fetch the original file content for each changed file
// 3: Call the Greptile API to comments (individual comment and overall comment)
// 4: Post the generated comments to the MR


// GitLab MR events:https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#merge-request-events
// GitLab get MR diffs: https://docs.gitlab.com/ee/api/merge_requests.html#list-merge-request-diffs
// GitLab create MR comment: https://docs.gitlab.com/ee/api/notes.html#create-new-merge-request-note
// GitLab get file content: https://docs.gitlab.com/ee/api/repository_files.html#get-file-from-repository
export const processGitLabEvent = async (event: any, gitlabToken: string) => {
// Extract necessary information from the event
const projectId = event.project.id;
const mrId = event.object_attributes.iid;
const sourceBranch = event.object_attributes.source_branch
const targetBranch = event.object_attributes.target_branch
const projectUrl = extractPathWithNamespace(event.project.web_url);
console.log('$$Processing GitLab!! event:', { projectId, mrId, sourceBranch, targetBranch, projectUrl });
const featureBranchSha = event.object_attributes.last_commit.id;
const mainBranchSha = await getMainBranchLatestCommitSHA(projectId, gitlabToken);

console.log('featureBranchSha:', featureBranchSha);
console.log('mainBranchSha:', mainBranchSha);


try {
// Step 1: Fetch the diffs files in the MR
const diffsResponse = await axios.get(`${env.GITLAB_API_BASE_URL}/projects/${projectId}/merge_requests/${mrId}/diffs`, {
headers: { 'Private-Token': gitlabToken },
});
logger.info('$$Diffs fetched successfully:', diffsResponse)
const diffs = diffsResponse.data;

// Step 2: Fetch the original file content for each changed file
const fileContents = await fetchAndDecodeFileContents(
projectId,
diffs,
gitlabToken,
sourceBranch,
)
logger.info('$$File contents fetched successfully:', fileContents)

// Step 3: Call the Greptile API to comments (individual comment and overall comment)
const comments: Comment[] = await fetchGreptileComments(
fileContents,
diffs,
gitlabToken,
env.GREPTILE_API_KEY,
"main",
projectUrl
)
console.log('Comments generated successfully:$$', comments)

// const overallComment: string = await fetchGreptileOverallComment(
// fileContents,
// diffs,
// gitlabToken,
// env.GREPTILE_API_KEY,
// "main",
// projectUrl
// )
// console.log('overallComment generated successfully:$$', overallComment)


// Step 4: Post the generated comments to the MR
// await postGitLabComments(projectId, mrId, comments, gitlabToken);
await postMultipleComments(
projectId,
mrId,
gitlabToken,
diffs,
comments,
mainBranchSha,
featureBranchSha
);

// await postGitLabComments(projectId, mrId, overallComment, gitlabToken);

logger.info('Comments posted to MR successfully');
} catch (error) {
console.error('Error processing GitLab event:', error);
}
};
380 changes: 380 additions & 0 deletions pr-review-bot-gitlab/src/apps/util_gitlab.ts

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions pr-review-bot-gitlab/src/apps/webhook_processor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// webhookEventProcessor.ts
import logger from '../logger'
import { processGitLabEvent } from './processGitLab';

const identifyEventSource = (event: any): 'GitHub' | 'GitLab' | 'Unknown' => {
if (event.hasOwnProperty('pull_request') || event.hasOwnProperty('issue')) {
return 'GitHub';
} else if (event.hasOwnProperty('object_kind') && event.object_kind === 'merge_request') {
return 'GitLab';
}
return 'Unknown';
};

/**
* Checks if the event should trigger the processEvent based on the action.
*
* @param event - The event object containing the details of the GitLab event.
* @returns A boolean indicating whether the event should trigger processing.
*/
function shouldTriggerProcessEvent(event: any): boolean {
const validActions = ['open'];
return validActions.includes(event?.object_attributes?.action);
}

// GitLab MR events:https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#merge-request-events
export const processEvent = async (
event: any,
gitlabToken: string
) => {
// Check if the event should trigger the processing
// if (!shouldTriggerProcessEvent(event)) {
// console.log('$$Event action does not require processing', { action: event?.object_attributes?.action })
// logger.info('$$Event action does not require processing', { action: event?.object_attributes?.action });
// return;
// }

const eventSource = identifyEventSource(event);
if (eventSource === 'GitLab') {
logger.info('Processing GitLab event', { event });
await processGitLabEvent(event, gitlabToken);
return;
}

logger.info(
`processing event ${event?.action} for ${event?.issue?.url || event?.pull_request?.url}`
)
}
90 changes: 90 additions & 0 deletions pr-review-bot-gitlab/src/db/dynamodb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import {
DynamoDBClient,
GetItemCommand,
UpdateItemCommand,
} from '@aws-sdk/client-dynamodb'
import { unmarshall } from '@aws-sdk/util-dynamodb'

import logger from '../logger'
import env from '../env'

const TABLE_NAME = env.DYNAMODB_TABLE
const dynamodbClient = new DynamoDBClient({ region: env.AWS_REGION })

/**
* For first party integrations we can directly interact with Greptile's dynamodb table.
*/

const dynamodb = () => {

const get = async (repository: string, branch: string) => {
try {
const { Item } = await dynamodbClient.send(
new GetItemCommand({
TableName: 'onboard-repositories',
Key: {
repository: { S: repository },
source_id: { S: `github:${branch}` },
},
})
)
return Item ? unmarshall(Item) : null
} catch (e) {
logger.error('Error getting repository', e)
throw new Error('Error getting repository')
}
}

const getIntegrationSettings = async (userId: string) => {
try {
const { Item } = await dynamodbClient.send(
new GetItemCommand({
TableName: TABLE_NAME,
Key: {
user_id: { S: userId },
},
})
)
return Item ? unmarshall(Item) : null
} catch (e) {
logger.error('Error getting user', e)
throw new Error('Error getting user')
}
}

const deleteIntegration = async (
repository: string,
branch: string,
integration: string
) => {
try {
await dynamodbClient.send(
new UpdateItemCommand({
TableName: 'onboard-repositories',
Key: {
repository: { S: repository },
source_id: { S: `github:${branch}` },
},
ConditionExpression:
'attribute_exists(repository) AND attribute_exists(source_id) AND attribute_exists(#integrations.#integration)',
UpdateExpression: `REMOVE #integrations.#integration`,
ExpressionAttributeNames: {
'#integrations': 'integrations',
'#integration': integration,
},
})
)
} catch (e) {
logger.error('Error deleting integration', e)
throw new Error('Error deleting integration')
}
}

return {
get,
getIntegrationSettings,
deleteIntegration,
}
}

export default dynamodb
9 changes: 9 additions & 0 deletions pr-review-bot-gitlab/src/db/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import dynamodb from './dynamodb'

export const getDb = (provider: DbProvider): Db => {
switch (provider) {
case 'dynamodb':
default:
return dynamodb()
}
}
16 changes: 16 additions & 0 deletions pr-review-bot-gitlab/src/db/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type DbProvider = 'dynamodb' | 'local'
type Db = {
get: (repository: string, branch: string) => Promise<any>
getIntegrationSettings: (userId: string) => Promise<any>
deleteIntegration: (
repository: string,
branch: string,
integration: string
) => Promise<void>
// query: (repository: string) => Promise<any>
// update: (repository: string, data: { [key: string]: any[] }) => Promise<void>
}

type RepositorySettings = {
integrations: string[]
}
32 changes: 32 additions & 0 deletions pr-review-bot-gitlab/src/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import * as dotenv from 'dotenv'
dotenv.config()

const env = (() => {
// const GITLAB_TOKEN = process.env.GITLAB_TOKEN
const DB_PROVIDER: DbProvider =
(process.env.DB_PROVIDER as DbProvider) || 'dynamodb'
const DYNAMODB_TABLE = process.env.DYNAMODB_TABLE
if (DB_PROVIDER === 'dynamodb' && !DYNAMODB_TABLE) {
// throw new Error('Missing DYNAMODB_TABLE')
console.log('Missing DYNAMODB_TABLE')
}
const GREPTILE_API_URL = process.env.GREPTILE_API_URL
const GREPTILE_API_KEY = process.env.GREPTILE_API_KEY
if (!GREPTILE_API_URL || !GREPTILE_API_KEY) {
throw new Error('Missing GREPTILE_API_URL or GREPTILE_API_KEY')
}

const AWS_REGION = process.env.AWS_REGION || 'us-east-1'
const GITLAB_API_BASE_URL = 'https://gitlab.com/api/v4';

return {
DB_PROVIDER,
DYNAMODB_TABLE,
GREPTILE_API_URL,
GREPTILE_API_KEY,
AWS_REGION,
GITLAB_API_BASE_URL,
}
})()

export default env
61 changes: 61 additions & 0 deletions pr-review-bot-gitlab/src/logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import dotenv from 'dotenv'
import winston from 'winston'
import WinstonCloudWatch from 'winston-cloudwatch'

dotenv.config()

// The environemnt variables for the logger are determined by

const logger = winston.createLogger({
format: winston.format.combine(
winston.format.json(),
winston.format.errors({ stack: true })
),
transports: [
new winston.transports.Console({
level: 'error',
handleExceptions: true,
}),
],
levels: {
trace: 0,
input: 1,
verbose: 2,
prompt: 3,
debug: 4,
info: 5,
data: 6,
help: 7,
warn: 8,
error: 9,
},
})

if (process.env.NODE_ENV === 'PROD') {
// from cloudwatch vars itself
try {
const cloudwatchConfig = {
logGroupName: process.env.CLOUDWATCH_GROUP_NAME,
logStreamName: `${process.env.CLOUDWATCH_GROUP_NAME}-${process.env.NODE_ENV}`,
awsAccessKeyId: process.env.CLOUDWATCH_ACCESS_KEY,
awsSecretKey: process.env.CLOUDWATCH_SECRET_ACCESS_KEY,
awsRegion: process.env.CLOUDWATCH_REGION,
messageFormatter: ({
level,
message,
additionalInfo,
}: WinstonCloudWatch.LogObject) =>
`[${level}] : ${message} \nMore: ${JSON.stringify(additionalInfo)}}`,
}
logger.add(
new WinstonCloudWatch({
...cloudwatchConfig,
level: 'error',
})
)
} catch (e) {
logger.error(`Error Setting Up Winston with Cloudwatch`, e)
}
}

export default logger
16 changes: 16 additions & 0 deletions pr-review-bot-gitlab/src/smee.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Usage options:
// $ node smee.js
// $ node smee.js 3000

const SmeeClient = require('smee-client')

// get port from first command line arg
const port = process.argv[2] || 3000

const smee = new SmeeClient({
source: 'https://smee.io/dAuEmtnj9tNNCK6f',
target: `http://localhost:${port}/webhook`,
logger: console,
})

smee.start()
59 changes: 59 additions & 0 deletions pr-review-bot-gitlab/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
export type FileDiff = {
old_path: string;
new_path: string;
a_mode: string;
b_mode: string;
diff: string;
new_file: boolean;
renamed_file: boolean;
deleted_file: boolean;
generated_file: boolean;
}

export type GitLabApiResponse = FileDiff[];

export type Source = {
repository: string;
remote: string;
branch: string;
filepath: string;
linestart: number;
lineend: number;
summary: string;
}

export type GreptileQueryResponse = {
message: string;
sources: Source[];
}

export type Comment = {
start?: number;
end?: number;
comment: string;
modify_type?: "add" | "delete";
}

export type CommentPayload = {
summary: string;
comments: Comment[];
}

export type Position = {
position_type: string;
base_sha: string;
head_sha: string;
start_sha: string;
new_path: string;
old_path: string;
new_line?: number;
old_line?: number;
}

export type PostCommentProps = {
projectId: string;
mergeRequestId: number;
accessToken: string;
body: string;
position: Position;
}
111 changes: 111 additions & 0 deletions pr-review-bot-gitlab/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */

/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */

/* Language and Environment */
"target": "ES6" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */

/* Modules */
"module": "CommonJS" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
// "moduleResolution": "Node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */,
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
// "resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */

/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */

/* Emit */
// "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
// "declarationMap": true /* Create sourcemaps for d.ts files. */,
// "emitDeclarationOnly": true /* Only output d.ts files and not JavaScript files. */,
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
"outDir": "dist" /* Specify an output folder for all emitted files. */,
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

/* Type Checking */
"strict": false /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */

/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["src/**/*", "types.d.ts", "smee.js"],
"exclude": ["node_modules", "**/*.test.ts"]
}