Browse Source

refactor: switch to yaml-based prettier config file

Paul Razvan Berg 4 years ago
parent
commit
98371030aa
4 changed files with 15 additions and 20 deletions
  1. 1 1
      .lintstagedrc
  2. 0 17
      .prettierrc
  3. 12 0
      .prettierrc.yaml
  4. 2 2
      package.json

+ 1 - 1
.lintstagedrc

@@ -1,5 +1,5 @@
 {
   "*.{js,json,md,sol,ts}": [
-    "prettier --config ./.prettierrc --write"
+    "prettier --config ./.prettierrc.yaml --write"
   ]
 }

+ 0 - 17
.prettierrc

@@ -1,17 +0,0 @@
-{
-  "arrowParens": "avoid",
-  "bracketSpacing": true,
-  "endOfLine": "auto",
-  "printWidth": 120,
-  "singleQuote": false,
-  "tabWidth": 2,
-  "trailingComma": "all",
-  "overrides": [
-    {
-      "files": "*.sol",
-      "options": {
-        "tabWidth": 4
-      }
-    }
-  ]
-}

+ 12 - 0
.prettierrc.yaml

@@ -0,0 +1,12 @@
+arrowParens: avoid
+bracketSpacing: true
+endOfLine: auto
+printWidth: 120
+singleQuote: false
+tabWidth: 2
+trailingComma: all
+
+overrides:
+  - files: "*.sol"
+    options:
+      tabWidth: 4

+ 2 - 2
package.json

@@ -75,8 +75,8 @@
     "lint:sol": "solhint --config ./.solhint.json --max-warnings 0 \"contracts/**/*.sol\"",
     "lint:ts": "eslint --config ./.eslintrc.yaml --ignore-path ./.eslintignore --ext .js,.ts .",
     "postinstall": "husky install",
-    "prettier": "prettier --config ./.prettierrc --write \"**/*.{js,json,md,sol,ts}\"",
-    "prettier:check": "prettier --check --config ./.prettierrc \"**/*.{js,json,md,sol,ts}\"",
+    "prettier": "prettier --config ./.prettierrc.yaml --write \"**/*.{js,json,md,sol,ts}\"",
+    "prettier:check": "prettier --check --config ./.prettierrc.yaml \"**/*.{js,json,md,sol,ts}\"",
     "test": "hardhat test",
     "typechain": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat typechain"
   }