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(