Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint problems + Fix tests #14

Merged
merged 4 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
coverage/
*.snap.ts
9 changes: 9 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "vtex",
"root": true,
"env": {
"node": true,
"es6": true,
"jest": true
}
}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.md
7 changes: 1 addition & 6 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"jsxBracketSameLine": true
}
"@vtex/prettier-config"
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Eslint configuration.

### Fixed
- Test errors.

### Securytiy
Klynger marked this conversation as resolved.
Show resolved Hide resolved
- Bump dependencies versions.

## [0.3.4] - 2020-04-15

Expand Down
39 changes: 24 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
{
"version": "0.0.0",
"devDependencies": {
"@vtex/intl-equalizer": "^2.3.0",
"husky": "^2.4.1"
},
"name": "store-form",
"private": true,
"license": "UNLICENSED",
"scripts": {
"lint": "cd ./react && yarn lint",
"test": "cd ./react && yarn test --passWithNoTests",
"lint:locales": "intl-equalizer",
"locales:fix": "intl-equalizer --fix",
"verify": "yarn lint && yarn lint:locales && yarn test"
"lint": "eslint --ext js,jsx,ts,tsx .",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\""
},
"husky": {
"hooks": {
"pre-commit": "yarn lint && yarn lint:locales && yarn locales:fix",
"pre-push": "yarn verify"
"pre-commit": "lint-staged"
}
},
"intl-equalizer": {
"referenceLocale": "en",
"localeDirectory": "messages"
"lint-staged": {
"*.{ts,js,tsx,jsx}": [
"eslint --fix",
"prettier --write"
],
"*.{json,graphql,gql}": [
"prettier --write"
]
},
"devDependencies": {
"@vtex/prettier-config": "^0.1.3",
"eslint": "^6.8.0",
"eslint-config-vtex": "^12.2.1",
"eslint-config-vtex-react": "^6.2.1",
"husky": "^4.2.0",
"lint-staged": "^10.0.2",
"prettier": "^1.19.1",
"typescript": "^3.8.3"
}
}
4 changes: 2 additions & 2 deletions react/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "vtex-react",
"extends": "vtex-react/io",
"env": {
"browser": true,
"es6": true,
"jest": true
}
}
}
19 changes: 7 additions & 12 deletions react/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"version": "0.3.4",
"scripts": {
"lint": "tsc --noEmit && eslint --quiet --fix --ext ts,tsx .",
"test": "vtex-test-tools test",
Expand All @@ -10,31 +11,25 @@
"react-apollo": "^3.1.3",
"react-dom": "^16.8.6",
"react-hook-form-jsonschema": "0.2.0-beta.11",
"react-intl": "3.9.1"
"react-intl": "^4.5.3"
},
"devDependencies": {
"@apollo/react-testing": "^3.1.3",
"@types/graphql": "14.0.7",
"@types/jest": "^25.1.1",
"@types/node": "^13.5.3",
"@types/react": "^16.9.19",
"@types/react-intl": "^3.0.0",
"@vtex/styleguide": "^9.108.2",
"@vtex/test-tools": "^3.0.1",
"@vtex/styleguide": "^9.116.0",
"@vtex/test-tools": "^3.1.0",
"@vtex/tsconfig": "^0.2.0",
"apollo-cache-inmemory": "^1.6.5",
"eslint": "5.x",
"eslint-config-vtex-react": "^5.1.0",
"graphql": "^14.6.0",
"mutationobserver-shim": "^0.3.3",
"prettier": "^1.18.2",
"prop-types": "^15.7.2",
"typescript": "3.7.3"
"mutationobserver-shim": "^0.3.5",
"typescript": "3.8.3"
},
"jest": {
"setupFilesAfterEnv": [
"./setupTest.js"
]
},
"version": "0.3.4"
}
}
2 changes: 2 additions & 0 deletions react/setupTest.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
require('mutationobserver-shim')

window.matchMedia = () => {}
27 changes: 23 additions & 4 deletions react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
{
"extends": "@vtex/tsconfig",
"compilerOptions": {
"noEmitOnError": false,
"alwaysStrict": true,
"esModuleInterop": true,
"jsx": "react",
"lib": ["es2017", "dom", "es2018.promise"],
"module": "esnext",
"moduleResolution": "node",
"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"],
"types": ["node", "jest", "graphql"]
"types": ["node", "jest"]
},
"include": ["./typings/*.d.ts", "./**/*.tsx", "./**/*.ts"]
"exclude": ["node_modules"],
"include": ["./typings/*.d.ts", "./**/*.tsx", "./**/*.ts"],
"typeAcquisition": {
"enable": false
}
}