Skip to content

Commit dcd0594

Browse files
committed
setup eslint, prettier and git hooks
1 parent dedcdcb commit dcd0594

File tree

4 files changed

+1898
-398
lines changed

4 files changed

+1898
-398
lines changed

.eslintrc.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"env": {
3+
"es2021": true,
4+
"node": true,
5+
"jest": true
6+
},
7+
"extends": ["standard", "plugin:prettier/recommended"],
8+
"parser": "@typescript-eslint/parser",
9+
"parserOptions": {
10+
"ecmaVersion": 12,
11+
"sourceType": "module"
12+
},
13+
"plugins": ["@typescript-eslint", "prettier"],
14+
"rules": {
15+
"prettier/prettier": ["error"],
16+
"no-useless-constructor": "off",
17+
"@typescript-eslint/no-useless-constructor": ["error"],
18+
"no-use-before-define": "off",
19+
"@typescript-eslint/no-use-before-define": [
20+
"error",
21+
{ "typedefs": false, "functions": false }
22+
]
23+
},
24+
"ignorePatterns": ["dist/**"]
25+
}

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"tabWidth": 2,
3+
"semi": false,
4+
"singleQuote": true,
5+
"endOfLine": "auto"
6+
}

package.json

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,66 @@
11
{
22
"name": "jsonfromtable",
3-
"version": "1.0.0",
4-
"description": "Generate json from table table",
5-
"main": "index.js",
3+
"version": "2.0.0",
4+
"description": "Convert html tables to javascript objects, array or json",
5+
"main": "dist/index.js",
66
"scripts": {
77
"watch": "tsc -w",
88
"build": "tsc",
9-
"test": "jest"
9+
"lint": "eslint src/**.ts",
10+
"test": "jest",
11+
"clean": "rimraf dist",
12+
"cb": "yarn clean && yarn build"
1013
},
1114
"repository": {
1215
"type": "git",
1316
"url": "git+https://github.com/coderosh/jsonfromtable.git"
1417
},
15-
"keywords": [],
18+
"keywords": [
19+
"json from table",
20+
"table to json",
21+
"html to json",
22+
"table parser",
23+
"html table",
24+
"table scrapper"
25+
],
1626
"author": "Roshan Acharya <[email protected]>",
17-
"license": "ISC",
27+
"license": "MIT",
1828
"bugs": {
1929
"url": "https://github.com/coderosh/jsonfromtable/issues"
2030
},
2131
"homepage": "https://github.com/coderosh/jsonfromtable#readme",
32+
"dependencies": {
33+
"cheerio": "^1.0.0-rc.10",
34+
"node-fetch": "^2.6.1"
35+
},
36+
"gitHooks": {
37+
"pre-commit": "lint-staged && yarn cb && yarn test && git add ."
38+
},
39+
"lint-staged": {
40+
"*.ts": [
41+
"eslint --fix"
42+
]
43+
},
2244
"devDependencies": {
2345
"@types/jest": "^26.0.23",
2446
"@types/node": "^15.12.4",
2547
"@types/node-fetch": "^2.5.10",
48+
"@typescript-eslint/eslint-plugin": "^4.27.0",
49+
"@typescript-eslint/parser": "^4.27.0",
50+
"eslint": "^7.29.0",
51+
"eslint-config-prettier": "^8.3.0",
52+
"eslint-config-standard": "^16.0.3",
53+
"eslint-plugin-import": "^2.23.4",
54+
"eslint-plugin-node": "^11.1.0",
55+
"eslint-plugin-prettier": "^3.4.0",
56+
"eslint-plugin-promise": "^5.1.0",
2657
"jest": "^27.0.4",
58+
"lint-staged": "^11.0.0",
59+
"prettier": "^2.3.1",
60+
"rimraf": "^3.0.2",
2761
"ts-jest": "^27.0.3",
2862
"ts-node": "^10.0.0",
29-
"typescript": "^4.3.4"
30-
},
31-
"dependencies": {
32-
"cheerio": "^1.0.0-rc.10",
33-
"node-fetch": "^2.6.1"
63+
"typescript": "^4.3.4",
64+
"yorkie": "^2.0.0"
3465
}
3566
}

0 commit comments

Comments
 (0)