From dbe78c1b9227070291b52f81b90d835bdc522260 Mon Sep 17 00:00:00 2001 From: Max Lund Date: Thu, 3 May 2018 14:23:36 -0500 Subject: [PATCH] lint all of example app and add example to lint script --- .eslintignore | 2 ++ .eslintrc | 6 ---- example/test-app/src/App.js | 12 ++++---- .../test-app/src/appStuff/components/item.js | 8 ++--- .../src/appStuff/containers/FeatureDisplay.js | 12 ++++---- .../containers/FeatureWithVariantsDisplay.js | 10 +++---- example/test-app/src/index.js | 30 +++++++++---------- example/test-app/src/rootReducer.js | 6 ++-- package.json | 2 +- 9 files changed, 42 insertions(+), 46 deletions(-) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..7b7dab5 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +/example/test-app/node_modules +/example/test-app/src/registerServiceWorker.js \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 1d1ae35..08c27fb 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,10 +1,4 @@ { - "globals": { - "Stripe": false, - "CONFIG": false, - "React": true, - "analytics": true - }, "parserOptions": { "ecmaVersion": 6, "sourceType": "module", diff --git a/example/test-app/src/App.js b/example/test-app/src/App.js index c1534f9..a807f42 100644 --- a/example/test-app/src/App.js +++ b/example/test-app/src/App.js @@ -1,15 +1,15 @@ -import React, { Component } from "react"; -import logo from "./logo.svg"; -import "./App.css"; -import FeatureWithVariantsDisplay from "./appStuff/containers/FeatureWithVariantsDisplay"; -import FeatureDisplay from "./appStuff/containers/FeatureDisplay"; +import React, { Component } from 'react'; +import logo from './logo.svg'; +import './App.css'; +import FeatureWithVariantsDisplay from './appStuff/containers/FeatureWithVariantsDisplay'; +import FeatureDisplay from './appStuff/containers/FeatureDisplay'; class App extends Component { render() { return (
- logo + logo

Welcome to LD Redux Components

diff --git a/example/test-app/src/appStuff/components/item.js b/example/test-app/src/appStuff/components/item.js index c69be22..f0175ba 100644 --- a/example/test-app/src/appStuff/components/item.js +++ b/example/test-app/src/appStuff/components/item.js @@ -1,16 +1,16 @@ -import React from "react"; -import PropTypes from "prop-types"; +import React from 'react'; +import PropTypes from 'prop-types'; const Item = ({ name, color, icon }) => (

{name}

- +
); Item.propTypes = { name: PropTypes.string.isRequired, color: PropTypes.string.isRequired, - icon: PropTypes.string.isRequired + icon: PropTypes.string.isRequired, }; export default Item; diff --git a/example/test-app/src/appStuff/containers/FeatureDisplay.js b/example/test-app/src/appStuff/containers/FeatureDisplay.js index b5496ca..3a26ef6 100644 --- a/example/test-app/src/appStuff/containers/FeatureDisplay.js +++ b/example/test-app/src/appStuff/containers/FeatureDisplay.js @@ -1,18 +1,18 @@ -import React, { Component, Fragment } from "react"; -import Item from "./../components/item"; -import { Feature, Variant } from "ld-redux-components"; +import React, { Component, Fragment } from 'react'; +import Item from './../components/item'; +import { Feature } from 'ld-redux-components'; export default class FeatureDisplay extends Component { render() { return ( - + - + - + diff --git a/example/test-app/src/appStuff/containers/FeatureWithVariantsDisplay.js b/example/test-app/src/appStuff/containers/FeatureWithVariantsDisplay.js index 802597a..399e0a3 100644 --- a/example/test-app/src/appStuff/containers/FeatureWithVariantsDisplay.js +++ b/example/test-app/src/appStuff/containers/FeatureWithVariantsDisplay.js @@ -1,16 +1,16 @@ -import React, { Component, Fragment } from "react"; -import Item from "./../components/item"; -import { Feature, Variant } from "ld-redux-components"; +import React, { Component, Fragment } from 'react'; +import Item from './../components/item'; +import { Feature, Variant } from 'ld-redux-components'; export default class FeatureWithVariantsDisplay extends Component { render() { return ( - + - + diff --git a/example/test-app/src/index.js b/example/test-app/src/index.js index de5c8b9..2e32cc8 100644 --- a/example/test-app/src/index.js +++ b/example/test-app/src/index.js @@ -1,13 +1,13 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import "./index.css"; -import App from "./App"; -import { Provider } from "react-redux"; -import { createStore } from "redux"; -import ldRedux from "ld-redux"; -import myApp from "./rootReducer"; -import registerServiceWorker from "./registerServiceWorker"; -import { ldrComponentConfig } from "ld-redux-components"; +import React from 'react'; +import ReactDOM from 'react-dom'; +import './index.css'; +import App from './App'; +import { Provider } from 'react-redux'; +import { createStore } from 'redux'; +import ldRedux from 'ld-redux'; +import myApp from './rootReducer'; +import registerServiceWorker from './registerServiceWorker'; +import { ldrComponentConfig } from 'ld-redux-components'; const store = createStore( myApp, @@ -16,19 +16,19 @@ const store = createStore( ); ldRedux.init({ - clientSideId: "YOUR_CLIENT_SIDE_ID", //SET THIS TO SEE THE EXAMPLE + clientSideId: 'YOUR_CLIENT_SIDE_ID', //SET THIS TO SEE THE EXAMPLE store, - flags: { "test-flag-id": true } //SET THIS TO A REAL FLAG ID TO SEE AN EXAMPLE + flags: { 'test-flag-id': true }, //SET THIS TO A REAL FLAG ID TO SEE AN EXAMPLE }); ldrComponentConfig.init({ - reduxKey: "LD" //This value will be the key in your redux store where you flags are + reduxKey: 'LD', //This value will be the key in your redux store where you flags are }); ReactDOM.render( - + , - document.getElementById("root") + document.getElementById('root') ); registerServiceWorker(); diff --git a/example/test-app/src/rootReducer.js b/example/test-app/src/rootReducer.js index 701d7b9..ff31466 100644 --- a/example/test-app/src/rootReducer.js +++ b/example/test-app/src/rootReducer.js @@ -1,8 +1,8 @@ -import { combineReducers } from "redux"; -import ldRedux from "ld-redux"; +import { combineReducers } from 'redux'; +import ldRedux from 'ld-redux'; const myApp = combineReducers({ - LD: ldRedux.reducer() + LD: ldRedux.reducer(), }); export default myApp; diff --git a/package.json b/package.json index 100d252..3ff16a2 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "build": "./node_modules/.bin/babel src --out-dir build", "clean": "rimraf build", "prepare": "yarn clean && yarn build", - "lint": "./node_modules/.bin/eslint src test spec", + "lint": "./node_modules/.bin/eslint src test spec example", "unit": "./node_modules/.bin/jest", "test": "yarn lint && yarn unit" },