Skip to content

Commit

Permalink
chore: update d2-style, use debug for logging (#35)
Browse files Browse the repository at this point in the history
* chore: update d2-style to 4.1.0

* chore: update d2-style and reformat

* chore: convert to debug for logging
  • Loading branch information
varl authored Jul 17, 2019
1 parent 2491ccc commit 382a5d5
Show file tree
Hide file tree
Showing 45 changed files with 1,371 additions and 309 deletions.
16 changes: 16 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 1

update_configs:
- package_manager: "javascript"
directory: "/"
update_schedule: "live"
version_requirement_updates: "increase_versions"
- package_manager: "java:maven"
directory: "/"
update_schedule: "monthly"
- package_manager: "docker"
directory: "/"
update_schedule: "weekly"
- package_manager: "submodules"
directory: "/"
update_schedule: "weekly"
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# https://editorconfig.org/

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
static/*
seeds/*
39 changes: 39 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const { config } = require('@dhis2/cli-style')

module.exports = {
extends: [config.eslint],

//parser: 'esprima',

parserOptions: {
ecmaFeatures: {
globalReturn: true,
experimentalObjectRestSpread: true,
},
},

env: {
node: true,
commonjs: true,
es6: true,
},

rules: {
semi: 0,
'brace-style': [2, '1tbs'],
'comma-dangle': [
'error',
{
arrays: 'only-multiline',
objects: 'only-multiline',
imports: 'never',
exports: 'always',
functions: 'ignore',
},
],
'no-console': 0,
'hapi/hapi-capitalize-modules': 0,
'hapi/hapi-for-you': 0,
'hapi/hapi-scope-start': 0,
},
}
33 changes: 0 additions & 33 deletions .eslintrc.json

This file was deleted.

4 changes: 4 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
titleOnly: true
commitsOnly: false
titleAndCommits: false
allowMergeCommits: false
1 change: 1 addition & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_extends: .github
6 changes: 6 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
hooks: {
'commit-msg': 'd2-style commit check',
'pre-commit': 'd2-style validate',
},
}
19 changes: 3 additions & 16 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
const { config } = require('@dhis2/cli-style')

module.exports = {
printWidth: 80,
tabWidth: 4,
useTabs: false,
semi: false,
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: true,
jsxBracketSameLine: false,
jsxSingleQuote: false,
arrowParens: 'avoid',
rangeStart: 0,
rangeEnd: Infinity,
proseWrap: 'preserve',
requirePragma: false,
insertPragma: false,
endOfLine: 'lf',
...require(config.prettier),
}
30 changes: 18 additions & 12 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
module.exports = function (api) {
module.exports = function(api) {
api.cache(true)

return {
presets: [
['@babel/preset-env', {
useBuiltIns: 'entry',
corejs: '3',
}],
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
corejs: '3',
},
],
'@babel/preset-react',
],
plugins: [
['transform-imports', {
lodash: {
transform: 'lodash/${member}',
preventFullImport: true
}
}]
]
[
'transform-imports',
{
lodash: {
transform: 'lodash/${member}',
preventFullImport: true,
},
},
],
],
}
}
2 changes: 1 addition & 1 deletion client/src/components/appVersion/VersionListEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class VersionListEdit extends Component {
* @param e event fired from TextField
* @param newValue from TextField
*/
//eslint-disable-next-line max-params
handleValueChange(versionId, fieldName, e, newValue) {
//eslint-disable-line max-params
const editedValues = this.state.editedValues
this.setState({
...this.state,
Expand Down
10 changes: 4 additions & 6 deletions client/src/components/form/FormStepper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ class FormStepper extends Component {
goToStep(index) {
if (index > this.state.lastStep && index > -1) {
throw new Error(
`Index must be between 0 and ${
this.state.lastStep
} (including).`
`Index must be between 0 and ${this.state.lastStep} (including).`
)
}

Expand Down Expand Up @@ -159,10 +157,10 @@ class FormStepper extends Component {
>
<StepButton
onClick={() => this.goToStep(i)}
{...section.props.icon && {
{...(section.props.icon && {
icon: sections.props.icon,
}}
{...showError && { icon: sectionErrorIcon }}
})}
{...(showError && { icon: sectionErrorIcon })}
>
{sectionDisplayName}
</StepButton>
Expand Down
4 changes: 1 addition & 3 deletions client/src/reducers/snackbarReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ const snackbarReducer = (state = initialState, action) => {
case actionTypes.APP_VERSION_DELETE_SUCCESS: {
return {
...state,
message: `Version ${
action.payload.version.version
} has been deleted`,
message: `Version ${action.payload.version.version} has been deleted`,
}
}

Expand Down
4 changes: 1 addition & 3 deletions client/src/utils/AuthService.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ export default class AuthService {
// Configure Auth0
this.lock = new Auth0Lock(clientId, domain, {
auth: {
redirectUrl: `${window.location.protocol}//${
window.location.host
}/user`,
redirectUrl: `${window.location.protocol}//${window.location.host}/user`,
responseType: 'token',
params: {
scope: 'openid roles user_id email profile',
Expand Down
Loading

0 comments on commit 382a5d5

Please sign in to comment.