diff --git a/.eslintrc b/.eslintrc
index a7235ea2..bd3a380a 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,11 +1,7 @@
{
"root": true,
"parser": "babel-eslint",
- "extends": [
- "eslint:recommended",
- "plugin:react/recommended",
- "prettier"
- ],
+ "extends": ["eslint:recommended", "plugin:react/recommended", "prettier"],
"globals": {
"chrome": true
},
@@ -17,17 +13,13 @@
},
"rules": {
"eol-last": ["warn"],
- "max-len": ["warn", { "code": 120 , "ignoreComments": true }],
+ "max-len": ["warn", { "code": 120, "ignoreComments": true }],
"quotes": ["warn", "single", "avoid-escape"],
"jsx-quotes": ["warn", "prefer-double"],
"react/prop-types": 0,
"prettier/prettier": "error"
},
- "plugins": [
- "prettier",
- "react",
- "babel"
- ],
+ "plugins": ["prettier", "react", "babel"],
"settings": {
"react": {
"version": "detect"
diff --git a/.travis.yml b/.travis.yml
index 8b1723df..c3a280f2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,12 +1,13 @@
sudo: false
language: node_js
node_js:
- - "stable"
+ - 'stable'
cache:
yarn: true
directories:
- - "node_modules"
+ - 'node_modules'
script:
- yarn build:all
- yarn lint:all
+ - yarn prettier:check
- yarn test:all
diff --git a/package.json b/package.json
index da9bb1f8..ac76e6dc 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,8 @@
"lint": "eslint \"**/*.{js,jsx,ts,tsx}\" --cache",
"lint:fix": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix --cache",
"lint:all": "eslint \"**/*.{js,jsx,ts,tsx}\"",
- "prettify": "prettier \"**/*.{js,jsx,ts,tsx,json,css,html,md}\" --write",
+ "prettify": "prettier --write .",
+ "prettier:check": "prettier --check .",
"test": "jest --onlyChanged",
"test:all": "jest"
},
@@ -52,5 +53,16 @@
],
"engines": {
"node": ">=10.13.0"
+ },
+ "husky": {
+ "hooks": {
+ "pre-commit": "lint-staged"
+ }
+ },
+ "lint-staged": {
+ "**/*": [
+ "eslint --fix",
+ "prettier --write"
+ ]
}
}
diff --git a/packages/d3-state-visualizer/.babelrc b/packages/d3-state-visualizer/.babelrc
index feae4b3e..06050b00 100644
--- a/packages/d3-state-visualizer/.babelrc
+++ b/packages/d3-state-visualizer/.babelrc
@@ -1,4 +1,7 @@
{
"presets": ["@babel/preset-env"],
- "plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-export-default-from"]
+ "plugins": [
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-export-default-from"
+ ]
}
diff --git a/packages/devui/.babelrc b/packages/devui/.babelrc
index 645cc56e..2d8ea82b 100755
--- a/packages/devui/.babelrc
+++ b/packages/devui/.babelrc
@@ -1,4 +1,7 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
- "plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-export-default-from"]
+ "plugins": [
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-export-default-from"
+ ]
}
diff --git a/packages/react-base16-styling/package.json b/packages/react-base16-styling/package.json
index 86e7818f..183221d4 100644
--- a/packages/react-base16-styling/package.json
+++ b/packages/react-base16-styling/package.json
@@ -19,6 +19,7 @@
"src"
],
"main": "lib/index.js",
+ "types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/reduxjs/redux-devtools.git"
diff --git a/packages/react-dock/.babelrc b/packages/react-dock/.babelrc
index a53745a0..36a7eb52 100644
--- a/packages/react-dock/.babelrc
+++ b/packages/react-dock/.babelrc
@@ -1,4 +1,8 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
- "plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-export-default-from", "react-hot-loader/babel"]
+ "plugins": [
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-export-default-from",
+ "react-hot-loader/babel"
+ ]
}
diff --git a/packages/react-dock/README.md b/packages/react-dock/README.md
index f4491a25..c146ee03 100644
--- a/packages/react-dock/README.md
+++ b/packages/react-dock/README.md
@@ -27,18 +27,18 @@ render() {
#### Dock Props
-| Prop Name | Description |
-|-----------|-------------|
-| position | Side to dock (`left`, `right`, `top` or `bottom`). Default is `left`. |
-| fluid | If `true`, resize dock proportionally on window resize. |
-| size | Size of dock panel (width or height, depending on `position`). If this prop is set, `Dock` is considered as a controlled component, so you need to use `onSizeChange` to track dock resizing. Value is a fraction of window width/height, if `fluid` is true, or pixels otherwise |
-| defaultSize | Default size of dock panel (used for uncontrolled `Dock` component) |
-| isVisible | If `true`, dock is visible |
-| dimMode | If `none` - content is not dimmed, if `transparent` - pointer events are disabled (so you can click through it), if `opaque` - click on dim area closes the dock. Default is `opaque` |
-| duration | Animation duration. Should be synced with transition animation in style properties |
-| dimStyle | Style for dim area |
-| dockStyle | Style for dock |
-| zIndex | Z-index for wrapper |
-| onVisibleChange | Fires when `Dock` wants to change `isVisible` (when opaque dim is clicked, in particular) |
-| onSizeChange | Fires when `Dock` wants to change `size` |
-| children | Dock content - react elements or function that returns an element. Function receives an object with these state values: `{ position, isResizing, size, isVisible }` |
+| Prop Name | Description |
+| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| position | Side to dock (`left`, `right`, `top` or `bottom`). Default is `left`. |
+| fluid | If `true`, resize dock proportionally on window resize. |
+| size | Size of dock panel (width or height, depending on `position`). If this prop is set, `Dock` is considered as a controlled component, so you need to use `onSizeChange` to track dock resizing. Value is a fraction of window width/height, if `fluid` is true, or pixels otherwise |
+| defaultSize | Default size of dock panel (used for uncontrolled `Dock` component) |
+| isVisible | If `true`, dock is visible |
+| dimMode | If `none` - content is not dimmed, if `transparent` - pointer events are disabled (so you can click through it), if `opaque` - click on dim area closes the dock. Default is `opaque` |
+| duration | Animation duration. Should be synced with transition animation in style properties |
+| dimStyle | Style for dim area |
+| dockStyle | Style for dock |
+| zIndex | Z-index for wrapper |
+| onVisibleChange | Fires when `Dock` wants to change `isVisible` (when opaque dim is clicked, in particular) |
+| onSizeChange | Fires when `Dock` wants to change `size` |
+| children | Dock content - react elements or function that returns an element. Function receives an object with these state values: `{ position, isResizing, size, isVisible }` |
diff --git a/packages/react-dock/demo/index.html b/packages/react-dock/demo/index.html
index c6c57bb1..bd6b242b 100644
--- a/packages/react-dock/demo/index.html
+++ b/packages/react-dock/demo/index.html
@@ -2,11 +2,24 @@