Skip to content

Commit 13edb7a

Browse files
authored
fix lint (#4231)
1 parent ed89aa4 commit 13edb7a

File tree

21 files changed

+27
-34
lines changed

21 files changed

+27
-34
lines changed

.eslintrc.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ module.exports = {
1414
__DEV__: true,
1515
},
1616
rules: {
17-
'no-undef': 2,
18-
'no-unreachable': 2,
19-
'no-unused-vars': 0,
20-
'no-console': 0,
17+
'no-console': 'off',
2118
semi: ['error', 'always'],
2219
quotes: ['error', 'single'],
2320
'react/jsx-uses-react': 'off', // no longer needed with new jsx transform
@@ -39,10 +36,11 @@ module.exports = {
3936
rules: {
4037
indent: ['error', 2],
4138
quotes: ['error', 'single'],
42-
'no-undef': 0,
43-
'no-constant-condition': 0,
44-
'no-useless-escape': 0,
45-
'no-dupe-keys': 0,
39+
'no-undef': 'off',
40+
'no-unused-vars': 'off',
41+
'no-constant-condition': 'off',
42+
'no-useless-escape': 'off',
43+
'no-dupe-keys': 'off',
4644
},
4745
},
4846
],

cypress/plugins/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* @type {Cypress.PluginConfig}
1717
*/
18-
module.exports = (on, config) => {
18+
module.exports = () => {
1919
// `on` is used to hook into various events Cypress emits
2020
// `config` is the resolved Cypress config
2121
};

cypress/support/commands.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const windowInnerWidth = Cypress.config('viewportWidth');
2-
const windowInnerHeight = Cypress.config('viewportHeight');
31
Cypress.Commands.add('isNotInViewport', element => {
42
cy.get(element).then($el => {
53
// we won't have horizontal scollbar

src/components/Configuration/Configuration.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Children, isValidElement } from 'react';
22
import { Details } from './components';
3-
import PropTypes from 'prop-types';
43

54
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'];
65
export const Pre = props => {

src/components/Configuration/components.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { isValidElement, Component } from 'react';
22
import Popover from 'react-tiny-popover';
33
import './Configuration.scss';
4-
import { timeout } from 'q';
54
import PropTypes from 'prop-types';
65

76
const DEFAULT_CHILDREN_SIZE = 4;

src/components/Cube/Cube.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export default class Cube extends Component {
208208
*
209209
* @param {object} e - Native event
210210
*/
211-
_spin = e => {
211+
_spin = () => {
212212
let obj = {};
213213
let axis = this._getRandomAxis();
214214
let sign = Math.random() < 0.5 ? -1 : 1;
@@ -223,7 +223,7 @@ export default class Cube extends Component {
223223
*
224224
* @param {object} e - Native event
225225
*/
226-
_reset = e => {
226+
_reset = () => {
227227
this.setState({
228228
x: 0,
229229
y: 0,

src/components/Dropdown/Dropdown.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default class Dropdown extends Component {
103103
this.links[newIndex].focus();
104104
}
105105

106-
_handleClick(e) {
106+
_handleClick() {
107107
this.setState({active: !this.state.active}, () => {
108108
if (this.state.active) {
109109
this.links[0].focus();

src/components/Link/Link.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default ({
99
// mimick the `NavLink` API
1010
if ( url ) to = url;
1111

12+
// eslint-disable-next-line
1213
const {isActive, ...others} = props;
1314
if ( to.startsWith('http') || to.startsWith('//') )
1415
{

src/components/NotificationBar/NotificationBar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class MessageBar extends Component {
4646
*
4747
* @param {object} e - Click event
4848
*/
49-
close(e) {
49+
close() {
5050
localStorage.setItem('notification-dismissed', version);
5151
this.props.onClose();
5252
}

src/components/Organization/Organization.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Shield from '../Shield/Shield';
55
import Items from './projects.json';
66
import './Organization.scss';
77

8-
const Organization = props => {
8+
const Organization = () => {
99
return (
1010
<Container className='organization page__content markdown'>
1111
<h1>The Organization</h1>

src/components/Page/Page.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Page extends Component {
6161

6262
})
6363
)
64-
.catch(error =>
64+
.catch(() =>
6565
this.setState({
6666
content: 'Error loading content.'
6767
})

src/components/PageLinks/PageLinks.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const baseURL = 'https://github.com/webpack/webpack.js.org/edit/master/';
77

88
export default function PageLinks({
99
page = {},
10-
...props
1110
}) {
1211
const editLink = page.edit || Url.resolve(baseURL, page.path);
1312

src/components/SidebarItem/SidebarItem.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class SidebarItem extends Component {
2222
renderAnchors(anchors) {
2323
return (
2424
<ul className={`${block}__anchors`}>
25-
{anchors.map((anchor, i) => (
25+
{anchors.map((anchor) => (
2626
<li
2727
key={this._generateAnchorURL(anchor)}
2828
className={`${block}__anchor`}
@@ -95,7 +95,7 @@ export default class SidebarItem extends Component {
9595
*
9696
* @param {object} e - Click event
9797
*/
98-
_toggle(e) {
98+
_toggle() {
9999
this.setState({
100100
open: !this.state.open
101101
});

src/components/Site/Site.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class Site extends Component {
104104
<Route exact strict path="/:url*" render={props => <Redirect to={`${props.location.pathname}/`}/>} />
105105
<Route path="/" exact component={Splash} />
106106
<Route
107-
render={props => (
107+
render={() => (
108108
<Container className="site__content">
109109
<Switch>
110110
<Route path="/vote" component={Vote} />
@@ -116,7 +116,7 @@ class Site extends Component {
116116
key={page.url}
117117
exact={true}
118118
path={page.url}
119-
render={props => {
119+
render={() => {
120120
let path = page.path.replace('src/content/', '');
121121
let content = this.props.import(path);
122122
const { previous, next } = getAdjacentPages(
@@ -144,7 +144,7 @@ class Site extends Component {
144144
}}
145145
/>
146146
))}
147-
<Route render={props => <PageNotFound />} />
147+
<Route render={() => <PageNotFound />} />
148148
</Switch>
149149
</Container>
150150
)}

src/components/Sponsors/Sponsors.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import PropTypes from 'prop-types';
21
// Import External Dependencies
32
import Link from '../Link/Link';
43

@@ -10,7 +9,7 @@ import WebpackIcon from '../../assets/icon-square-small.svg';
109
import '../Sponsors/Sponsors.scss';
1110

1211
// Create and export the component
13-
const Sponsors = (props) => {
12+
const Sponsors = () => {
1413
return (
1514
<div className="sponsors">
1615
<Link

src/components/StarterKits/StarterKits.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import isClient from '../../utilities/is-client';
1313

1414
const StarterKitsTable = lazy(() => import('./StarterKitsTable'));
1515

16-
const StarterKits = props => (
16+
const StarterKits = () => (
1717
<Container className="starter-kits page__content markdown">
1818
<h1>Starter Kits</h1>
1919

src/components/StarterKits/StarterKitsTable.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Kits from './_starter-kits.json';
22
import Link from '../Link/Link';
33

4-
const StarterKitsTable = props => (
4+
const StarterKitsTable = () => (
55
<tbody className="table-body">
66
{Kits.map((kit, i) => (
77
<tr className="table-tr" key={i}>

src/scripts/concatenate-docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function getDirectoryRecursive(basePath) {
3333
if (fs.statSync(fullPath).isDirectory()) {
3434
getDirectoryRecursive(fullPath);
3535
} else if (fullPath.endsWith('.md') || fullPath.endsWith('.mdx')) {
36-
let fc = fileContents[fileContents.length] = front(fs.readFileSync(fullPath).toString());
36+
fileContents[fileContents.length] = front(fs.readFileSync(fullPath).toString());
3737
}
3838
}
3939

src/utilities/content-tree-enhancers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const enhance = (tree, options) => {
6262
}
6363
};
6464

65-
const filter = item => true;
65+
const filter = () => true;
6666

6767
const sort = (a, b) => {
6868
let group1 = (a.group || '').toLowerCase();

src/utilities/fetch-package-readmes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async function main() {
2828
const repos = JSON.parse(await readFile(path.resolve(__dirname, `../../repositories/${type}.json`)));
2929

3030
for (const repo of repos) {
31-
const [org, packageName] = repo.split('/');
31+
const [, packageName] = repo.split('/');
3232
const url = `https://raw.githubusercontent.com/${repo}/master/README.md`;
3333
const htmlUrl = `https://github.com/${repo}`;
3434
const editUrl = `${htmlUrl}/edit/master/README.md`;

webpack.common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const mdPlugins = [
1919
require('remark-autolink-headings'),
2020
{
2121
behavior: 'append',
22-
content(node) {
22+
content() {
2323
return [
2424
h('span.header-link')
2525
];
@@ -41,7 +41,7 @@ const mdPlugins = [
4141
require('remark-refractor')
4242
];
4343

44-
module.exports = (env = {}) => ({
44+
module.exports = () => ({
4545
context: path.resolve(__dirname, './src'),
4646
cache: {
4747
type: 'filesystem',

0 commit comments

Comments
 (0)