Skip to content

Commit

Permalink
fix some linting issues in the code
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jan 19, 2022
1 parent bb10549 commit 78fd801
Show file tree
Hide file tree
Showing 20 changed files with 8 additions and 20 deletions.
1 change: 1 addition & 0 deletions addons/docs/register.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/* eslint-disable import/extensions */
require('./dist/esm/register.js');
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ describe('angular component properties', () => {
const testDir = path.join(fixturesDir, testEntry.name);
const testFile = fs.readdirSync(testDir).find((fileName) => inputRegExp.test(fileName));
if (testFile) {
// eslint-disable-next-line jest/valid-title
it(testEntry.name, () => {
const inputPath = path.join(testDir, testFile);

Expand Down
1 change: 0 additions & 1 deletion addons/docs/src/frameworks/react/react-properties.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ describe('react component properties', () => {
const testDir = path.join(fixturesDir, testEntry.name);
const testFile = fs.readdirSync(testDir).find((fileName) => inputRegExp.test(fileName));
if (testFile) {
// eslint-disable-next-line jest/valid-title
it(testEntry.name, () => {
const inputPath = path.join(testDir, testFile);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe('web-components component properties', () => {
const testDir = path.join(fixturesDir, testEntry.name);
const testFile = fs.readdirSync(testDir).find((fileName) => inputRegExp.test(fileName));
if (testFile) {
// eslint-disable-next-line jest/valid-title
it(testEntry.name, () => {
const inputPath = path.join(testDir, testFile);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
import { Icons, WithTooltip } from '@storybook/components';
import { keyframes, styled } from '@storybook/theming';
import {
Expand All @@ -6,7 +7,6 @@ import {
Form as FormikForm,
Formik,
FormikProps,
// eslint-disable-next-line import/no-extraneous-dependencies
} from 'formik';
import React, { FC, HTMLAttributes, useCallback, useState } from 'react';

Expand Down
1 change: 0 additions & 1 deletion addons/jest/src/components/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/default-props-match-prop-types */
import React, { Fragment } from 'react';
import { styled, themes, convert } from '@storybook/theming';
import { ScrollArea, TabsState, Link, Placeholder } from '@storybook/components';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable jest/valid-title */
/* eslint-disable jest/no-export */
/* eslint-disable jest/expect-expect */
import global from 'global';
Expand Down
2 changes: 1 addition & 1 deletion app/angular/src/builders/build-storybook/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('Build Storybook Builder', () => {

expect(false).toEqual('Throw expected');
} catch (error) {
// eslint-disable-next-line jest/no-try-expect, jest/no-conditional-expect
// eslint-disable-next-line jest/no-try-expect
expect(error).toEqual(
'Broken build, fix the error above.\nYou may need to refresh the browser.'
);
Expand Down
2 changes: 1 addition & 1 deletion app/angular/src/builders/start-storybook/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe('Start Storybook Builder', () => {

expect(false).toEqual('Throw expected');
} catch (error) {
// eslint-disable-next-line jest/no-try-expect, jest/no-conditional-expect
// eslint-disable-next-line jest/no-try-expect
expect(error).toEqual(
'Broken build, fix the error above.\nYou may need to refresh the browser.'
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable jest/no-interpolation-in-snapshots */
import path from 'path';
import { Configuration } from 'webpack';
import { logger } from '@storybook/node-logger';
Expand Down
1 change: 0 additions & 1 deletion app/server/src/lib/compiler/json-to-csf-compiler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ async function generate(filePath: string) {
fs.readdirSync(transformFixturesDir)
.filter((fileName: string) => inputRegExp.test(fileName))
.forEach((fixtureFile: string) => {
// eslint-disable-next-line jest/valid-title
it(fixtureFile, async () => {
const inputPath = path.join(transformFixturesDir, fixtureFile);
const code = await generate(inputPath);
Expand Down
1 change: 1 addition & 0 deletions examples/angular-cli/jest.addon-config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/extensions */
const base = require('./jest.config.js');

module.exports = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable react/no-unused-prop-types */
import React from 'react';
// @ts-ignore
import PropTypes, { string, shape } from 'prop-types';
import momentPropTypes from 'react-moment-proptypes';
import { PRESET_SHAPE, SOME_PROP_TYPES } from './ext';
Expand Down Expand Up @@ -89,7 +88,6 @@ const SOME_INLINE_DEFAULT_PROPS = {
return null;
},
inlineHtmlElement: <div>Hey!</div>,
// eslint-disable-next-line react/prop-types
inlineFunctionalElementInlineWithProps: ({ foo }) => {
return <div>{foo}</div>;
},
Expand Down
4 changes: 2 additions & 2 deletions examples/official-storybook/stories/core/events.stories.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import { addons } from '@storybook/addons';
import Events from '@storybook/core-events';
import { FORCE_RE_RENDER } from '@storybook/core-events';
import { Button } from '@storybook/components';

let timesClicked = 0;
const increment = () => {
timesClicked += 1;
addons.getChannel().emit(Events.FORCE_RE_RENDER);
addons.getChannel().emit(FORCE_RE_RENDER);
};

export default {
Expand Down
1 change: 1 addition & 0 deletions lib/cli/bin/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node

// eslint-disable-next-line import/extensions
require('../dist/cjs/generate.js');
2 changes: 0 additions & 2 deletions lib/cli/src/upgrade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe.each([
null,
],
])('getStorybookVersion', (input, output) => {
// eslint-disable-next-line jest/valid-title
it(input, () => {
expect(getStorybookVersion(input)).toEqual(output);
});
Expand All @@ -31,7 +30,6 @@ describe.each([
['@storybook/linter-config', false],
['@storybook/design-system', false],
])('isCorePackage', (input, output) => {
// eslint-disable-next-line jest/valid-title
it(input, () => {
expect(isCorePackage(input)).toEqual(output);
});
Expand Down
1 change: 0 additions & 1 deletion lib/codemod/src/transforms/__tests__/transforms.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const inputRegExp = /\.input\.js$/;
const fixturesDir = path.resolve(__dirname, '../__testfixtures__');
fs.readdirSync(fixturesDir).forEach((transformName) => {
const transformFixturesDir = path.join(fixturesDir, transformName);
// eslint-disable-next-line jest/valid-title
describe(transformName, () =>
fs
.readdirSync(transformFixturesDir)
Expand Down
1 change: 0 additions & 1 deletion lib/postinstall/src/codemods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const inputRegExp = /\.input\.js$/;
const fixturesDir = path.resolve(__dirname, './__testfixtures__');
fs.readdirSync(fixturesDir).forEach((transformName) => {
const transformFixturesDir = path.join(fixturesDir, transformName);
// eslint-disable-next-line jest/valid-title
describe(transformName, () =>
fs
.readdirSync(transformFixturesDir)
Expand Down
1 change: 0 additions & 1 deletion lib/ui/src/components/layout/desktop.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/destructuring-assignment */
import React, { Fragment } from 'react';
import { DecoratorFn } from '@storybook/react';

Expand Down
1 change: 0 additions & 1 deletion lib/ui/src/components/layout/mobile.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/destructuring-assignment */
import React, { Fragment } from 'react';
import { ActiveTabs } from '@storybook/api';
import { DecoratorFn } from '@storybook/react';
Expand Down

0 comments on commit 78fd801

Please sign in to comment.