Skip to content

Commit

Permalink
Added lint packages and configs
Browse files Browse the repository at this point in the history
Signed-off-by: Saurabh Kamat <[email protected]>
  • Loading branch information
sauk2 committed Jun 5, 2024
1 parent f03fa46 commit d84ac48
Show file tree
Hide file tree
Showing 7 changed files with 2,453 additions and 164 deletions.
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:prettier/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {},
"ignorePatterns": ["dist", "coverage", "*.md", "*.yml", "*.yaml"]
}
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run build
npx lint-staged
9 changes: 9 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
"*": [
"eslint --cache --fix --config .eslintrc.json",
"prettier --write --config .prettierrc --ignore-path .prettierignore --ignore-unknown",
// Note: doing the build here ensures we omit unstaged changes
() => "npm run build",
() => "git add dist/index.js",
],
};
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
coverage
*.md
*.yml
*.yaml
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": false,
"semi": true,
"tabWidth": 2,
"useTabs": true
}
Loading

0 comments on commit d84ac48

Please sign in to comment.