Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop warning #1455

Merged
merged 1 commit into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ env:
es6: true
rules:
global-require: off
no-unused-vars: [2, {
no-console: ['error', {
allow: ['warn', 'error', 'info']
}]
no-unused-vars: ['error', {
vars: all,
args: after-used,
varsIgnorePattern: ^_,
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@
"memoize-one": "^4.0.3",
"prop-types": "^15.6.2",
"react-overlays": "^2.0.0-0",
"uncontrollable": "^7.0.0",
"warning": "^4.0.2"
"uncontrollable": "^7.0.0"
},
"resolutions": {
"babel-core": "7.0.0-bridge.0"
Expand Down
5 changes: 3 additions & 2 deletions src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
dateRangeFormat,
views as componentViews,
} from './utils/propTypes'
import warning from 'warning'

import { notify } from './utils/helpers'
import { navigate, views } from './utils/constants'
Expand Down Expand Up @@ -931,7 +930,9 @@ class Calendar extends React.Component {
if (viewComponent.range) {
onRangeChange(viewComponent.range(date, { localizer }), view)
} else {
warning(true, 'onRangeChange prop not supported for this view')
if (process.env.NODE_ENV !== 'production') {
console.error('onRangeChange prop not supported for this view')
}
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/localizers/globalize.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as dates from '../utils/dates'
import oldGlobalize from './oldGlobalize'
import { DateLocalizer } from '../localizer'
import warning from 'warning'

let dateRangeFormat = ({ start, end }, culture, local) =>
local.format(start, { date: 'short' }, culture) +
Expand Down Expand Up @@ -62,11 +61,12 @@ export default function(globalize) {
const firstDay = weekData.firstDay[territory || '001']
return days.indexOf(firstDay)
} catch (e) {
warning(
true,
`Failed to accurately determine first day of the week.
Is supplemental data loaded into CLDR?`
)
if (process.env.NODE_ENV !== 'production') {
console.error(
'Failed to accurately determine first day of the week.' +
' Is supplemental data loaded into CLDR?'
)
}
// maybe cldr supplemental is not loaded? revert to original method
const date = new Date()
//cldr-data doesn't seem to be zero based
Expand Down