Skip to content

Commit

Permalink
- more code review
Browse files Browse the repository at this point in the history
- also make VS Code use the repo TS version
  • Loading branch information
irahopkinson committed Aug 28, 2024
1 parent 5075672 commit d2f69b5
Show file tree
Hide file tree
Showing 17 changed files with 16 additions and 27 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"javascript.validate.enable": false,
"javascript.format.enable": false,
"typescript.format.enable": false,
"typescript.tsdk": "node_modules/typescript/lib",

"search.exclude": {
".git": true,
Expand Down
1 change: 1 addition & 0 deletions extensions/src/c-sharp-provider-test/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
declare module 'c-sharp-provider-test' {
// @ts-ignore: TS2307 - Cannot find module '@papi/core' or its corresponding type declarations
import { IDataProvider, DataProviderDataType } from '@papi/core';

type TimeDataTypes = {
Expand Down
1 change: 1 addition & 0 deletions extensions/src/hello-someone/src/types/hello-someone.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
declare module 'hello-someone' {
// @ts-ignore: TS2307 - Cannot find module '@papi/core' or its corresponding type declarations
import { IDataProvider, DataProviderDataType } from '@papi/core';

export type Person = {
Expand Down
1 change: 1 addition & 0 deletions extensions/src/hello-world/src/types/hello-world.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
declare module 'hello-world' {
// @ts-ignore: TS2307 - Cannot find module '@papi/core' or its corresponding type declarations
import type { DataProviderDataType, MandatoryProjectDataTypes } from '@papi/core';
import type { IBaseProjectDataProvider } from 'papi-shared-types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ declare module 'platform-scripture' {
DataProviderUpdateInstructions,
ExtensionDataScope,
IDataProvider,
// @ts-ignore: TS2307 - Cannot find module '@papi/core' or its corresponding type declarations
} from '@papi/core';
import type { IProjectDataProvider } from 'papi-shared-types';
import { Dispose, LocalizeKey, UnsubscriberAsync } from 'platform-bible-utils';
Expand Down
1 change: 1 addition & 0 deletions extensions/src/project-notes-data-provider/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
DataProviderDataType,
DataProviderSubscriberOptions,
IDataProvider,
// @ts-ignore: TS2307 - Cannot find module '@papi/core' or its corresponding type declarations
} from '@papi/core';
import { PlatformEvent, Unsubscriber } from 'platform-bible-utils';

Expand Down
1 change: 1 addition & 0 deletions extensions/src/quick-verse/src/types/quick-verse.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
declare module 'quick-verse' {
// @ts-ignore: TS2307 - Cannot find module '@papi/core' or its corresponding type declarations
import { DataProviderDataType, IDataProvider } from '@papi/core';

export type QuickVerseSetData = string | { text: string; isHeresy: boolean };
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion lib/platform-bible-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"lint-fix": "npm run lint-fix:scripts && npm run lint:styles -- --fix",
"lint-fix:scripts": "prettier --write \"**/*.{ts,tsx,js,jsx,cjs}\" && npm run lint:scripts",
"test": "jest --silent",
"typecheck": "tsc -p ./tsconfig.lint.json"
"typecheck": "tsc -p ./tsconfig.json"
},
"peerDependencies": {
"react": ">=18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion lib/platform-bible-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// directories looking for node_modules/@types folders by default.
// We needed to remove react from here below because having two copies was causing problems in
// the jest tests. But we need the types in both places.
"typeRoots": ["./node_modules/@types", "../../node_modules/@types", "./@types"],
"typeRoots": ["./node_modules/@types", "../../node_modules/@types"],
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"forceConsistentCasingInFileNames": true,
"incremental": false,
Expand Down
5 changes: 1 addition & 4 deletions lib/platform-bible-react/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"skipLibCheck": true
},
"include": [".eslintrc.cjs", "postcss.config.js", "*.ts", "src", "@types"]
"include": [".eslintrc.cjs", "postcss.config.js", "*.ts", "src"]
}
2 changes: 1 addition & 1 deletion lib/platform-bible-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"lint-fix": "npm run lint-fix:scripts",
"lint-fix:scripts": "prettier --write \"**/*.{ts,tsx,js,jsx,cjs}\" && npm run lint:scripts",
"test": "jest --silent",
"typecheck": "tsc -p ./tsconfig.lint.json"
"typecheck": "tsc -p ./tsconfig.json"
},
"peerDependencies": {},
"dependencies": {
Expand Down
3 changes: 0 additions & 3 deletions lib/platform-bible-utils/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"skipLibCheck": true
},
"include": [".eslintrc.cjs", "*.ts", "src"]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
"storybook:build": "storybook build",
"test": "npm run test:core && npm run test --workspaces --if-present",
"test:core": "jest --silent",
"typecheck": "npm run typecheck:core && npm run typecheck:extensions && npm run typecheck:papi-dts && npm run typecheck:platform-bible-utils && npm run typecheck:platform-bible-react",
"typecheck:core": "tsc -p ./tsconfig.lint.json",
"typecheck": "npm run typecheck:core && npm run typecheck --workspaces --if-present",
"typecheck:core": "tsc -p ./tsconfig.json",
"typecheck:extensions": "cd extensions && npm run typecheck",
"typecheck:papi-dts": "cd lib/papi-dts && npm run typecheck",
"typecheck:platform-bible-react": "cd lib/platform-bible-react && npm run typecheck",
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// Include extensions' type declarations
"./extensions/src",
// Include additions and overrides
"src/@types"
"./src/@types"
],
"allowJs": true,
"allowSyntheticDefaultImports": true,
Expand All @@ -38,9 +38,10 @@
"resolveJsonModule": true,
"outDir": ".erb/dll"
},
"include": ["src", "assets"],
"include": ["src", "assets", "!**/*.test.{ts,tsx}"],
"exclude": [
"node_modules",
"dist",
"test",
"release/build",
"release/app/dist",
Expand Down
4 changes: 0 additions & 4 deletions tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"skipLibCheck": true
},
"include": [
".eslintrc.js",
".eslintrc.cjs",
"*.ts",
".erb/configs",
".erb/mocks",
Expand Down

0 comments on commit d2f69b5

Please sign in to comment.