You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2022/09/20 05:20:05 UTC
[incubator-devlake] branch main updated: feat(config-ui): added prettier to help format code (#2995)
This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 902eb327 feat(config-ui): added prettier to help format code (#2995)
902eb327 is described below
commit 902eb327e6af5fc79856e30328aff5bddd4ce3ab
Author: 青湛 <0x...@gmail.com>
AuthorDate: Tue Sep 20 13:20:00 2022 +0800
feat(config-ui): added prettier to help format code (#2995)
Co-authored-by: mintsweet <ju...@merico.dev>
---
config-ui/.eslintrc | 7 ++-
config-ui/.prettierignore | 0
config-ui/.prettierrc.js | 7 +++
config-ui/package-lock.json | 106 ++++++++++++++++++++++++++++++++++++++++++++
config-ui/package.json | 6 ++-
5 files changed, 123 insertions(+), 3 deletions(-)
diff --git a/config-ui/.eslintrc b/config-ui/.eslintrc
index 35a7c953..09f9b104 100644
--- a/config-ui/.eslintrc
+++ b/config-ui/.eslintrc
@@ -5,7 +5,8 @@
"standard",
"standard-jsx",
"standard-react",
- "plugin:react-hooks/recommended"
+ "plugin:react-hooks/recommended",
+ "prettier"
],
"ignorePatterns": [
"dist/*",
@@ -21,7 +22,8 @@
"plugins": [
"unicorn",
"babel",
- "header"
+ "header",
+ "prettier"
],
"settings": {
"import/resolver": {
@@ -45,6 +47,7 @@
}
},
"rules": {
+ "prettier/prettier": ["warn"],
"camelcase": "off",
"max-len": [1, 140, 2],
"react/jsx-indent": ["error", 2],
diff --git a/config-ui/.prettierignore b/config-ui/.prettierignore
new file mode 100644
index 00000000..e69de29b
diff --git a/config-ui/.prettierrc.js b/config-ui/.prettierrc.js
new file mode 100644
index 00000000..ab84dd6f
--- /dev/null
+++ b/config-ui/.prettierrc.js
@@ -0,0 +1,7 @@
+module.exports = {
+ printWidth: 140,
+ singleQuote: true,
+ jsxSingleQuote: true,
+ trailingComma: 'es5',
+ semi: false,
+}
diff --git a/config-ui/package-lock.json b/config-ui/package-lock.json
index 22f3cf35..33c39051 100644
--- a/config-ui/package-lock.json
+++ b/config-ui/package-lock.json
@@ -50,6 +50,7 @@
"cypress": "^9.5.1",
"eslint": "^7.15.0",
"eslint-config-airbnb": "^18.2.1",
+ "eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^16.0.2",
"eslint-config-standard-jsx": "^10.0.0",
"eslint-config-standard-react": "^11.0.1",
@@ -62,6 +63,7 @@
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-okay": "0.0.2",
+ "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
@@ -77,6 +79,7 @@
"node-sass": "^6.0.1",
"postcss": "^7.0.35",
"postcss-loader": "^4.0.1",
+ "prettier": "^2.7.1",
"resolve-url-loader": "^4.0.0",
"sass": "^1.30.0",
"sass-loader": "^10.2.0",
@@ -9099,6 +9102,18 @@
"eslint-plugin-import": "^2.22.1"
}
},
+ "node_modules/eslint-config-prettier": {
+ "version": "8.5.0",
+ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz",
+ "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==",
+ "dev": true,
+ "bin": {
+ "eslint-config-prettier": "bin/cli.js"
+ },
+ "peerDependencies": {
+ "eslint": ">=7.0.0"
+ }
+ },
"node_modules/eslint-config-standard": {
"version": "16.0.3",
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz",
@@ -9493,6 +9508,27 @@
"eslint-plugin-react": "^7.20.0"
}
},
+ "node_modules/eslint-plugin-prettier": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz",
+ "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==",
+ "dev": true,
+ "dependencies": {
+ "prettier-linter-helpers": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "eslint": ">=7.28.0",
+ "prettier": ">=2.0.0"
+ },
+ "peerDependenciesMeta": {
+ "eslint-config-prettier": {
+ "optional": true
+ }
+ }
+ },
"node_modules/eslint-plugin-promise": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz",
@@ -10392,6 +10428,12 @@
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
+ "node_modules/fast-diff": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
+ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
+ "dev": true
+ },
"node_modules/fast-glob": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz",
@@ -19360,6 +19402,33 @@
"node": ">=0.10.0"
}
},
+ "node_modules/prettier": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
+ "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
+ "dev": true,
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/prettier-linter-helpers": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
+ "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
+ "dev": true,
+ "dependencies": {
+ "fast-diff": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
"node_modules/pretty-bytes": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
@@ -32904,6 +32973,13 @@
"object.entries": "^1.1.2"
}
},
+ "eslint-config-prettier": {
+ "version": "8.5.0",
+ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz",
+ "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==",
+ "dev": true,
+ "requires": {}
+ },
"eslint-config-standard": {
"version": "16.0.3",
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz",
@@ -33170,6 +33246,15 @@
"requireindex": "~1.1.0"
}
},
+ "eslint-plugin-prettier": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz",
+ "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==",
+ "dev": true,
+ "requires": {
+ "prettier-linter-helpers": "^1.0.0"
+ }
+ },
"eslint-plugin-promise": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz",
@@ -33745,6 +33830,12 @@
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
+ "fast-diff": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
+ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
+ "dev": true
+ },
"fast-glob": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz",
@@ -40646,6 +40737,21 @@
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw="
},
+ "prettier": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
+ "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
+ "dev": true
+ },
+ "prettier-linter-helpers": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
+ "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
+ "dev": true,
+ "requires": {
+ "fast-diff": "^1.1.2"
+ }
+ },
"pretty-bytes": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
diff --git a/config-ui/package.json b/config-ui/package.json
index 45d8b0bc..2d57941b 100644
--- a/config-ui/package.json
+++ b/config-ui/package.json
@@ -8,7 +8,8 @@
"start": "webpack serve --progress",
"start-production": "npm run build-production;node server.js",
"lint": "eslint ./src --fix --ext .jsx --ext .js",
- "cypress": "./node_modules/.bin/cypress open"
+ "cypress": "./node_modules/.bin/cypress open",
+ "prettier": "prettier . --write"
},
"dependencies": {
"@babel/eslint-parser": "^7.18.2",
@@ -53,6 +54,7 @@
"cypress": "^9.5.1",
"eslint": "^7.15.0",
"eslint-config-airbnb": "^18.2.1",
+ "eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^16.0.2",
"eslint-config-standard-jsx": "^10.0.0",
"eslint-config-standard-react": "^11.0.1",
@@ -65,6 +67,7 @@
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-okay": "0.0.2",
+ "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
@@ -80,6 +83,7 @@
"node-sass": "^6.0.1",
"postcss": "^7.0.35",
"postcss-loader": "^4.0.1",
+ "prettier": "^2.7.1",
"resolve-url-loader": "^4.0.0",
"sass": "^1.30.0",
"sass-loader": "^10.2.0",