mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-01 05:05:25 +08:00
Merge pull request #1936 from storybooks/eliminate-eslint-warnings
Fix/suppress current eslint warnings
This commit is contained in:
commit
8271ac6de6
@ -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',
|
||||
|
@ -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';
|
||||
})();
|
||||
|
7
addons/graphql/demo/.eslintrc.js
Normal file
7
addons/graphql/demo/.eslintrc.js
Normal file
@ -0,0 +1,7 @@
|
||||
const ignore = 0;
|
||||
|
||||
module.exports = {
|
||||
rules: {
|
||||
'import/no-unresolved': ignore,
|
||||
},
|
||||
};
|
@ -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');
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* eslint-disable react/no-danger */
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import addons from '@storybook/addons';
|
||||
|
3
app/react-native/src/bin/storybook-start.js
vendored
3
app/react-native/src/bin/storybook-start.js
vendored
@ -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);
|
||||
}
|
||||
|
@ -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',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
@ -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 }} />;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* eslint-disable react/no-danger */
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import DocumentTitle from 'react-document-title';
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* eslint-disable react/no-danger */
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import DocumentTitle from 'react-document-title';
|
||||
|
3
examples/crna-kitchen-sink/.eslintrc.js
Normal file
3
examples/crna-kitchen-sink/.eslintrc.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ['plugin:import/react-native'],
|
||||
};
|
3
examples/react-native-vanilla/.eslintrc.js
Normal file
3
examples/react-native-vanilla/.eslintrc.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ['plugin:import/react-native'],
|
||||
};
|
@ -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/'))
|
||||
);
|
||||
|
@ -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}`)}`));
|
||||
|
Loading…
x
Reference in New Issue
Block a user