Skip to content

Commit

Permalink
Merge pull request #1 from andrewarosario/chore/husky-lint
Browse files Browse the repository at this point in the history
chore: add husky and lint staged
  • Loading branch information
andrewarosario committed Aug 21, 2023
2 parents 16ef7a5 + 536793f commit cbe5b80
Show file tree
Hide file tree
Showing 8 changed files with 769 additions and 35 deletions.
8 changes: 5 additions & 3 deletions .eslintrc.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
}
]
}
]
],
"no-console": ["error"],
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/no-explicit-any": ["error"]
}
},
{
Expand All @@ -35,8 +38,7 @@
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
}
}
]
}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
7 changes: 7 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"{src,modules}/**/*.{js,ts,jsx,tsx,json,html,css,scss}": [
"nx affected:lint --fix true --uncommitted",
"nx affected:test",
"nx format:write --uncommited"
]
}
5 changes: 1 addition & 4 deletions e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ declare namespace Cypress {
}
}
//
// -- This is a parent command --
Cypress.Commands.add('login', (email, password) => {
console.log('Custom command example: Login', email, password);
});

//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
Expand Down
32 changes: 6 additions & 26 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,21 @@
"default": {
"runner": "nx-cloud",
"options": {
"cacheableOperations": [
"build",
"lint",
"test",
"e2e"
],
"cacheableOperations": ["build", "lint", "test", "e2e"],
"accessToken": "ODNmZGViZjUtYzMxMi00YjBjLTljZmItY2YyYWRkMjQzZWUwfHJlYWQtd3JpdGU="
}
}
},
"targetDefaults": {
"build": {
"dependsOn": [
"^build"
],
"inputs": [
"production",
"^production"
]
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"test": {
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.preset.js"
]
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
},
"e2e": {
"inputs": [
"default",
"^production"
]
"inputs": ["default", "^production"]
},
"lint": {
"inputs": [
Expand All @@ -46,10 +29,7 @@
}
},
"namedInputs": {
"default": [
"{projectRoot}/**/*",
"sharedGlobals"
],
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"production": [
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
Expand Down
Loading

0 comments on commit cbe5b80

Please sign in to comment.