From adfb88c0b30dfae021d0f23cd49a8bf1752f122c Mon Sep 17 00:00:00 2001 From: eric-gade Date: Mon, 30 Oct 2023 16:03:46 -0400 Subject: [PATCH] Adding prettier to deps along with a basic config --- .eslintrc.json | 28 ++++++++++++++-------------- .prettierrc.json | 6 ++++++ package-lock.json | 42 ++++++++++++++++++++++++++++++++++++++++++ package.json | 5 ++++- 4 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 .prettierrc.json diff --git a/.eslintrc.json b/.eslintrc.json index a2c3511a..ecc20456 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,19 +1,19 @@ { - "env": { - "browser": true, - "commonjs": true, - "es2021": true - }, + "env": { + "browser": true, + "commonjs": true, + "es2021": true + }, "ignorePatterns": ["/_site"], - "extends": "eslint-config-airbnb-base", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, + "extends": ["eslint-config-airbnb-base", "prettier"], + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, "rules": { - "no-param-reassign": ["error", {"props": false}], + "no-param-reassign": ["error", { "props": false }], "quotes": ["error", "single"], - "no-iterator": [ "off" ], - "no-return-await": [ "off" ] - } + "no-iterator": ["off"], + "no-return-await": ["off"] + } } diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..383f6072 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "singleQuote": true, + "trailingComma": "all", + "printWidth": 100, + "tabWidth": 2 +} diff --git a/package-lock.json b/package-lock.json index d09acb42..671cf16c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "chokidar-cli": "^3.0.0", "eleventy-plugin-svg-sprite": "^1.3.1", "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.29.0", "html-validate": "^8.7.0", "js-yaml": "^4.1.0", @@ -40,6 +41,7 @@ "pa11y-ci": "^2.4.2", "postcss": "^8.4.31", "postcss-cli": "^9.1.0", + "prettier": "3.0.3", "rimraf": "^3.0.2", "start-server-and-test": "^2.0.1" } @@ -5044,6 +5046,18 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-config-prettier": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", @@ -11386,6 +11400,21 @@ "node": ">=8" } }, + "node_modules/prettier": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", @@ -19364,6 +19393,13 @@ } } }, + "eslint-config-prettier": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", + "dev": true, + "requires": {} + }, "eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", @@ -23987,6 +24023,12 @@ "integrity": "sha512-BLxfZh+m6UiAiCPZFJ4+vYoL7NrRs5XgCTRrjseATAggXhdZKKxn+JUNmuVYWY23bDHgaEHodxw8mnmtVEDtHw==", "dev": true }, + "prettier": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "dev": true + }, "pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", diff --git a/package.json b/package.json index 684a3b46..f973c5a1 100644 --- a/package.json +++ b/package.json @@ -20,13 +20,14 @@ "federalist": "npm run build", "lint": "eslint . --config .eslintrc.json", "pa11y-ci:sitemap": "sleep 10; pa11y-ci --sitemap http://localhost:8080/sitemap.xml --sitemap-exclude \"/*.pdf\" --sitemap-exclude \"/admin\" --sitemap-find \"^/\" --sitemap-replace \"http://localhost:8080/\"", + "pa11y-ci:sitemap-agile": "sleep 10; pa11y-ci --sitemap http://localhost:8080/sitemap.xml --sitemap-exclude \"/*.pdf\" --sitemap-exclude \"/admin\" --sitemap-find \"^/agile\" --sitemap-replace \"http://localhost:8080/\"", "serve": "npx @11ty/eleventy --serve", "start": "npx @11ty/eleventy --serve", "test": "echo \"Error: no test specified\" && exit 1", "test:links": "npx check-html-links _site --ignore-link-pattern '**/TODO/' 2>&1 | tee /dev/stderr | grep ✅", "test:links-internal": "npx check-html-links _site --ignore-link-pattern '**/TODO/'", "test:html-validation": "html-validate _site/**/*.html", - "test:pa11y-ci": "npx start-server-and-test start 8080 pa11y-ci:sitemap" + "test:pa11y-ci": "npx start-server-and-test start 8080 pa11y-ci:sitemap-agile" }, "author": "", "license": "CC0-1.0", @@ -39,6 +40,7 @@ "chokidar-cli": "^3.0.0", "eleventy-plugin-svg-sprite": "^1.3.1", "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.29.0", "html-validate": "^8.7.0", "js-yaml": "^4.1.0", @@ -51,6 +53,7 @@ "pa11y-ci": "^2.4.2", "postcss": "^8.4.31", "postcss-cli": "^9.1.0", + "prettier": "3.0.3", "rimraf": "^3.0.2", "start-server-and-test": "^2.0.1" },