Skip to content

Commit

Permalink
Easy Stricter Build Requirements (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith authored Sep 19, 2024
1 parent f284747 commit 834182a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 20
cache: "npm"
- run: |
yarn
Expand All @@ -40,7 +37,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: 20
cache: "npm"
- run: |
yarn
Expand Down
3 changes: 3 additions & 0 deletions src/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class Paginator {
return nextPage;
}
console.warn("You are already on the last page!");
return;
}

async previousPage(): Promise<Page | undefined> {
Expand All @@ -75,6 +76,7 @@ export class Paginator {
return previousPage;
}
console.warn("You are already on the first page.");
return;
}

async lastPage(): Promise<Page | undefined> {
Expand Down Expand Up @@ -106,6 +108,7 @@ export class Paginator {
console.warn(
`Invalid page number requested ${n}: Must be contained in [1, ${this.maxPage()}]`,
);
return;
}

public getCurrentPageValues(): Page {
Expand Down
20 changes: 17 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"strict": true,
"moduleResolution": "Node",
"declaration": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"declaration": true,

"strict": true,
"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'. */
"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. */

"rootDir": "src"
},
"include": ["src"],
Expand Down

0 comments on commit 834182a

Please sign in to comment.