Skip to content

Commit 1e9d485

Browse files
committed
refactor: Migrate to TypeScript
1 parent c54692f commit 1e9d485

38 files changed

+3416
-2795
lines changed

.eslintrc

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

.eslintrc.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
es2022: true,
5+
node: true,
6+
mocha: true,
7+
},
8+
parserOptions: {
9+
ecmaVersion: 13,
10+
project: ['tsconfig.json', 'tsconfig.dev.json'],
11+
sourceType: 'module',
12+
tsconfigRootDir: __dirname,
13+
},
14+
extends: [
15+
'eslint:recommended',
16+
'plugin:import/errors',
17+
'plugin:import/warnings',
18+
'plugin:import/typescript',
19+
'plugin:@typescript-eslint/recommended',
20+
],
21+
parser: '@typescript-eslint/parser',
22+
ignorePatterns: [
23+
'/lib/**/*', // Ignore built files.
24+
],
25+
plugins: [
26+
'@typescript-eslint',
27+
'import',
28+
],
29+
rules: {
30+
// Basic ES6
31+
indent: [
32+
'error', 4, { // use 4 spaces for indents
33+
'SwitchCase': 1, // indent case within switch
34+
}
35+
],
36+
'linebreak-style': 0, // mixed environment let git config enforce line endings
37+
quotes: ['error', 'single'],
38+
semi: ['error', 'always'],
39+
'no-var': 'error',
40+
'no-console': 0, // allow use of console.log,
41+
'arrow-body-style': [0, 'always'],
42+
'max-len': 0,
43+
'camelcase': 1,
44+
'import/no-unresolved': [
45+
'error', {
46+
// https://github.com/firebase/firebase-admin-node/discussions/1359
47+
ignore: ['^firebase-admin/.+'],
48+
},
49+
],
50+
'@typescript-eslint/consistent-type-definitions': 'warn'
51+
},
52+
};

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ node_modules
1010

1111
# Debug logs
1212
npm-debug.log
13+
14+
# Built JavaScript files
15+
lib

.npmignore

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1-
test/
2-
.git*
1+
# Debug Logs
32
npm-debug.log
4-
.travis.yml
5-
.eslintrc
6-
node_modules
7-
coverage
3+
4+
# Uncompiled Source Files
5+
src
6+
7+
# Node Modules
8+
node_modules/
9+
node_modules/*
10+
11+
# Configuration Files
12+
.eslintrc*
13+
tsconfig*
14+
15+
# Test/Coverage Files
16+
coverage/
17+
coverage/*
18+
.nycrc
819
.nyc_output
9-
upgrade_guides
10-
tslint.json
11-
_config.yml
20+
.nyc_output/*
1221
.coveralls.yml
22+
lib/test
23+
24+
# Github Configuration Files
25+
_config.yml
26+
.git*

.nycrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"check-coverage": true,
3+
"all": true,
4+
"include": [
5+
"src/**/!(*.test.*).[tj]s?(x)"
6+
],
7+
"exclude": [
8+
"test/**/*.*"
9+
],
10+
"reporter": [
11+
"lcov",
12+
"text-summary",
13+
"text"
14+
],
15+
"report-dir": "coverage"
16+
}

.travis.yml

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

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2014-2020 Michael Rodrigues
3+
Copyright (c) 2014-Present Michael Rodrigues
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

lib/constants.json

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

lib/converter.js

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

0 commit comments

Comments
 (0)