Skip to content

Commit

Permalink
chore: add initial config for typescript and linters
Browse files Browse the repository at this point in the history
Add TypeScript 4.6.7
Add linters: ESLint and prettier (include plugins)\Add scripts to package.json
  • Loading branch information
nelson6e65 committed May 6, 2022
1 parent efea283 commit 8c267ca
Show file tree
Hide file tree
Showing 12 changed files with 1,248 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
/lib
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins": ["@typescript-eslint", "import"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier"
]
}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,4 @@ package-lock.json
yarn.lock

# Distribution

/dist
/lib
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint-staged


pnpm pretty-quick --staged
3 changes: 3 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"**/*.+(ts|tsx)": ["eslint --fix"]
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# public-hoist-pattern[]=*
engine-strict=true
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/dist
/lib
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
"arrowParens": "always",
"trailingComma": "es5",
"xmlWhitespaceSensitivity": "ignore",

"overrides": [
{
"files": ".lintstagedrc",
"options": {
"parser": "json"
}
}
],

"pluginSearchDirs": ["./node_modules", "./node_modules/.pnpm"],
"plugins": ["prettier-plugin-packagejson", "@prettier/plugin-xml"]
}
28 changes: 27 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@
"version": "0.0.0-development",
"description": "",
"keywords": [],
"bugs": {
"url": "https://github.com/elegantech/firebase-odm/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/elegantech/firebase-odm.git"
},
"license": "MIT",
"author": "Nelson Martell <[email protected]>",
"main": "lib/index.ts",
"files": [
"lib"
],
"scripts": {
"build": "tsc",
"commit": "git-cz",
"preinstall": "npx -y only-allow pnpm",
"lint": "tsc --noEmit -p . && eslint . && prettier --check .",
"prepare": "husky install",
"semantic-release": "semantic-release"
},
Expand All @@ -25,12 +34,29 @@
"@commitlint/config-conventional": "^16.2.4",
"@commitlint/cz-commitlint": "^16.2.4",
"@prettier/plugin-xml": "^2.1.0",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"commitizen": "^4.2.4",
"eslint": "^8.15.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-import": "^2.26.0",
"husky": "^7.0.0",
"inquirer": "^8.2.4",
"lint-staged": "^12.4.1",
"prettier": "^2.6.2",
"prettier-plugin-packagejson": "^2.2.17",
"pretty-quick": "^3.1.3",
"semantic-release": "^19.0.2"
"semantic-release": "^19.0.2",
"typescript": "^4.6.4"
},
"engines": {
"node": ">=14",
"pnpm": ">=7"
},
"publishConfig": {
"access": "public",
"main": "lib/index.js",
"typings": "lib/index.d.ts"
}
}
Loading

0 comments on commit 8c267ca

Please sign in to comment.