Skip to content

fix lint #4231

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

Merged
merged 1 commit into from
Dec 3, 2020
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
14 changes: 6 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

number is not intuitive.

'no-unused-vars': 'off',
'no-constant-condition': 'off',
'no-useless-escape': 'off',
'no-dupe-keys': 'off',
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are unused variables.

module.exports = () => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};
2 changes: 0 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion src/components/Configuration/Configuration.jsx
Original file line number Diff line number Diff line change
@@ -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 => {
Expand Down
1 change: 0 additions & 1 deletion src/components/Configuration/components.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Cube/Cube.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -223,7 +223,7 @@ export default class Cube extends Component {
*
* @param {object} e - Native event
*/
_reset = e => {
_reset = () => {
this.setState({
x: 0,
y: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dropdown/Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/components/Link/Link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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('//') )
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/NotificationBar/NotificationBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MessageBar extends Component {
*
* @param {object} e - Click event
*/
close(e) {
close() {
localStorage.setItem('notification-dismissed', version);
this.props.onClose();
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Organization/Organization.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Shield from '../Shield/Shield';
import Items from './projects.json';
import './Organization.scss';

const Organization = props => {
const Organization = () => {
return (
<Container className='organization page__content markdown'>
<h1>The Organization</h1>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Page/Page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Page extends Component {

})
)
.catch(error =>
.catch(() =>
this.setState({
content: 'Error loading content.'
})
Expand Down
1 change: 0 additions & 1 deletion src/components/PageLinks/PageLinks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/components/SidebarItem/SidebarItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class SidebarItem extends Component {
renderAnchors(anchors) {
return (
<ul className={`${block}__anchors`}>
{anchors.map((anchor, i) => (
{anchors.map((anchor) => (
<li
key={this._generateAnchorURL(anchor)}
className={`${block}__anchor`}
Expand Down Expand Up @@ -95,7 +95,7 @@ export default class SidebarItem extends Component {
*
* @param {object} e - Click event
*/
_toggle(e) {
_toggle() {
this.setState({
open: !this.state.open
});
Expand Down
6 changes: 3 additions & 3 deletions src/components/Site/Site.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Site extends Component {
<Route exact strict path="/:url*" render={props => <Redirect to={`${props.location.pathname}/`}/>} />
<Route path="/" exact component={Splash} />
<Route
render={props => (
render={() => (
<Container className="site__content">
<Switch>
<Route path="/vote" component={Vote} />
Expand All @@ -116,7 +116,7 @@ class Site extends Component {
key={page.url}
exact={true}
path={page.url}
render={props => {
render={() => {
let path = page.path.replace('src/content/', '');
let content = this.props.import(path);
const { previous, next } = getAdjacentPages(
Expand Down Expand Up @@ -144,7 +144,7 @@ class Site extends Component {
}}
/>
))}
<Route render={props => <PageNotFound />} />
<Route render={() => <PageNotFound />} />
</Switch>
</Container>
)}
Expand Down
3 changes: 1 addition & 2 deletions src/components/Sponsors/Sponsors.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import PropTypes from 'prop-types';
// Import External Dependencies
import Link from '../Link/Link';

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

// Create and export the component
const Sponsors = (props) => {
const Sponsors = () => {
return (
<div className="sponsors">
<Link
Expand Down
2 changes: 1 addition & 1 deletion src/components/StarterKits/StarterKits.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import isClient from '../../utilities/is-client';

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/components/StarterKits/StarterKitsTable.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Kits from './_starter-kits.json';
import Link from '../Link/Link';

const StarterKitsTable = props => (
const StarterKitsTable = () => (
<tbody className="table-body">
{Kits.map((kit, i) => (
<tr className="table-tr" key={i}>
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/concatenate-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getDirectoryRecursive(basePath) {
if (fs.statSync(fullPath).isDirectory()) {
getDirectoryRecursive(fullPath);
} else if (fullPath.endsWith('.md') || fullPath.endsWith('.mdx')) {
let fc = fileContents[fileContents.length] = front(fs.readFileSync(fullPath).toString());
fileContents[fileContents.length] = front(fs.readFileSync(fullPath).toString());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utilities/content-tree-enhancers.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const enhance = (tree, options) => {
}
};

const filter = item => true;
const filter = () => true;

const sort = (a, b) => {
let group1 = (a.group || '').toLowerCase();
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/fetch-package-readmes.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function main() {
const repos = JSON.parse(await readFile(path.resolve(__dirname, `../../repositories/${type}.json`)));

for (const repo of repos) {
const [org, packageName] = repo.split('/');
const [, packageName] = repo.split('/');
const url = `https://raw.githubusercontent.com/${repo}/master/README.md`;
const htmlUrl = `https://github.com/${repo}`;
const editUrl = `${htmlUrl}/edit/master/README.md`;
Expand Down
4 changes: 2 additions & 2 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const mdPlugins = [
require('remark-autolink-headings'),
{
behavior: 'append',
content(node) {
content() {
return [
h('span.header-link')
];
Expand All @@ -41,7 +41,7 @@ const mdPlugins = [
require('remark-refractor')
];

module.exports = (env = {}) => ({
module.exports = () => ({
context: path.resolve(__dirname, './src'),
cache: {
type: 'filesystem',
Expand Down