From 18d4d619e489ee72aa826346024b0a796dc71fa3 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Sun, 25 Oct 2020 15:24:27 +0000 Subject: [PATCH] docs: Add prettier support Official guidelines: https://prettier.io/docs/en/install.html https://prettier.io/docs/en/integrating-with-linters.html https://github.com/prettier/eslint-config-prettier Steps taken: npm install --save-dev --save-exact prettier Create .prettierignore Create .prettierrc.js npm install --save-dev eslint-config-prettier Edit .eslintrc.js --- docs/.eslintrc.js | 7 ++++- docs/.prettierignore | 3 +++ docs/.prettierrc.js | 1 + docs/package-lock.json | 61 +++++++++++++++++++++++++++++++++++++++++- docs/package.json | 4 ++- 5 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 docs/.prettierignore create mode 100644 docs/.prettierrc.js diff --git a/docs/.eslintrc.js b/docs/.eslintrc.js index 094ba2e9..94a8fc6a 100644 --- a/docs/.eslintrc.js +++ b/docs/.eslintrc.js @@ -5,7 +5,12 @@ module.exports = { es2021: true, node: true, }, - extends: ["eslint:recommended", "plugin:react/recommended"], + extends: [ + "eslint:recommended", + "plugin:react/recommended", + "prettier", + "prettier/react", + ], parserOptions: { ecmaFeatures: { jsx: true, diff --git a/docs/.prettierignore b/docs/.prettierignore new file mode 100644 index 00000000..d6fb34a7 --- /dev/null +++ b/docs/.prettierignore @@ -0,0 +1,3 @@ +node_modules +build +.docusaurus \ No newline at end of file diff --git a/docs/.prettierrc.js b/docs/.prettierrc.js new file mode 100644 index 00000000..f053ebf7 --- /dev/null +++ b/docs/.prettierrc.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/docs/package-lock.json b/docs/package-lock.json index 7ec8f525..e3f92a4c 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -15,7 +15,9 @@ }, "devDependencies": { "eslint": "^7.12.0", - "eslint-plugin-react": "^7.21.5" + "eslint-config-prettier": "^6.14.0", + "eslint-plugin-react": "^7.21.5", + "prettier": "2.1.2" } }, "node_modules/@algolia/cache-browser-local-storage": { @@ -5303,6 +5305,21 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.14.0.tgz", + "integrity": "sha512-DbVwh0qZhAC7CNDWcq8cBdK6FcVHiMTKmCypOPWeZkp9hJ8xYwTaWSa6bb6cjfi8KOeJy0e9a8Izxyx+O4+gCQ==", + "dev": true, + "dependencies": { + "get-stdin": "^6.0.0" + }, + "bin": { + "eslint-config-prettier-check": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=3.14.1" + } + }, "node_modules/eslint-plugin-react": { "version": "7.21.5", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.21.5.tgz", @@ -6475,6 +6492,15 @@ "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==" }, + "node_modules/get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -10485,6 +10511,18 @@ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, + "node_modules/prettier": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", + "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/pretty-error": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.2.tgz", @@ -20439,6 +20477,15 @@ } } }, + "eslint-config-prettier": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.14.0.tgz", + "integrity": "sha512-DbVwh0qZhAC7CNDWcq8cBdK6FcVHiMTKmCypOPWeZkp9hJ8xYwTaWSa6bb6cjfi8KOeJy0e9a8Izxyx+O4+gCQ==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, "eslint-plugin-react": { "version": "7.21.5", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.21.5.tgz", @@ -21429,6 +21476,12 @@ "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==" }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -25443,6 +25496,12 @@ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, + "prettier": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", + "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", + "dev": true + }, "pretty-error": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.2.tgz", diff --git a/docs/package.json b/docs/package.json index c97ebef6..44536f0c 100644 --- a/docs/package.json +++ b/docs/package.json @@ -29,6 +29,8 @@ }, "devDependencies": { "eslint": "^7.12.0", - "eslint-plugin-react": "^7.21.5" + "eslint-config-prettier": "^6.14.0", + "eslint-plugin-react": "^7.21.5", + "prettier": "2.1.2" } }