Skip to content

Commit

Permalink
Add tsconfigs and husky hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
salesfelipe committed Mar 7, 2019
1 parent ef5a630 commit 86f2a6c
Show file tree
Hide file tree
Showing 13 changed files with 7,016 additions and 63 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

48 changes: 4 additions & 44 deletions .gitignore
@@ -1,45 +1,5 @@
### SublimeText ###
*.sublime-workspace

### VS Code ###
*.vscode

### OSX ###
.DS_Store
.AppleDouble
.LSOverride
Icon

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# App specific
node_modules/
docs/_book/
.tmp
.idea
npm-debug.log
.build/
lib
dist
build
lerna-debug.log
yarn-error.log
*.orig
package-lock.json
yarn.lock
.vscode/
!Icon
/.eslintrc
/react/*.js.map
17 changes: 17 additions & 0 deletions .vtex/cy.yml
@@ -0,0 +1,17 @@
version: 0.2
phases:
install:
commands:
- echo Installing Packages...
- cd react
- npm install
- echo Packages installed!
pre_build:
commands:
- echo Running tests...
- cd react
- npm run test
- echo Tests finished!
cache:
paths:
- 'node_modules/**/*'
3 changes: 3 additions & 0 deletions _releasy.json
@@ -0,0 +1,3 @@
{
"notes": true
}
8 changes: 8 additions & 0 deletions node/yarn.lock
@@ -0,0 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@types/node@^10.12.20":
version "10.12.20"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.20.tgz#f79f959acd3422d0889bd1ead1664bd2d17cd367"
integrity sha512-9spv6SklidqxevvZyOUGjZVz4QRXGu2dNaLyXIFzFYZW0AGDykzPRIUFJXTlQXyfzAucddwTcGtJNim8zqSOPA==
27 changes: 13 additions & 14 deletions package.json
@@ -1,22 +1,21 @@
{
"version": "0.23.2",
"devDependencies": {
"@types/exenv": "^1.2.0",
"@vtex/intl-equalizer": "^2.0.1",
"husky": "^1.3.1"
},
"scripts": {
"lint:locales": "intl-equalizer"
"lint:messages": "intl-equalizer"
},
"husky": {
"hooks": {
"pre-commit": "cd ./react && yarn lint",
"pre-push": "yarn lint:messages && cd ./react && yarn test && yarn lint"
}
},
"intl-equalizer": {
"referenceLocale": "en",
"localeDirectory": "react/locales/"
},
"dependencies": {
"babel-eslint": "^10.0.1",
"eslint": "^5.9.0",
"eslint-config-prettier": "^3.3.0",
"eslint-config-vtex": "^8.0.0",
"eslint-config-vtex-react": "^3.0.3",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-prettier": "^3.0.0",
"prettier": "^1.15.2"
},
"devDependencies": {
"@vtex/intl-equalizer": "^2.0.1"
}
}
3 changes: 3 additions & 0 deletions react/.babelrc
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
58 changes: 57 additions & 1 deletion react/package.json
Expand Up @@ -14,6 +14,62 @@
"recompose": "^0.27.1"
},
"devDependencies": {
"@types/node": "^10.12.20"
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.1.0",
"@types/graphql": "^14.0.7",
"@types/jest": "^23.3.13",
"@types/node": "^10.12.21",
"@types/prop-types": "^15.5.8",
"@types/react": "^16.8.1",
"@types/react-intl": "^2.3.15",
"babel-jest": "^24.1.0",
"jest": "^23.6.0",
"jest-dom": "^3.0.0",
"jest-transform-graphql": "^2.1.0",
"prettier": "^1.16.1",
"react-dom": "^16.7.0",
"react-testing-library": "^5.4.4",
"regenerator-runtime": "^0.13.1",
"tslint": "^5.12.1",
"tslint-config-vtex": "^2.1.0",
"tslint-eslint-rules": "^5.4.0",
"typescript": "^3.3.1",
"typescript-babel-jest": "^1.0.5"
},
"resolutions": {
"babel-core": "^7.0.0-bridge.0"
},
"scripts": {
"test": "jest",
"test:watch": "jest --watch",
"lint": "tsc --noEmit && tslint -c tslint.json -e './mocks/*.ts' './**/*.ts'",
"lint:locales": "intl-equalizer"
},
"jest": {
"verbose": true,
"moduleNameMapper": {
"\\.(css|scss)$": "<rootDir>/__mocks__/styleMock.ts"
},
"setupTestFrameworkScriptFile": "./testUtils/setupTests.ts",
"collectCoverageFrom": [
"react/**/*.{ts, tsx}"
],
"transform": {
"\\.(gql|graphql)$": "jest-transform-graphql",
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.(ts|tsx)$": "typescript-babel-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node",
"graphql"
]
}
}
30 changes: 30 additions & 0 deletions react/tsconfig.json
@@ -0,0 +1,30 @@
{
"compilerOptions": {
"alwaysStrict": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"jsx": "react",
"lib": ["es2017", "dom"],
"module": "es6",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"skipLibCheck": true,
"sourceMap": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"target": "es2017",
"typeRoots": ["node_modules"],
"types": ["node", "jest", "graphql"]
},
"exclude": ["node_modules"],
"include": ["./typings/*.d.ts", "./**/*.tsx"],
"typeAcquisition": {
"enable": false
}
}
6 changes: 6 additions & 0 deletions react/tslint.json
@@ -0,0 +1,6 @@
{
"extends": "tslint-config-vtex",
"rules": {
"object-literal-sort-keys": false
}
}

0 comments on commit 86f2a6c

Please sign in to comment.