diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..c6a1376d --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "trailingComma": "es5", + "singleQuote": true +} diff --git a/__mocks__/fileMock.ts b/__mocks__/fileMock.ts new file mode 100644 index 00000000..ff8b4c56 --- /dev/null +++ b/__mocks__/fileMock.ts @@ -0,0 +1 @@ +export default {}; diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..2f82d5ca --- /dev/null +++ b/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: ['react-app'], +}; diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 00000000..b9e6eddd --- /dev/null +++ b/jest.config.js @@ -0,0 +1,7 @@ +module.exports = { + moduleNameMapper: { + '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|css|less)$': + '/__mocks__/fileMock.ts', + }, + setupFilesAfterEnv: ['/template/src/setupTests.ts'], +}; diff --git a/package.json b/package.json index 67545180..caa838e4 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,10 @@ "name": "cra-template-redux-typescript", "version": "1.0.1", "scripts": { - "prettify": "prettier --trailing-comma es5 --single-quote --write './template/src/**/*.{ts,tsx}'", + "prettify": "prettier --write './template/src/**/*.{ts,tsx}'", "lint": "eslint './template/src/**/*.{ts,tsx}'", - "type-check": "cd template && tsc --noEmit" + "test": "jest", + "type-check": "tsc" }, "keywords": [ "react", diff --git a/react-app-env.d.ts b/react-app-env.d.ts new file mode 100644 index 00000000..6431bc5f --- /dev/null +++ b/react-app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..53024de9 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react" + } +}