Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5cfcc76
refactor: write types for index file
jamiehaywood Jan 25, 2022
0d11752
refactor: export default request array
jamiehaywood Jan 25, 2022
67da72b
refactor: rewrite index in typescript
jamiehaywood Jan 25, 2022
1835add
chore: add tsconfig file
jamiehaywood Jan 25, 2022
82a0263
chore: remove non-functioning eslint file
jamiehaywood Jan 25, 2022
e9024bf
chore: add typescript as dep
jamiehaywood Jan 25, 2022
db857bf
chore: add types for libraries in use
jamiehaywood Jan 25, 2022
245b2ad
chore: add "type":"module"
jamiehaywood Jan 25, 2022
0f5edb8
chore: update package-lock.json
jamiehaywood Jan 25, 2022
c73fb0c
chore: add jest config to migrate from mocha
jamiehaywood Jan 27, 2022
59e19b0
refactor: create types files for all requests
jamiehaywood Jan 27, 2022
aef88d5
chore: add jest, ts-node, ts-jest
jamiehaywood Jan 27, 2022
77ee6cb
refactor: rewrite all requests in TS
jamiehaywood Jan 27, 2022
d0d41fa
refactor: rewrite request module in TS
jamiehaywood Jan 27, 2022
8a7187a
refactor: change require to import & add function types
jamiehaywood Jan 27, 2022
a1f11ca
chore: remove requestjs from tsconfig inclusion
jamiehaywood Jan 27, 2022
9fbaa24
refactor: remove index.types.ts
jamiehaywood Jan 27, 2022
d071dda
chore: add husky with normal setup & no pre-commit
jamiehaywood Jan 27, 2022
ff4dcc1
chore: add eslint, husky & prettier pkgs and config
jamiehaywood Jan 27, 2022
6b30d8f
chore: add eslint exception for _ arg
jamiehaywood Jan 27, 2022
ba47fba
chore: apply eslint & prettier formatting
jamiehaywood Jan 27, 2022
c492d76
refactor: move types to top level folder
jamiehaywood Feb 15, 2022
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
9 changes: 0 additions & 9 deletions .eslintrc

This file was deleted.

33 changes: 33 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const OFF = 0;
const WARN = 1;
const ERROR = 2;

module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
rules: {
'@typescript-eslint/no-non-null-assertion': OFF,
'@typescript-eslint/no-empty-function': OFF,
'@typescript-eslint/ban-ts-comment': WARN,
'@typescript-eslint/ban-types': OFF,
'@typescript-eslint/no-explicit-any': OFF,
'@typescript-eslint/explicit-module-boundary-types': OFF,
'@typescript-eslint/no-object-literal-type-assertion': OFF,
'no-console': [ERROR],
'@typescript-eslint/no-unused-vars': [ERROR, { argsIgnorePattern: '^_' }],
},
overrides: [
{
files: ['*.test.ts', '*.test.tsx'],
rules: {
// Allow testing runtime errors to suppress TS errors
'@typescript-eslint/ban-ts-comment': OFF,
},
},
],
};
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# npm test
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"trailingComma": "all"
}
25 changes: 25 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { Config } from "@jest/types";

const setup: Config.InitialOptions = {
collectCoverage: true,
collectCoverageFrom: ["**/*.{ts,tsx}"],
coveragePathIgnorePatterns: [
"/node_modules/",
"/dist/",
"jest.config.ts",
"index.ts",
],
coverageThreshold: {
global: {
functions: 80,
lines: 80,
statements: 80,
},
},
preset: "ts-jest",
testEnvironment: "node",
testMatch: ["**/__tests__/**/*.{ts,tsx}"],
testTimeout: 10000,
};

export default setup;
Loading