From 28551cb6632e8740a3f4142b1653f322f4ac0436 Mon Sep 17 00:00:00 2001 From: nachtjasmin Date: Thu, 15 Jun 2023 18:32:30 +0200 Subject: [PATCH] Setup eslint/prettier configuration --- .eslintrc.js | 2 +- .vscode/extensions.json | 2 +- package-lock.json | 13 +++++++++++++ package.json | 3 ++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 195768f..a1dd674 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,7 +4,7 @@ module.exports = { es2021: true, node: true, }, - extends: ["eslint:recommended"], + extends: ["eslint:recommended", "prettier"], parserOptions: { ecmaVersion: "latest", sourceType: "module", diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 64dbfec..23b9647 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,3 @@ { - "recommendations": ["esbenp.prettier-vscode"] + "recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] } diff --git a/package-lock.json b/package-lock.json index 99c9013..ce6c22c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@sprout2000/esbuild-copy-plugin": "1.1.8", "esbuild": "0.17.19", "eslint": "^8.42.0", + "eslint-config-prettier": "^8.8.0", "npm-run-all": "^4.1.5", "prettier": "^2.8.8", "web-ext": "^7.6.2" @@ -2449,6 +2450,18 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", + "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-plugin-no-unsanitized": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.0.2.tgz", diff --git a/package.json b/package.json index 2ac0e47..0a062ac 100644 --- a/package.json +++ b/package.json @@ -8,12 +8,13 @@ "watch:webext": "web-ext run --keep-profile-changes --profile-create-if-missing --firefox-profile=.firefox-profile/", "format": "prettier --write --ignore-path .gitignore .", "package": "run-s -l build:**", - "lint": "eslint ." + "lint": "eslint src/" }, "devDependencies": { "@sprout2000/esbuild-copy-plugin": "1.1.8", "esbuild": "0.17.19", "eslint": "^8.42.0", + "eslint-config-prettier": "^8.8.0", "npm-run-all": "^4.1.5", "prettier": "^2.8.8", "web-ext": "^7.6.2"