Skip to content

Commit 1cac306

Browse files
committed
Add prettier
1 parent dec72c7 commit 1cac306

6 files changed

+46
-15
lines changed

.eslintrc.js

-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ module.exports = {
1919
"no-constant-condition": "off",
2020
"prefer-promise-reject-errors": "off",
2121
"no-async-promise-executor": "off",
22-
"quotes": "off",
2322
"no-extra-boolean-cast": "off",
2423

2524
// Bind or arrow functions in props causes performance issues (but we
@@ -107,7 +106,6 @@ module.exports = {
107106

108107
// Things we do that break the ideal style
109108
"prefer-promise-reject-errors": "off",
110-
"quotes": "off",
111109
"no-extra-boolean-cast": "off",
112110

113111
// Remove Babel things manually due to override limitations
@@ -121,10 +119,6 @@ module.exports = {
121119
"@typescript-eslint/ban-ts-comment": "off",
122120
// We're okay with assertion errors when we ask for them
123121
"@typescript-eslint/no-non-null-assertion": "off",
124-
125-
// The non-TypeScript rule produces false positives
126-
"func-call-spacing": "off",
127-
"@typescript-eslint/func-call-spacing": ["error"],
128122
},
129123
},
130124
// temporary override for offending icon require files

.prettierignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/coverage
2+
/lib
3+
4+
/.idea
5+
.vscode
6+
.vscode/
7+
8+
# Legacy skinning file that some people might still have
9+
/src/component-index.js
10+
11+
/.npmrc
12+
/*.log
13+
package-lock.json
14+
yarn.lock
15+
16+
/src/i18n/strings

.prettierrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("eslint-plugin-matrix-org/.prettierrc.js");

.stylelintrc.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
module.exports = {
2-
"extends": "stylelint-config-standard",
2+
"extends": [
3+
"stylelint-config-standard",
4+
"stylelint-config-prettier",
5+
],
36
customSyntax: require('postcss-scss'),
47
"plugins": [
58
"stylelint-scss",
69
],
710
"rules": {
811
"color-hex-case": null,
9-
"indentation": 4,
1012
"comment-empty-line-before": null,
1113
"declaration-empty-line-before": null,
1214
"length-zero-no-unit": null,

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"start:all": "echo THIS IS FOR LEGACY PURPOSES ONLY. && yarn start:build",
4646
"start:build": "babel src -w -s -d lib --verbose --extensions \".ts,.js\"",
4747
"lint": "yarn lint:types && yarn lint:js && yarn lint:style",
48-
"lint:js": "eslint --max-warnings 0 src test cypress",
49-
"lint:js-fix": "eslint --fix src test cypress",
48+
"lint:js": "eslint --max-warnings 0 src test cypress && prettier --check .",
49+
"lint:js-fix": "prettier --loglevel=warn --write . && eslint --fix src test cypress",
5050
"lint:types": "tsc --noEmit --jsx react && tsc --noEmit --jsx react -p cypress",
5151
"lint:style": "stylelint \"res/css/**/*.pcss\"",
5252
"test": "jest",
@@ -184,10 +184,11 @@
184184
"enzyme-to-json": "^3.6.2",
185185
"eslint": "8.28.0",
186186
"eslint-config-google": "^0.14.0",
187+
"eslint-config-prettier": "^8.5.0",
187188
"eslint-plugin-deprecate": "^0.7.0",
188189
"eslint-plugin-import": "^2.25.4",
189190
"eslint-plugin-jsx-a11y": "^6.5.1",
190-
"eslint-plugin-matrix-org": "0.8.0",
191+
"eslint-plugin-matrix-org": "0.9.0",
191192
"eslint-plugin-react": "^7.28.0",
192193
"eslint-plugin-react-hooks": "^4.3.0",
193194
"eslint-plugin-unicorn": "^45.0.0",
@@ -203,10 +204,12 @@
203204
"matrix-web-i18n": "^1.3.0",
204205
"node-fetch": "2",
205206
"postcss-scss": "^4.0.4",
207+
"prettier": "2.8.0",
206208
"raw-loader": "^4.0.2",
207209
"react-test-renderer": "^17.0.2",
208210
"rimraf": "^3.0.2",
209211
"stylelint": "^14.9.1",
212+
"stylelint-config-prettier": "^9.0.4",
210213
"stylelint-config-standard": "^29.0.0",
211214
"stylelint-scss": "^4.2.0",
212215
"typescript": "4.9.3",

yarn.lock

+19-4
Original file line numberDiff line numberDiff line change
@@ -4047,6 +4047,11 @@ eslint-config-google@^0.14.0:
40474047
resolved "https://registry.yarnpkg.com/eslint-config-google/-/eslint-config-google-0.14.0.tgz#4f5f8759ba6e11b424294a219dbfa18c508bcc1a"
40484048
integrity sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==
40494049

4050+
eslint-config-prettier@^8.5.0:
4051+
version "8.5.0"
4052+
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
4053+
integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
4054+
40504055
eslint-import-resolver-node@^0.3.6:
40514056
version "0.3.6"
40524057
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd"
@@ -4105,10 +4110,10 @@ eslint-plugin-jsx-a11y@^6.5.1:
41054110
minimatch "^3.1.2"
41064111
semver "^6.3.0"
41074112

4108-
eslint-plugin-matrix-org@0.8.0:
4109-
version "0.8.0"
4110-
resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.8.0.tgz#daa1396900a8cb1c1d88f1a370e45fc32482cd9e"
4111-
integrity sha512-/Poz/F8lXYDsmQa29iPSt+kO+Jn7ArvRdq10g0CCk8wbRS0sb2zb6fvd9xL1BgR5UDQL771V0l8X32etvY5yKA==
4113+
eslint-plugin-matrix-org@0.9.0:
4114+
version "0.9.0"
4115+
resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.9.0.tgz#b2a5186052ddbfa7dc9878779bafa5d68681c7b4"
4116+
integrity sha512-+j6JuMnFH421Z2vOxc+0YMt5Su5vD76RSatviy3zHBaZpgd+sOeAWoCLBHD5E7mMz5oKae3Y3wewCt9LRzq2Nw==
41124117

41134118
eslint-plugin-react-hooks@^4.3.0:
41144119
version "4.6.0"
@@ -7044,6 +7049,11 @@ prelude-ls@~1.1.2:
70447049
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
70457050
integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==
70467051

7052+
7053+
version "2.8.0"
7054+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.0.tgz#c7df58393c9ba77d6fba3921ae01faf994fb9dc9"
7055+
integrity sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==
7056+
70477057
pretty-bytes@^5.6.0:
70487058
version "5.6.0"
70497059
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"
@@ -7996,6 +8006,11 @@ style-search@^0.1.0:
79968006
resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902"
79978007
integrity sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==
79988008

8009+
stylelint-config-prettier@^9.0.4:
8010+
version "9.0.4"
8011+
resolved "https://registry.yarnpkg.com/stylelint-config-prettier/-/stylelint-config-prettier-9.0.4.tgz#1b1dda614d5b3ef6c1f583fa6fa55f88245eb00b"
8012+
integrity sha512-38nIGTGpFOiK5LjJ8Ma1yUgpKENxoKSOhbDNSemY7Ep0VsJoXIW9Iq/2hSt699oB9tReynfWicTAoIHiq8Rvbg==
8013+
79998014
stylelint-config-recommended@^9.0.0:
80008015
version "9.0.0"
80018016
resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-9.0.0.tgz#1c9e07536a8cd875405f8ecef7314916d94e7e40"

0 commit comments

Comments
 (0)