Skip to content

Commit

Permalink
Add eslint and prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisermann committed Aug 4, 2020
1 parent 4f8e695 commit 884e64c
Show file tree
Hide file tree
Showing 8 changed files with 7,745 additions and 1,661 deletions.
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
dist
node_modules/
examples/
5 changes: 2 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "vtex",
"env": {
"browser": true,
"jest": true
"rules": {
"global-require": "off"
}
}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CHANGELOG.md
node_modules/
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"@vtex/prettier-config"
"@vtex/prettier-config"
9 changes: 4 additions & 5 deletions bin/vtex-test-tools.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env node
'use strict'

const args = process.argv.slice(2)

const script = args[0]
const [script] = args

switch (script) {
case 'test': {
Expand All @@ -12,8 +11,8 @@ switch (script) {
try {
executeScript(...args.slice(1))
} catch (e) {
console.log(`An error occurred while running the script "${script}".\n`)
console.log(
console.info(`An error occurred while running the script "${script}".\n`)
console.info(
'If you think this is a bug in our tools, feel free to file a bug report at',
'https://www.github.com/vtex/react-testing/issues\n'
)
Expand All @@ -24,6 +23,6 @@ switch (script) {
}

default:
console.log(`Unknown script "${script}".`)
console.error(`Unknown script "${script}".`)
break
}
2,979 changes: 1,334 additions & 1,645 deletions examples/hooks/yarn.lock

Large diffs are not rendered by default.

24 changes: 19 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,22 @@
"vtex-test-tools": "./bin/vtex-test-tools.js"
},
"scripts": {
"lint": "eslint ."
"lint": "eslint --ext js,jsx,ts,tsx .",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\""
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,js,tsx,jsx}": [
"eslint --fix",
"prettier --write"
],
"*.json": [
"prettier --write"
]
},
"dependencies": {
"@babel/core": "^7.8.4",
Expand All @@ -49,17 +64,16 @@
"react": "^16.9.0",
"react-apollo": "^3.1.3",
"react-dom": "^16.9.0",
"react-test-renderer": "^16.12.0",
"react-test-renderer": "^16.13.1",
"typescript": "^3.7.3"
},
"devDependencies": {
"@apollo/react-testing": "^3.1.3",
"@babel/runtime": "^7.7.4",
"@vtex/prettier-config": "^0.3.1",
"@vtex/tsconfig": "^0.5.0",
"eslint": "^7.5.0",
"eslint-config-vtex": "^12.7.1",
"eslint-config-vtex-react": "^6.7.1",
"eslint": "^7.6.0",
"eslint-config-vtex": "^12.8.1",
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"prettier": "^2.0.5",
Expand Down
Loading

0 comments on commit 884e64c

Please sign in to comment.