Skip to content

Commit

Permalink
feat: configure prettier, eslint, husky and lint-staged (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanOricil authored Jan 31, 2024
2 parents b0e37b5 + 8f7da2f commit c5f005b
Show file tree
Hide file tree
Showing 9 changed files with 4,116 additions and 1,462 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 2015,
"sourceType": "module"
}
}
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"

pnpm exec lint-staged
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
coverage
node_modules
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
23 changes: 0 additions & 23 deletions jest.config.js

This file was deleted.

21 changes: 21 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"preset": "ts-jest",
"testEnvironment": "node",
"testMatch": ["**/?(*.)+(spec|test).ts?(x)"],
"collectCoverageFrom": ["src/**/*.{ts,tsx}"],
"verbose": true,
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
},
"moduleNameMapper": {
"^@src/(.*)$": "<rootDir>/src/$1"
},
"coverageThreshold": {
"global": {
"branches": 80,
"functions": 80,
"lines": 80,
"statements": 80
}
}
}
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
"build": "rollup -c",
"start": "node dist/index.cjs",
"test": "jest --coverage",
"release": "semantic-release"
"release": "semantic-release",
"lint": "eslint .",
"format": "prettier --write \"**/*.{js,ts}\"",
"prepare": "husky install"
},
"lint-staged": {
"**/*": "prettier --write \"**/*.{js,ts}\" --ignore-unknown"
},
"devDependencies": {
"@rollup/plugin-terser": "^0.4.4",
Expand All @@ -31,7 +37,12 @@
"@semantic-release/npm": "^11.0.2",
"@semantic-release/release-notes-generator": "^12.1.0",
"@types/jest": "^29.5.11",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"lint-staged": "^15.2.0",
"prettier": "3.2.4",
"rollup": "^4.9.6",
"semantic-release": "^17.4.7",
"ts-jest": "^29.1.2",
Expand Down
Loading

0 comments on commit c5f005b

Please sign in to comment.