Skip to content

Commit 1a756c2

Browse files
committed
Introduce prettier and eslint for typescript
1 parent e4b0928 commit 1a756c2

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.eslintrc.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
parser: "@typescript-eslint/parser",
3+
extends: ["prettier"],
4+
plugins: ["@typescript-eslint", "prettier"],
5+
rules: {
6+
"prettier/prettier": ["error"],
7+
},
8+
};

.prettierrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
trailingComma: "es5",
3+
arrowParens: "avoid",
4+
};

package.json

+7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"scripts": {
1212
"prepare": "npm run build",
1313
"test": "echo 'no tests to run'",
14+
"lint": "eslint . --ext .ts",
1415
"build": "tsc -p config/tsconfig.cjs.json && tsc -p config/tsconfig.esm.json && tsc -p config/tsconfig.types.json"
1516
},
1617
"repository": {
@@ -38,6 +39,12 @@
3839
"vue": "^2.0.0 || >=3.0.0"
3940
},
4041
"devDependencies": {
42+
"@typescript-eslint/eslint-plugin": "^5.1.0",
43+
"@typescript-eslint/parser": "^5.1.0",
44+
"eslint": "^8.0.1",
45+
"eslint-config-prettier": "^8.3.0",
46+
"eslint-plugin-prettier": "^4.0.0",
47+
"prettier": "^2.4.1",
4148
"typescript": "^4.3.5"
4249
}
4350
}

0 commit comments

Comments
 (0)