-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#card-12294790, 12300108, 12294912 - Configured Js/Jsx Lint, Style Li…
…nt, Json Lint
- Loading branch information
1 parent
57331d9
commit 90dcea2
Showing
27 changed files
with
3,264 additions
and
4,210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es6: true, | ||
node: true, | ||
}, | ||
'plugins': [ | ||
'react', | ||
'json' | ||
], | ||
'extends': ['eslint:recommended', 'plugin:react/recommended'], | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
'jsx': true | ||
} | ||
}, | ||
rules: { | ||
'comma-dangle': ['error', 'always-multiline'], | ||
indent: ['error', 2], | ||
'linebreak-style': ['error', 'unix'], | ||
quotes: ['error', 'single'], | ||
semi: ['error', 'always'], | ||
'no-unused-vars': ['warn'], | ||
'no-console': 0, | ||
'eol-last':["error", "always"], | ||
'no-trailing-spaces':'error', | ||
'react/jsx-uses-react': 'error', | ||
'react/jsx-uses-vars': 'error', | ||
'comma-spacing': ["error", { "before": false, "after": true }], | ||
'object-curly-spacing': ["error", "always"], | ||
'key-spacing': ["error", { "beforeColon": false, "afterColon": true }], | ||
'arrow-body-style': ["error", "as-needed"], | ||
'linebreak-style': 0, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "stylelint-config-standard", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
const seleniumServer = require("selenium-server"); | ||
const chromedriver = require("chromedriver"); | ||
const path = require("path"); | ||
require("nightwatch-cucumber")({ | ||
const seleniumServer = require('selenium-server'); | ||
const chromedriver = require('chromedriver'); | ||
const path = require('path'); | ||
require('nightwatch-cucumber')({ | ||
cucumberArgs: [ | ||
"--require-module", | ||
"@babel/register", | ||
"--require", | ||
path.join(__dirname, "test/features/step_definitions"), | ||
"--format", | ||
path.join(__dirname, "node_modules/cucumber-pretty"), | ||
"--format", | ||
"json:" + path.join(__dirname, "reports/cucumber.json"), | ||
path.join(__dirname, "test/features/") | ||
] | ||
'--require-module', | ||
'@babel/register', | ||
'--require', | ||
path.join(__dirname, 'test/features/step_definitions'), | ||
'--format', | ||
path.join(__dirname, 'node_modules/cucumber-pretty'), | ||
'--format', | ||
'json:' + path.join(__dirname, 'reports/cucumber.json'), | ||
path.join(__dirname, 'test/features/'), | ||
], | ||
}); | ||
|
||
module.exports = { | ||
output_folder: path.join(__dirname, "reports"), | ||
custom_assertions_path: "", | ||
page_objects_path: path.join(__dirname, "test/features/page_objects"), | ||
output_folder: path.join(__dirname, 'reports'), | ||
custom_assertions_path: '', | ||
page_objects_path: path.join(__dirname, 'test/features/page_objects'), | ||
live_output: false, | ||
disable_colors: false, | ||
test_workers: { | ||
enabled: true, | ||
workers: "auto" | ||
workers: 'auto', | ||
}, | ||
selenium: { | ||
start_process: true, | ||
server_path: seleniumServer.path, | ||
log_path: "", | ||
host: "127.0.0.1", | ||
port: 4444 | ||
log_path: '', | ||
host: '127.0.0.1', | ||
port: 4444, | ||
}, | ||
test_settings: { | ||
default: { | ||
launch_url: "http://localhost:3200", | ||
launch_url: 'http://localhost:3200', | ||
selenium_port: 4444, | ||
selenium_host: "127.0.0.1", | ||
selenium_host: '127.0.0.1', | ||
silent: true, | ||
detailed_output: true, | ||
screenshots: { | ||
enabled: true, | ||
path: path.join(__dirname, "reports/screenshots"), | ||
path: path.join(__dirname, 'reports/screenshots'), | ||
on_failure: true, | ||
on_error: true | ||
on_error: true, | ||
}, | ||
desiredCapabilities: { | ||
unexpectedAlertBehaviour: "accept", | ||
browserName: "chrome", | ||
unexpectedAlertBehaviour: 'accept', | ||
browserName: 'chrome', | ||
javascriptEnabled: true, | ||
acceptSslCerts: true, | ||
chromeOptions: { | ||
args: ["headless", "verbose", "window-size=1280,1480"] | ||
} | ||
args: ['headless', 'verbose', 'window-size=1280,1480'], | ||
}, | ||
}, | ||
selenium: { | ||
cli_args: { | ||
"webdriver.chrome.driver": chromedriver.path | ||
} | ||
} | ||
} | ||
} | ||
'webdriver.chrome.driver': chromedriver.path, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { action } from "../helpers/actionCreator"; | ||
import { action } from '../helpers/actionCreator'; | ||
import * as actions from '../constants/index'; | ||
|
||
export const add = (text) => action(actions.ADD, { text }); | ||
export const add = text => action(actions.ADD, { text }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const ADD = 'ADD'; | ||
export const SAVE = 'SAVE'; | ||
export const START_APPLICATION = 'START_APPLICATION'; | ||
export const ADD_RECIPES = 'ADD_RECIPES'; | ||
export const ADD_RECIPES = 'ADD_RECIPES'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
import { bindActionCreators } from 'redux'; | ||
import { connect } from 'react-redux'; | ||
import App from '../components/App'; | ||
import { add } from '../actions' | ||
import { add } from '../actions'; | ||
|
||
const mapStateToProps = (state) => ({ | ||
const mapStateToProps = state => ({ | ||
number: state.add.number, | ||
recipes: state.recipe.recipes, | ||
}); | ||
|
||
const mapDispatchToProps = (dispatch) => bindActionCreators({ | ||
add, | ||
}, dispatch); | ||
const mapDispatchToProps = dispatch => | ||
bindActionCreators( | ||
{ | ||
add, | ||
}, | ||
dispatch | ||
); | ||
|
||
const AppContainer = connect(mapStateToProps, mapDispatchToProps)(App); | ||
const AppContainer = connect( | ||
mapStateToProps, | ||
mapDispatchToProps | ||
)(App); | ||
|
||
export default AppContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const action = (type, payload = {}) => ({ type, payload }); | ||
export const action = (type, payload = {}) => ({ type, payload }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ const add = (state = {}, action) => { | |
}); | ||
default: | ||
return state; | ||
}}; | ||
} | ||
}; | ||
|
||
export default add; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { combineReducers } from 'redux'; | ||
import add from "./add"; | ||
import add from './add'; | ||
import recipe from './recipe'; | ||
|
||
const combined = combineReducers({ | ||
add, | ||
recipe | ||
recipe, | ||
}); | ||
|
||
export default combined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ const recipe = (state = {}, action) => { | |
}); | ||
default: | ||
return state; | ||
}}; | ||
} | ||
}; | ||
|
||
export default recipe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { call, put, takeEvery, takeLatest } from 'redux-saga/effects' | ||
import * as actions from "../constants" | ||
import { call, put, takeEvery, takeLatest } from 'redux-saga/effects'; | ||
import * as actions from '../constants'; | ||
import { action } from '../helpers/actionCreator'; | ||
|
||
function* addnumber(action) { | ||
try { | ||
yield put({type: actions.SAVE, number: "1"}); | ||
} catch (e) { | ||
yield put({type: "ADD_FAILED", message: e.message}); | ||
} | ||
try { | ||
yield put({ type: actions.SAVE, number: '1' }); | ||
} catch (e) { | ||
yield put({ type: 'ADD_FAILED', message: e.message }); | ||
} | ||
} | ||
|
||
function* addWatcher() { | ||
yield takeEvery(actions.ADD, addnumber); | ||
} | ||
export default addWatcher; | ||
export default addWatcher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { all } from 'redux-saga/effects'; | ||
import addWatcher from './add'; | ||
import startWatcher from './start' | ||
import startWatcher from './start'; | ||
export default function* rootSaga() { | ||
yield all([ | ||
addWatcher(), | ||
startWatcher() | ||
]); | ||
yield all([addWatcher(), startWatcher()]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import { call, put, takeEvery, takeLatest } from 'redux-saga/effects' | ||
import * as actions from "../constants" | ||
import { action } from '../helpers/actionCreator'; | ||
import { callFetch } from '../services/api' | ||
function* initalize(action) { | ||
try { | ||
const recipes = yield call(callFetch, "/recipes") | ||
yield put({type: actions.ADD_RECIPES, recipes: JSON.parse(recipes.response)}); | ||
} catch (e) { | ||
yield put({type: "START_APPLICATION_FAILED", recipes: []}); | ||
} | ||
import { call, put, takeEvery, takeLatest } from 'redux-saga/effects'; | ||
import * as actions from '../constants'; | ||
import { callFetch } from '../services/api'; | ||
function* initalize() { | ||
try { | ||
const recipes = yield call(callFetch, '/recipes'); | ||
yield put({ | ||
type: actions.ADD_RECIPES, | ||
recipes: JSON.parse(recipes.response), | ||
}); | ||
} catch (e) { | ||
yield put({ type: 'START_APPLICATION_FAILED', recipes: [] }); | ||
} | ||
} | ||
|
||
function* startWatcher() { | ||
yield takeEvery(actions.START_APPLICATION, initalize); | ||
} | ||
export default startWatcher; | ||
export default startWatcher; |
Oops, something went wrong.