Skip to content

Saleor Core: the high performance, composable, headless commerce API.

test prettier and pre-commit

Julian Böhnke4b10bf8375e1
diff --git a/.gitignore b/.gitignore
index 6ccb3d722b..6b28c378af 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,12 +7,13 @@
!.dockerignore
!.eslintrc.json
!.flowconfig
-!.gqlconfig
!.github
!.gitignore
-!.nvmrc
+!.gqlconfig
!.npmrc
+!.nvmrc
!.plop
+!.prettierrc.json
!.pylintrc
!.testcafe
!.travis*
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index dbe30cc5c9..a68b10d190 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -29,6 +29,8 @@ repos:
files: ^saleor/
- repo: https://github.com/prettier/prettier
- rev: '' # Use the sha or tag you want to point at
+ rev: 1.18.2
hooks:
- id: prettier
+ files: ^.*\.js$
+ verbose: true
diff --git a/.prettierrc.json b/.prettierrc.json
new file mode 100644
index 0000000000..ffdb9e97f7
--- /dev/null
+++ b/.prettierrc.json
@@ -0,0 +1,17 @@
+{
+ "arrowParens": "avoid",
+ "bracketSpacing": true,
+ "htmlWhitespaceSensitivity": "css",
+ "insertPragma": false,
+ "jsxBracketSameLine": false,
+ "jsxSingleQuote": false,
+ "printWidth": 80,
+ "proseWrap": "preserve",
+ "quoteProps": "as-needed",
+ "requirePragma": false,
+ "semi": true,
+ "singleQuote": true,
+ "tabWidth": 2,
+ "trailingComma": "none",
+ "useTabs": false
+}
diff --git a/saleor/static/js/stores/variantPicker.js b/saleor/static/js/stores/variantPicker.js
index 68d93b847c..9059dc6bb1 100644
--- a/saleor/static/js/stores/variantPicker.js
+++ b/saleor/static/js/stores/variantPicker.js
@@ -1,4 +1,4 @@
-import { extendObservable } from "mobx";
+import { extendObservable } from 'mobx';
class VariantPickerStore {
constructor() {