diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..76add87 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +node_modules +dist \ No newline at end of file diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..41542ff --- /dev/null +++ b/.eslintrc @@ -0,0 +1,12 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended" + ] + } \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..a1bd96f --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": true, + "trailingComma": "none", + "singleQuote": true, + "printWidth": 80 +} \ No newline at end of file diff --git a/package.json b/package.json index c7ff29b..2a3f089 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,18 @@ "description": "Mancala game library", "main": "index.js", "scripts": { - "dev" : "yarn tsc -w", - "test": "echo \"Error: no test specified\" && exit 1" + "dev": "yarn tsc -w", + "test": "echo \"Error: no test specified\" && exit 1", + "lint": "eslint . --ext .ts", + "prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write" }, "author": "", "license": "ISC", "devDependencies": { - "typescript": "^4.6.3" + "@typescript-eslint/eslint-plugin": "^5.21.0", + "@typescript-eslint/parser": "^5.21.0", + "eslint": "^8.14.0", + "typescript": "^4.6.3", + "prettier": "^2.6.2" } }