From 0d74aab9cdc9392a916c010d113069efd9f6ea70 Mon Sep 17 00:00:00 2001 From: francisconeves97 Date: Thu, 8 Jul 2021 22:57:55 +0100 Subject: [PATCH] Some changes --- .eslintrc | 4 ++- package.json | 2 +- src/react-app-env.d.ts | 1 + .../__tests__/googleFormsToJson.spec.ts | 7 ++++++ src/typings.d.ts | 12 ++++----- tsconfig.json | 25 ++++++++++++++++--- 6 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 src/react-app-env.d.ts create mode 100644 src/scripts/__tests__/googleFormsToJson.spec.ts diff --git a/.eslintrc b/.eslintrc index c0ab7b3..884b984 100644 --- a/.eslintrc +++ b/.eslintrc @@ -19,7 +19,9 @@ "prettier/prettier": "error", "@typescript-eslint/indent": ["error", 2], "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/explicit-function-return-type": "off" + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-non-null-assertion": "off" }, "env": { "node": true diff --git a/package.json b/package.json index aabe91c..f961ebf 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "prepare": "run-s build", "test": "run-s test:unit test:lint test:build", "test:build": "run-s build", - "test:lint": "eslint .", + "test:lint": "eslint src/**/*.{ts,tsx}", "test:unit": "cross-env CI=1 react-scripts test --env=jsdom", "test:watch": "react-scripts test --env=jsdom", "predeploy": "cd example && yarn install && yarn run build", diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts new file mode 100644 index 0000000..6431bc5 --- /dev/null +++ b/src/react-app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/scripts/__tests__/googleFormsToJson.spec.ts b/src/scripts/__tests__/googleFormsToJson.spec.ts new file mode 100644 index 0000000..8cc6988 --- /dev/null +++ b/src/scripts/__tests__/googleFormsToJson.spec.ts @@ -0,0 +1,7 @@ +import { googleFormsToJson } from '../googleFormsToJson' + +describe('googleFormsToJson', () => { + it('works', () => { + expect(googleFormsToJson).toBeTruthy() + }) +}) diff --git a/src/typings.d.ts b/src/typings.d.ts index cd16102..e3ec8c5 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -3,15 +3,15 @@ * will be overridden with file-specific definitions by rollup */ declare module '*.css' { - const content: { [className: string]: string }; - export default content; + const content: { [className: string]: string } + export default content } -interface SvgrComponent extends React.StatelessComponent> {} +type SvgrComponent = React.StatelessComponent> declare module '*.svg' { - const svgUrl: string; - const svgComponent: SvgrComponent; - export default svgUrl; + const svgUrl: string + const svgComponent: SvgrComponent + export default svgUrl export { svgComponent as ReactComponent } } diff --git a/tsconfig.json b/tsconfig.json index 52c2390..66e34d8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,10 @@ "compilerOptions": { "outDir": "dist", "module": "esnext", - "lib": ["dom", "esnext"], + "lib": [ + "dom", + "esnext" + ], "moduleResolution": "node", "jsx": "react", "sourceMap": true, @@ -15,8 +18,22 @@ "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, "noUnusedParameters": true, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "target": "es5", + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true }, - "include": ["src"], - "exclude": ["node_modules", "dist", "example"] + "include": [ + "src" + ], + "exclude": [ + "node_modules", + "dist", + "example" + ] }