add & configure prettier for this project

This commit is contained in:
Adam Piontek 2022-09-07 08:37:57 -04:00
parent 6156320dc8
commit 1a47184c29
3 changed files with 52 additions and 13 deletions

View file

@ -1,18 +1,12 @@
module.exports = { module.exports = {
parserOptions: { parserOptions: {
ecmaVersion: "latest" ecmaVersion: "latest",
}, },
env: { env: {
browser: false, browser: false,
es6: true, es6: true,
node: true, node: true,
mocha: true mocha: true,
}, },
extends: [ extends: ["eslint:recommended", "prettier"]
'eslint:recommended' };
],
rules: {
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
}
}

44
package-lock.json generated
View file

@ -10,7 +10,9 @@
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"eslint": "^8.23.0", "eslint": "^8.23.0",
"mocha": "^10.0.0" "eslint-config-prettier": "^8.5.0",
"mocha": "^10.0.0",
"prettier": "^2.7.1"
} }
}, },
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
@ -586,6 +588,18 @@
"url": "https://opencollective.com/eslint" "url": "https://opencollective.com/eslint"
} }
}, },
"node_modules/eslint-config-prettier": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz",
"integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==",
"dev": true,
"bin": {
"eslint-config-prettier": "bin/cli.js"
},
"peerDependencies": {
"eslint": ">=7.0.0"
}
},
"node_modules/eslint-scope": { "node_modules/eslint-scope": {
"version": "7.1.1", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz",
@ -1422,6 +1436,21 @@
"node": ">= 0.8.0" "node": ">= 0.8.0"
} }
}, },
"node_modules/prettier": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/punycode": { "node_modules/punycode": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
@ -2295,6 +2324,13 @@
} }
} }
}, },
"eslint-config-prettier": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz",
"integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==",
"dev": true,
"requires": {}
},
"eslint-scope": { "eslint-scope": {
"version": "7.1.1", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz",
@ -2882,6 +2918,12 @@
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
"dev": true "dev": true
}, },
"prettier": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
"integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
"dev": true
},
"punycode": { "punycode": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",

View file

@ -5,7 +5,8 @@
"main": "solver.js", "main": "solver.js",
"scripts": { "scripts": {
"test": "mocha", "test": "mocha",
"lint": "eslint --ext .js --ignore-path .gitignore --fix ." "lint": "eslint --ext .js --ignore-path .gitignore --fix .",
"format": "prettier . --write"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -19,6 +20,8 @@
"homepage": "https://github.com/IgniparousTempest/javascript-tri-peaks-solitaire-solver#readme", "homepage": "https://github.com/IgniparousTempest/javascript-tri-peaks-solitaire-solver#readme",
"devDependencies": { "devDependencies": {
"eslint": "^8.23.0", "eslint": "^8.23.0",
"mocha": "^10.0.0" "eslint-config-prettier": "^8.5.0",
"mocha": "^10.0.0",
"prettier": "^2.7.1"
} }
} }