Skip to content

Commit

Permalink
Comply with linter updates and deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
ovidiuch committed Mar 20, 2017
1 parent 67b9cf9 commit 0973791
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/local-state/components/Counter/Counter.jsx
Expand Up @@ -23,7 +23,7 @@ export default class Counter extends React.Component {
className="CounterButton"
onClick={this.onButtonClick}
>
{this.state.value} times
{`${this.state.value} times`}
</button>
);
}
Expand Down
1 change: 1 addition & 0 deletions packages/react-component-tree/src/load-child-mixin.js
@@ -1,6 +1,7 @@
import { loadChild } from './load-child';

module.exports = {
// eslint-disable-next-line func-name-matching
loadChild: function loadComponentChild(childName, a, b, c, d, e, f) {
return loadChild(this, childName, a, b, c, d, e, f);
},
Expand Down
Expand Up @@ -11,7 +11,7 @@ describe('UNIT Load missing child', () => {
},
};

sinon.stub(React, 'createElement', () => {
sinon.stub(React, 'createElement').callsFake(() => {
throw new Error('Invalid component');
});

Expand Down
2 changes: 1 addition & 1 deletion packages/react-cosmos-config/src/__tests__/index.js
Expand Up @@ -41,7 +41,7 @@ describe('resolves module paths', () => {

beforeEach(() => {
mockUserConfig('./mock-cwd/cosmos.config', {
// react-cosmos-utils chosen arbitrarily from project's deps
// \react-cosmos-utils chosen arbitrarily from project's deps
globalImports: ['react-cosmos-utils/src/import-module'],
proxies: ['react-cosmos-utils/src/linked-list']
});
Expand Down
2 changes: 1 addition & 1 deletion packages/react-cosmos-voyager/src/index.js
Expand Up @@ -53,7 +53,7 @@ const getFilePaths = ({
componentPaths.forEach(componentPath => {
if (fs.lstatSync(componentPath).isFile()) {
if (typeof getComponentName !== 'function') {
throw new Error('Must implement getComponentName when using exact file paths in componentPaths');
throw new TypeError('Must implement getComponentName when using exact file paths in componentPaths');
}

const componentDir = path.dirname(componentPath);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-cosmos-webpack/src/__tests__/server.js
Expand Up @@ -37,7 +37,7 @@ const startServer = (argv, config) => {
mockGetCosmosConfig = jest.fn(() => mockConfig);
jest.mock('react-cosmos-config', () => mockGetCosmosConfig);

// yargs.argv gets destructured as soon as the ./server module is required,
// \yargs.argv gets destructured as soon as the ./server module is required,
// so we need to mock yargs first
require('../server')();
};
Expand Down
Expand Up @@ -28,7 +28,7 @@ const userWebpack2Config = {
rules: [userRule],
},
plugins: [
// fake plugins, something to compare identity with
// Fake plugins, something to compare identity with
{}, {},
],
};
Expand Down
2 changes: 1 addition & 1 deletion packages/react-querystring-router/src/__tests__/router.js
Expand Up @@ -7,7 +7,7 @@ let getComponentClass;
let getComponentProps;

const onChange = jest.fn();
// window.location is mocked inside jest.config.json
// \window.location is mocked inside jest.config.json
const mockUriLocationInitial = 'http://foo.bar/';
const mockUriLocation = `${mockUriLocationInitial}?component=List&dataUrl=users.json`;
const mockUriParams = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/prune-react-copies.js
Expand Up @@ -7,7 +7,7 @@ const glob = require('glob');
const rimraf = require('rimraf');

glob.sync('./packages/*/node_modules/react{,-dom}').forEach(
function removeUnwantedReactCopies(reactCopyPath) {
reactCopyPath => {
rimraf.sync(reactCopyPath);
console.log('WARNING: Removed unwanted React copy', reactCopyPath);
});

0 comments on commit 0973791

Please sign in to comment.