diff --git a/.eslintrc.js b/.eslintrc.js index 44d76f6f4876..74ab3e78b0c1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,10 +14,7 @@ module.exports = { __DEV__: true, }, rules: { - 'no-undef': 2, - 'no-unreachable': 2, - 'no-unused-vars': 0, - 'no-console': 0, + 'no-console': 'off', semi: ['error', 'always'], quotes: ['error', 'single'], 'react/jsx-uses-react': 'off', // no longer needed with new jsx transform @@ -39,10 +36,11 @@ module.exports = { rules: { indent: ['error', 2], quotes: ['error', 'single'], - 'no-undef': 0, - 'no-constant-condition': 0, - 'no-useless-escape': 0, - 'no-dupe-keys': 0, + 'no-undef': 'off', + 'no-unused-vars': 'off', + 'no-constant-condition': 'off', + 'no-useless-escape': 'off', + 'no-dupe-keys': 'off', }, }, ], diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index 8dd144a6c1a9..8affdd414704 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -15,7 +15,7 @@ /** * @type {Cypress.PluginConfig} */ -module.exports = (on, config) => { +module.exports = () => { // `on` is used to hook into various events Cypress emits // `config` is the resolved Cypress config }; diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 9fa5d914c639..8c9c82e98a83 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -1,5 +1,3 @@ -const windowInnerWidth = Cypress.config('viewportWidth'); -const windowInnerHeight = Cypress.config('viewportHeight'); Cypress.Commands.add('isNotInViewport', element => { cy.get(element).then($el => { // we won't have horizontal scollbar diff --git a/src/components/Configuration/Configuration.jsx b/src/components/Configuration/Configuration.jsx index 10a57881c47a..56391a3828d4 100644 --- a/src/components/Configuration/Configuration.jsx +++ b/src/components/Configuration/Configuration.jsx @@ -1,6 +1,5 @@ import { Children, isValidElement } from 'react'; import { Details } from './components'; -import PropTypes from 'prop-types'; const detailComponentsList = ['link', 'mode', 'entry', 'path', 'filename', 'publicPath', 'library', 'libraryType', 'libraryName', 'advancedLibrary', 'advancedOutput', 'expertOutput', 'expertOutputB', 'expert', 'advancedConditions', 'moduleType', 'advancedActions', 'advancedModule', 'modules', 'alias', 'advancedResolve', 'expertResolve', 'hints', 'devtool', 'target', 'externals', 'externalsType', 'externalsPresets', 'ignoreWarnings', 'stats', 'preset', 'advancedGlobal', 'advancedAssets', 'advancedChunkGroups', 'advancedChunks', 'advancedModules', 'expertModules', 'advancedStatsOptimization', 'advancedOptimization', 'cacheGroupAdvancedSelectors', 'cacheGroupAdvancedEffects', 'advancedSelectors', 'advancedEffects', 'fallbackCacheGroup', 'advanced', 'advancedCaching', 'advancedBuild']; export const Pre = props => { diff --git a/src/components/Configuration/components.js b/src/components/Configuration/components.js index 473aad4a7e33..2924b4a9348e 100644 --- a/src/components/Configuration/components.js +++ b/src/components/Configuration/components.js @@ -1,7 +1,6 @@ import { isValidElement, Component } from 'react'; import Popover from 'react-tiny-popover'; import './Configuration.scss'; -import { timeout } from 'q'; import PropTypes from 'prop-types'; const DEFAULT_CHILDREN_SIZE = 4; diff --git a/src/components/Cube/Cube.jsx b/src/components/Cube/Cube.jsx index f4135868362e..9f4177ab9813 100644 --- a/src/components/Cube/Cube.jsx +++ b/src/components/Cube/Cube.jsx @@ -208,7 +208,7 @@ export default class Cube extends Component { * * @param {object} e - Native event */ - _spin = e => { + _spin = () => { let obj = {}; let axis = this._getRandomAxis(); let sign = Math.random() < 0.5 ? -1 : 1; @@ -223,7 +223,7 @@ export default class Cube extends Component { * * @param {object} e - Native event */ - _reset = e => { + _reset = () => { this.setState({ x: 0, y: 0, diff --git a/src/components/Dropdown/Dropdown.jsx b/src/components/Dropdown/Dropdown.jsx index 8f584147b6d8..b842572a4500 100644 --- a/src/components/Dropdown/Dropdown.jsx +++ b/src/components/Dropdown/Dropdown.jsx @@ -103,7 +103,7 @@ export default class Dropdown extends Component { this.links[newIndex].focus(); } - _handleClick(e) { + _handleClick() { this.setState({active: !this.state.active}, () => { if (this.state.active) { this.links[0].focus(); diff --git a/src/components/Link/Link.jsx b/src/components/Link/Link.jsx index e1f82645c9ab..600ba564bbe1 100644 --- a/src/components/Link/Link.jsx +++ b/src/components/Link/Link.jsx @@ -9,6 +9,7 @@ export default ({ // mimick the `NavLink` API if ( url ) to = url; + // eslint-disable-next-line const {isActive, ...others} = props; if ( to.startsWith('http') || to.startsWith('//') ) { diff --git a/src/components/NotificationBar/NotificationBar.jsx b/src/components/NotificationBar/NotificationBar.jsx index b802945ae94e..9ece8574621c 100644 --- a/src/components/NotificationBar/NotificationBar.jsx +++ b/src/components/NotificationBar/NotificationBar.jsx @@ -46,7 +46,7 @@ class MessageBar extends Component { * * @param {object} e - Click event */ - close(e) { + close() { localStorage.setItem('notification-dismissed', version); this.props.onClose(); } diff --git a/src/components/Organization/Organization.jsx b/src/components/Organization/Organization.jsx index 8db7218d5500..526d613219bf 100644 --- a/src/components/Organization/Organization.jsx +++ b/src/components/Organization/Organization.jsx @@ -5,7 +5,7 @@ import Shield from '../Shield/Shield'; import Items from './projects.json'; import './Organization.scss'; -const Organization = props => { +const Organization = () => { return (

The Organization

diff --git a/src/components/Page/Page.jsx b/src/components/Page/Page.jsx index 91f44dd351a3..bf3971ac3a84 100644 --- a/src/components/Page/Page.jsx +++ b/src/components/Page/Page.jsx @@ -61,7 +61,7 @@ class Page extends Component { }) ) - .catch(error => + .catch(() => this.setState({ content: 'Error loading content.' }) diff --git a/src/components/PageLinks/PageLinks.jsx b/src/components/PageLinks/PageLinks.jsx index ef8f0315569d..8108d9e9ff94 100644 --- a/src/components/PageLinks/PageLinks.jsx +++ b/src/components/PageLinks/PageLinks.jsx @@ -7,7 +7,6 @@ const baseURL = 'https://github.com/webpack/webpack.js.org/edit/master/'; export default function PageLinks({ page = {}, - ...props }) { const editLink = page.edit || Url.resolve(baseURL, page.path); diff --git a/src/components/SidebarItem/SidebarItem.jsx b/src/components/SidebarItem/SidebarItem.jsx index 82f521591363..58281a03dcd3 100644 --- a/src/components/SidebarItem/SidebarItem.jsx +++ b/src/components/SidebarItem/SidebarItem.jsx @@ -22,7 +22,7 @@ export default class SidebarItem extends Component { renderAnchors(anchors) { return (