Merge pull request #1936 from storybooks/eliminate-eslint-warnings

Fix/suppress current eslint warnings
This commit is contained in:
Filipp Riabchun 2017-10-02 02:53:09 -07:00 committed by GitHub
commit 8271ac6de6
14 changed files with 38 additions and 5 deletions

View File

@ -31,10 +31,9 @@ module.exports = {
'class-methods-use-this': ignore,
'arrow-parens': [warn, 'as-needed'],
'space-before-function-paren': ignore,
'import/no-unresolved': warn,
'import/no-unresolved': error,
'import/extensions': [
// because of highlight.js and fuse.js
warn,
error,
{
js: 'never',
json: 'always',

View File

@ -9,7 +9,7 @@ describe('preview', () => {
describe('action()', () => {
it('should use a uuid for action ids', () => {
const channel = { emit: jest.fn() };
const uuidGenerator = (function*() {
const uuidGenerator = (function* uuidGenerator() {
yield '42';
yield '24';
})();

View File

@ -0,0 +1,7 @@
const ignore = 0;
module.exports = {
rules: {
'import/no-unresolved': ignore,
},
};

View File

@ -49,4 +49,5 @@ express()
.use('/graphql', graphqlHTTP({ schema, pretty: true }))
.listen(3000);
// eslint-disable-next-line no-console
console.log('GraphQL server running on http://localhost:3000/graphql');

View File

@ -1,3 +1,4 @@
/* eslint-disable react/no-danger */
import React from 'react';
import PropTypes from 'prop-types';
import addons from '@storybook/addons';

View File

@ -1,4 +1,5 @@
#!/usr/bin/env node
/* eslint-disable no-console */
import path from 'path';
import program from 'commander';
@ -41,7 +42,7 @@ server.listen(...listenAddr, err => {
throw err;
}
const address = `http://${program.host || 'localhost'}:${program.port}/`;
console.info(`\nReact Native Storybook started on => ${address}\n`); // eslint-disable-line no-console
console.info(`\nReact Native Storybook started on => ${address}\n`);
if (program.smokeTest) {
process.exit(0);
}

View File

@ -1,5 +1,18 @@
const warn = 1;
module.exports = {
settings: {
'import/core-modules': ['config'],
},
rules: {
'import/no-unresolved': warn,
'import/extensions': [
// because of highlight.js
warn,
{
js: 'never',
json: 'always',
},
],
},
};

View File

@ -23,6 +23,7 @@ class Highlight extends React.Component {
render() {
const { children } = this.props;
// eslint-disable-next-line react/no-danger
return <div dangerouslySetInnerHTML={{ __html: children }} />;
}
}

View File

@ -1,3 +1,4 @@
/* eslint-disable react/no-danger */
import React from 'react';
import PropTypes from 'prop-types';
import DocumentTitle from 'react-document-title';

View File

@ -1,3 +1,4 @@
/* eslint-disable react/no-danger */
import React from 'react';
import PropTypes from 'prop-types';
import DocumentTitle from 'react-document-title';

View File

@ -0,0 +1,3 @@
module.exports = {
extends: ['plugin:import/react-native'],
};

View File

@ -0,0 +1,3 @@
module.exports = {
extends: ['plugin:import/react-native'],
};

View File

@ -9,5 +9,6 @@ new WebpackDevServer(webpack(config), {
}).listen(
9999,
'localhost',
// eslint-disable-next-line no-console
err => (err ? console.log(err) : console.log('Listening at http://localhost:9999/'))
);

View File

@ -28,4 +28,5 @@ if (code !== 0) {
const licence = path.join(__dirname, '..', 'LICENSE');
shell.cp(licence, './');
// eslint-disable-next-line no-console
console.log(chalk.gray(`Built: ${chalk.bold(`${packageJson.name}@${packageJson.version}`)}`));