From bc5fa3a7ddd853ef00f894af94eab1315abb3f2b Mon Sep 17 00:00:00 2001 From: jim ulle Date: Wed, 18 Oct 2017 11:31:29 -0400 Subject: [PATCH 1/2] eslint init --- .eslintrc.json | 8 ++++++++ package.json | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..99f7c65 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "extends": "airbnb", + "plugins": [ + "react", + "jsx-a11y", + "import" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 4acd9c1..edcaf46 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,11 @@ "babel-preset-stage-1": "^6.24.1", "babel-runtime": "^6.0.0", "css-loader": "^0.18.0", + "eslint": "^4.9.0", + "eslint-config-airbnb": "^16.1.0", + "eslint-plugin-import": "^2.7.0", + "eslint-plugin-jsx-a11y": "^6.0.2", + "eslint-plugin-react": "^7.4.0", "extract-text-webpack-plugin": "^0.8.2", "file-loader": "^0.8.4", "flow-bin": "^0.56.0", @@ -35,7 +40,8 @@ "webpack": "^1.12.0" }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "lint": "eslint ./src" }, "repository": { "type": "git", From 15fd1689caacdc3adaf985332a3d085e5af08e91 Mon Sep 17 00:00:00 2001 From: Jim Ulle Date: Thu, 26 Oct 2017 22:45:54 -0400 Subject: [PATCH 2/2] clean up additional linting issues --- src/__tests__/Icon-test.js | 48 ++++++++++++++++----------------- src/__tests__/IconStack-test.js | 16 +++++------ src/index.js | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/__tests__/Icon-test.js b/src/__tests__/Icon-test.js index b3f638a..063fbef 100644 --- a/src/__tests__/Icon-test.js +++ b/src/__tests__/Icon-test.js @@ -3,62 +3,62 @@ */ import React from 'react'; -import {renderToString} from 'react-dom/server'; +import { renderToString } from 'react-dom/server'; import Icon from '../Icon'; -describe('Icon', function() { - it('renders Font Awesome className', function() { - let markup = renderToString(); +describe('Icon', function () { + it('renders Font Awesome className', function () { + const markup = renderToString(); expect(/); + it('supports "size"', function () { + const markup = renderToString(); expect(/); + it('supports "rotate"', function () { + const markup = renderToString(); expect(/); + it('supports "flip"', function () { + const markup = renderToString(); expect(/); + it('supports "fixedWidth"', function () { + const markup = renderToString(); expect(/); + it('supports "spin"', function () { + const markup = renderToString(); expect(/); + it('supports "pulse"', function () { + const markup = renderToString(); expect(/); + it('supports "stack"', function () { + const markup = renderToString(); expect(/); + it('supports "inverse"', function () { + const markup = renderToString(); expect(/); + it('supports custom className', function () { + const markup = renderToString(); expect(/); + it('can be rendered using different DOM component', function () { + const markup = renderToString(); expect(/ , @@ -17,8 +17,8 @@ describe('IconStack', function() { expect(/ , @@ -26,8 +26,8 @@ describe('IconStack', function() { expect(/ , diff --git a/src/index.js b/src/index.js index 4a06b51..78c9d52 100644 --- a/src/index.js +++ b/src/index.js @@ -8,4 +8,4 @@ import 'font-awesome/css/font-awesome.css'; import Icon from './Icon'; import IconStack from './IconStack'; -export {Icon as default, Icon, IconStack}; +export { Icon as default, Icon, IconStack };