Skip to content

Commit

Permalink
upgrade eslint and related dependencies
Browse files Browse the repository at this point in the history
I updated our shared eslint config, which unblocks upgrading eslint and
related packages over here.

I had to temporarily disable the `no-unused-vars` rule because of this
issue: eslint/eslint#12117

we should be able to remove the rule once this PR merges:
babel/babel-eslint#792. I'm watching that PR so
I'll get notified and open a small PR here when it merges.

pr #2168
  • Loading branch information
alicewriteswrongs committed Aug 21, 2019
1 parent 1a46a10 commit f0fbb11
Show file tree
Hide file tree
Showing 13 changed files with 630 additions and 521 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"version": "16.4.0",
"flowVersion": "0.75.0" // Flow version
},
},
rules: {
"no-unused-vars": 0
}
}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@mitodl/mdl-react-components": "^0.0.3",
"@trust/webcrypto": "^0.9.2",
"autoprefixer": "^9.4.6",
"babel-eslint": "^10.0.1",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.0",
"babel-plugin-istanbul": "^4.1.6",
"blueimp-canvas-to-blob": "^3.14.0",
Expand All @@ -48,14 +48,14 @@
"detect-browser": "^2.5.1",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.11.2",
"eslint": "^5.9.0",
"eslint-config-google": "^0.9.1",
"eslint-config-mitodl": "^0.0.5",
"eslint-plugin-babel": "^5.2.1",
"eslint": "^6.2.1",
"eslint-config-google": "^0.13.0",
"eslint-config-mitodl": "^0.0.7",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-flow-vars": "^0.5.0",
"eslint-plugin-flowtype": "^3.2.0",
"eslint-plugin-mocha": "^5.2.0",
"eslint-plugin-react": "^7.10.0",
"eslint-plugin-flowtype": "^4.2.0",
"eslint-plugin-mocha": "^6.0.0",
"eslint-plugin-react": "^7.14.3",
"express": "^4.16.3",
"fetch-mock": "^6.4.4",
"flow-bin": "^0.94.0",
Expand All @@ -78,7 +78,7 @@
"object.entries": "^1.0.4",
"places.js": "^1.14.0",
"postcss-loader": "^2.1.5",
"prettier-eslint-cli": "^4.7.1",
"prettier-eslint-cli": "^5.0.0",
"prop-types": "^15.6.2",
"prosemirror-commands": "^1.0.7",
"prosemirror-example-setup": "^1.0.1",
Expand Down
3 changes: 2 additions & 1 deletion static/js/containers/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ class ProfilePage extends React.Component<Props> {
renderUserWebsiteLinks() {
const { profile } = this.props

if (!profile.user_websites || profile.user_websites.length === 0)
if (!profile.user_websites || profile.user_websites.length === 0) {
return null
}

// $FlowFixMe: profile.user_websites cannot be undefined here
const socialSites = profile.user_websites
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ describe("EditChannelAppearancePage", () => {
sinon.assert.calledOnce(helper.updateChannelStub)
const channelUpdateArg = helper.updateChannelStub.firstCall.args[0]
assert.equal(
channelUpdateArg.hasOwnProperty("title"),
channelUpdateArg.hasOwnProperty("title"), // eslint-disable-line no-prototype-builtins
expectIncludeTitle
)
})
Expand Down
2 changes: 0 additions & 2 deletions static/js/flow/searchTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ export type PostResult = ResultCommon & {
post_cover_image: ?string
}



export type LearningResourceResult = {
id: number,
course_id?: string,
Expand Down
13 changes: 9 additions & 4 deletions static/js/hoc/withForm_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ const WrappedPage = withForm(Form)(Page)
describe("withForm", () => {
const result = { state: "success" }

let sandbox
let formData: any
let formEndEditStub, formBeginEditStub, formUpdateStub, formValidateStub
let validateFormStub, onSubmitStub, onSubmitResultStub
let sandbox,
formData: any,
formEndEditStub,
formBeginEditStub,
formUpdateStub,
formValidateStub,
validateFormStub,
onSubmitStub,
onSubmitResultStub

const renderPage = ({ ...props }) =>
mount(
Expand Down
2 changes: 1 addition & 1 deletion static/js/lib/api/api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
/* global SETTINGS:false, fetch: false */
/* global SETTINGS:false */
// For mocking purposes we need to use "fetch" defined as a global instead of importing as a local.
import { PATCH, POST, DELETE } from "redux-hammock/constants"
import { fetchJSONWithCSRF } from "redux-hammock/django_csrf_fetch"
Expand Down
2 changes: 1 addition & 1 deletion static/js/lib/api/fetch_auth.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
/* global SETTINGS:false, fetch: false */
/* global SETTINGS:false */
// For mocking purposes we need to use "fetch" defined as a global instead of importing as a local.
import "isomorphic-fetch"
import {
Expand Down
2 changes: 1 addition & 1 deletion static/js/lib/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const loadEmbedlyPlatform = () => {
window.embedly =
window.embedly ||
function() {
(window.embedly.q = window.embedly.q || []).push(arguments)
(window.embedly.q = window.embedly.q || []).push(arguments) // eslint-disable-line prefer-rest-params
}
const el = document.createElement("script")
el.id = id
Expand Down
2 changes: 1 addition & 1 deletion static/js/lib/util_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("utility functions", () => {
})

it("enumerates an iterable", () => {
const someNums = function*() {
const someNums = function* () {
yield* [6, 7, 8, 9, 10]
}

Expand Down
1 change: 0 additions & 1 deletion static/js/store/configureStore.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global require:false, module:false */
import { compose, createStore, applyMiddleware } from "redux"
import thunkMiddleware from "redux-thunk"
import { createLogger } from "redux-logger"
Expand Down
2 changes: 1 addition & 1 deletion static/js/util/integration_test_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default class IntegrationTestHelper {
// if it defines WrappedComponent, find() that so we skip over any intermediaries
if (
cls &&
cls.hasOwnProperty("WrappedComponent") &&
cls.hasOwnProperty("WrappedComponent") && // eslint-disable-line no-prototype-builtins
inner.find(cls.WrappedComponent).length
) {
inner = inner.find(cls.WrappedComponent)
Expand Down
Loading

0 comments on commit f0fbb11

Please sign in to comment.