From 3eb19250eb4b9c67032844f09d81b3cd906842e8 Mon Sep 17 00:00:00 2001 From: Kamran Ayub Date: Tue, 19 Oct 2021 22:13:12 -0500 Subject: [PATCH] chore: revert prettier config for formatOnSave; eslint-config-prettier compat --- .eslintrc.json | 2 +- package-lock.json | 6 ++++++ package.json | 1 + prettier.config.js | 12 ++++++++++++ webpack.config.js | 4 ++-- 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 prettier.config.js diff --git a/.eslintrc.json b/.eslintrc.json index 9de9f7ba9..c00997e8f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,7 +9,7 @@ "sourceType": "module" }, "plugins": ["@typescript-eslint", "jsdoc"], - "extends": ["plugin:jsdoc/recommended"], + "extends": ["plugin:jsdoc/recommended", "prettier"], "rules": { "@typescript-eslint/naming-convention": ["error", { diff --git a/package-lock.json b/package-lock.json index 82ed19a53..64d2c9f82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15147,6 +15147,12 @@ } } }, + "eslint-config-prettier": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", + "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", + "dev": true + }, "eslint-plugin-jsdoc": { "version": "36.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-36.1.0.tgz", diff --git a/package.json b/package.json index b7305e6ad..2f3ee4af7 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "coveralls": "3.1.1", "css-loader": "6.3.0", "eslint": "7.32.0", + "eslint-config-prettier": "^8.3.0", "eslint-plugin-jsdoc": "36.1.0", "excalibur-jasmine": "0.2.0", "istanbul": "0.4.5", diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 000000000..4904cf55e --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,12 @@ +// .prettierrc.js +module.exports = { + printWidth: 140, + singleQuote: true, + trailingComma: 'none', + arrowParens: 'always', + overrides: [ + { + files: '{src,sandbox/src,sandbox/tests}/**/*.{ts,js,json,css,md}' + } + ] +}; diff --git a/webpack.config.js b/webpack.config.js index f4be7533a..15ff44fb9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,8 +10,8 @@ const dt = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate(); module.exports = { mode: 'development', devtool: 'source-map', - entry: { - 'excalibur': './index.ts', + entry: { + excalibur: './index.ts', 'excalibur.min': './index.ts' }, context: path.resolve(__dirname, 'src/engine'),