diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..4a7ea3036a
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,12 @@
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.eslintrc b/.eslintrc
index 5de30c3db8..97159ff9e7 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -12,6 +12,7 @@
"prettier/react"
],
"plugins": [
+ "import",
"flowtype",
"prettier",
"jest"
@@ -33,6 +34,7 @@
"react/require-default-props": "off", // Optional props can be undefined.
"react/jsx-filename-extension": ["error", { "extensions": [".js"] }], // Don't use jsx
"jsx-a11y/label-has-for": "off", // control is wrapped in a label
- "jsx-a11y/href-no-hash": "off" // broken rule
+ "jsx-a11y/href-no-hash": "off", // broken rule
+ "flowtype/require-valid-file-annotation": ["error", "always"]
}
}
diff --git a/config/build.js b/config/build.js
index 2f2a4bea76..fd18032bf3 100644
--- a/config/build.js
+++ b/config/build.js
@@ -1,3 +1,4 @@
+// @noflow
/* eslint-disable import/no-extraneous-dependencies */
const path = require("path");
const fs = require("fs");
diff --git a/config/enzymeConfig.js b/config/enzymeConfig.js
index 6f413a40b8..bb482582e3 100644
--- a/config/enzymeConfig.js
+++ b/config/enzymeConfig.js
@@ -1,3 +1,5 @@
+// @flow
+
import { configure } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
diff --git a/src/Button/__tests__/IconWrapper.test.js b/src/Button/__tests__/IconWrapper.test.js
index 643b403428..c8fddaf02d 100644
--- a/src/Button/__tests__/IconWrapper.test.js
+++ b/src/Button/__tests__/IconWrapper.test.js
@@ -1,10 +1,12 @@
+// @flow
+
import * as React from "react";
import { shallow } from "enzyme";
import { Money } from "@kiwicom/icons";
import IconWrapper from "../IconWrapper";
describe("IconWrapper", () => {
- const component = shallow();
+ const component = shallow();
it("should contain component named the same as imported icon", () => {
expect(component.find("Money").exists()).toBe(true);
diff --git a/src/Button/__tests__/index.test.js b/src/Button/__tests__/index.test.js
index 4ef3075c13..e8a49d23e1 100644
--- a/src/Button/__tests__/index.test.js
+++ b/src/Button/__tests__/index.test.js
@@ -1,10 +1,14 @@
+// @flow
+
import * as React from "react";
import { shallow } from "enzyme";
import Button from "../";
describe("Button", () => {
const title = "Title";
- const component = shallow();
+ const component = shallow(
+ ,
+ );
const button = component.find("button");
it("Should contain a title ", () => {
expect(button.render().text()).toBe(title);
@@ -14,7 +18,9 @@ describe("Button", () => {
describe("When button is clicked", () => {
const onClick = jest.fn();
const title = "title";
- const component = shallow();
+ const component = shallow(
+ ,
+ );
const button = component.find("button");
it("should execute onClick method", () => {
@@ -25,8 +31,10 @@ describe("When button is clicked", () => {
describe("Rendered with icon", () => {
const title = "title";
- const icon = jest.fn();
- const component = shallow();
+ const icon = () => ;
+ const component = shallow(
+ ,
+ );
const button = component.find("button");
it("Should contain IconWrapper", () => {
expect(button.find("IconWrapper").exists()).toBe(true);
diff --git a/src/SystemMessage/__tests__/IconWrapper.test.js b/src/SystemMessage/__tests__/IconWrapper.test.js
index df1e084e37..33c42d97ff 100644
--- a/src/SystemMessage/__tests__/IconWrapper.test.js
+++ b/src/SystemMessage/__tests__/IconWrapper.test.js
@@ -1,9 +1,12 @@
+// @flow
+
import * as React from "react";
import { shallow } from "enzyme";
import IconWrapper from "../IconWrapper";
describe("System Message", () => {
- const component = shallow();
+ const Icon = () => ;
+ const component = shallow();
it("Should contain Icon", () => {
expect(component.find("Icon").exists()).toBe(true);
diff --git a/src/SystemMessage/__tests__/Title.test.js b/src/SystemMessage/__tests__/Title.test.js
index c3c066ca84..def8de3b0c 100644
--- a/src/SystemMessage/__tests__/Title.test.js
+++ b/src/SystemMessage/__tests__/Title.test.js
@@ -1,3 +1,5 @@
+// @flow
+
import * as React from "react";
import { shallow } from "enzyme";
import Title from "../Title";
diff --git a/src/SystemMessage/__tests__/index.test.js b/src/SystemMessage/__tests__/index.test.js
index 7f51c7a0fb..547c8102f0 100644
--- a/src/SystemMessage/__tests__/index.test.js
+++ b/src/SystemMessage/__tests__/index.test.js
@@ -1,3 +1,5 @@
+// @flow
+
import * as React from "react";
import { shallow } from "enzyme";
import SystemMessage from "../";
@@ -17,7 +19,7 @@ describe("Rendered with title ", () => {
});
describe("Rendered with icon ", () => {
- const icon = jest.fn();
+ const icon = () => ;
const componentWithIcon = shallow();
it("Should contain IconWrapper", () => {
expect(componentWithIcon.find("IconWrapper").exists()).toBe(true);
diff --git a/src/icons/.eslintrc b/src/icons/.eslintrc
new file mode 100644
index 0000000000..d7d8133704
--- /dev/null
+++ b/src/icons/.eslintrc
@@ -0,0 +1,5 @@
+{
+ "rules": {
+ "flowtype/require-valid-file-annotation": "off"
+ }
+}
diff --git a/src/icons/.gitignore b/src/icons/.gitignore
index 502485a638..203f8ce256 100644
--- a/src/icons/.gitignore
+++ b/src/icons/.gitignore
@@ -4,4 +4,5 @@
!/png/
!icons.md
!readme.md
-!.gitignore
\ No newline at end of file
+!.gitignore
+!.eslintrc