Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: add Prettier #4707

Merged
merged 8 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const svgPresentationAttributes = [

module.exports = {
root: true,
extends: ['transloadit'],
extends: ['transloadit', 'prettier'],
env: {
es6: true,
jest: true,
Expand Down Expand Up @@ -63,7 +63,6 @@ module.exports = {
// rules we want to enforce
'array-callback-return': 'error',
'func-names': 'error',
'implicit-arrow-linebreak': 'error',
'import/no-dynamic-require': 'error',
'import/no-extraneous-dependencies': 'error',
'max-len': 'error',
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
*.js
*.jsx
*.cjs
*.mjs
*.md
*.lock
12 changes: 12 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
proseWrap: 'always',
singleQuote: true,
trailingComma: 'all',
semi: false,
overrides: [{
files: "packages/@uppy/angular/**",
options:{
semi: true,
},
}]
};
2 changes: 1 addition & 1 deletion e2e/clients/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ <h1>Test apps</h1>
<li><a href="dashboard-ui/index.html">dashboard-ui</a></li>
<li><a href="dashboard-vue/index.html">dashboard-vue</a></li>
</ul>
<nav>
</nav>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier already caught an HTML syntax error

</body>
</html>
2 changes: 1 addition & 1 deletion examples/transloadit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h2>Form</h2>
<strong id="uppy-form-selected-files"></strong>
<button type="button" id="uppy-select-files">Select Files</button>
</label>
<div class="progress"></div>
<span class="progress"></span>
</p>
<p>
<button type="submit">
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
"description": "Extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:",
"lint-staged": {
"*.{js,mjs,cjs,jsx}": "eslint --fix",
"*.{ts,mts,cts,tsx}": "eslint --fix",
"*.{ts,mts,cts,tsx}": [
"eslint --fix",
"prettier -w"
],
"*.{css,html,json,scss,vue,yaml,yml}": "prettier -w",
"*.md": [
"remark --silently-ignore -i .remarkignore -foq",
"eslint --fix"
Expand Down Expand Up @@ -62,6 +66,7 @@
"esbuild": "^0.17.1",
"esbuild-plugin-babel": "^0.2.3",
"eslint": "^8.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-transloadit": "^2.0.0",
"eslint-plugin-compat": "^4.0.0",
"eslint-plugin-cypress": "^2.12.1",
Expand Down Expand Up @@ -91,6 +96,7 @@
"postcss-dir-pseudo-class": "^6.0.0",
"postcss-logical": "^5.0.0",
"pre-commit": "^1.2.2",
"prettier": "^3.0.3",
"remark-cli": "^11.0.0",
"resolve": "^1.17.0",
"sass": "^1.29.0",
Expand Down
22 changes: 22 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9045,6 +9045,7 @@ __metadata:
esbuild: ^0.17.1
esbuild-plugin-babel: ^0.2.3
eslint: ^8.0.0
eslint-config-prettier: ^9.0.0
eslint-config-transloadit: ^2.0.0
eslint-plugin-compat: ^4.0.0
eslint-plugin-cypress: ^2.12.1
Expand Down Expand Up @@ -9074,6 +9075,7 @@ __metadata:
postcss-dir-pseudo-class: ^6.0.0
postcss-logical: ^5.0.0
pre-commit: ^1.2.2
prettier: ^3.0.3
remark-cli: ^11.0.0
resolve: ^1.17.0
sass: ^1.29.0
Expand Down Expand Up @@ -15778,6 +15780,17 @@ __metadata:
languageName: node
linkType: hard

"eslint-config-prettier@npm:^9.0.0":
version: 9.0.0
resolution: "eslint-config-prettier@npm:9.0.0"
peerDependencies:
eslint: ">=7.0.0"
bin:
eslint-config-prettier: bin/cli.js
checksum: 362e991b6cb343f79362bada2d97c202e5303e6865888918a7445c555fb75e4c078b01278e90be98aa98ae22f8597d8e93d48314bec6824f540f7efcab3ce451
languageName: node
linkType: hard

"eslint-config-transloadit@npm:^2.0.0":
version: 2.0.0
resolution: "eslint-config-transloadit@npm:2.0.0"
Expand Down Expand Up @@ -26290,6 +26303,15 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:^3.0.3":
version: 3.0.3
resolution: "prettier@npm:3.0.3"
bin:
prettier: bin/prettier.cjs
checksum: e10b9af02b281f6c617362ebd2571b1d7fc9fb8a3bd17e371754428cda992e5e8d8b7a046e8f7d3e2da1dcd21aa001e2e3c797402ebb6111b5cd19609dd228e0
languageName: node
linkType: hard

"pretty-bytes@npm:^5.3.0, pretty-bytes@npm:^5.6.0":
version: 5.6.0
resolution: "pretty-bytes@npm:5.6.0"
Expand Down