Upgrade ESLint and fix broken rules #41
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed on our builds of
thefrontside/ui-eholdings
that we were still gettingWARN: 'Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs'
, even though I thought it had been resolved with folio-org/stripes-components#45.It turns out I missed one - in searching for
React.PropTypes
, I didn't notice an instance ofimport React, { PropTypes } from 'react';
.That would've been caught by the ESLint
react/no-deprecated
rule provided as part ofeslint-config-airbnb
, but the error was not being thrown. I upgraded all theeslint
-related packages, and then there were errors in my editor and when runningyarn lint
(react-no-deprecated
also needed to know the targetreact
version to pop up).I fixed all the linting errors, with only a few uses of
eslint-disable-line
.Next Steps
It would be awesome if we ran the linter as part of a continuous integration environment, so future pull requests to
stripes-core
with ESLint errors could not be merged.