Skip to content

Commit

Permalink
Suppress eslint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
twisty committed Dec 3, 2019
1 parent 1f6197c commit 479ebd6
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 117 deletions.
20 changes: 9 additions & 11 deletions src/components/__tests__/input-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ describe('The <Input /> component', () => {
});

// http://getbootstrap.com/css/#forms-help-text
it('has an `aria-describedby` prop on the form control when help text is present', () => {});

it('has an `aria-invalid="true"` prop on the form control when validation has failed', () => {});

it('has an `aria-required="true"` prop on the form control when validation is required', () => {});
//it('has an `aria-describedby` prop on the form control when help text is present', () => {});
//it('has an `aria-invalid="true"` prop on the form control when validation has failed', () => {});
//it('has an `aria-required="true"` prop on the form control when validation is required', () => {});
});

describe('Input components do this', () => {
Expand Down Expand Up @@ -145,12 +143,12 @@ describe('The <Input /> component', () => {
});
});

describe('includes an `<InputGroup />` component when', () => {
it('is triggered by an `addonBefore` prop', () => {});
it('is triggered by an `addonAfter` prop', () => {});
it('is triggered by an `buttonBefore` prop', () => {});
it('is triggered by an `buttonAfter` prop', () => {});
});
//describe('includes an `<InputGroup />` component when', () => {
// it('is triggered by an `addonBefore` prop', () => {});
// it('is triggered by an `addonAfter` prop', () => {});
// it('is triggered by an `buttonBefore` prop', () => {});
// it('is triggered by an `buttonAfter` prop', () => {});
//});

describe('for "hidden" type', () => {
it('doesn’t render a label', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/component-common.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {ClassValue} from 'classnames/types';
import {ClassValue} from 'classnames/types'; // eslint-disable-line import/no-unresolved
import {LayoutType, ComponentValue} from '../types';

export const componentDefaultProps = {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
changeCallback: (name: string, value: ComponentValue): void => {},
elementWrapperClassName: '' as ClassValue,
errorMessages: [] as React.ReactNode[],
Expand All @@ -12,7 +12,7 @@ export const componentDefaultProps = {
label: null as React.ReactNode,
labelClassName: '' as ClassValue,
layout: 'horizontal' as LayoutType,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
onSetValue: (value: ComponentValue): void => {},
rowClassName: '' as ClassValue,
showErrors: true,
Expand Down
2 changes: 1 addition & 1 deletion src/components/controls/input.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import classNames from 'classnames/dedupe';
import {ClassValue} from 'classnames/types';
import {ClassValue} from 'classnames/types'; // eslint-disable-line import/no-unresolved

const defaultProps = {
className: '' as ClassValue,
Expand Down
4 changes: 2 additions & 2 deletions src/components/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ type SupportedInputType =

const defaultProps = {
...componentDefaultProps,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
blurCallback: (name: string, value: string): void => {},
blurDebounceInterval: 0,
changeDebounceInterval: 500,
className: '',
elementRef: React.createRef<HTMLInputElement>(),
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
keyDownCallback: (event: React.KeyboardEvent<HTMLInputElement>): void => {},
required: false,
type: 'text' as SupportedInputType,
Expand Down
2 changes: 1 addition & 1 deletion src/components/label.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import classNames from 'classnames/dedupe';
import RequiredSymbol from './required-symbol';
import {ClassValue} from 'classnames/types';
import {ClassValue} from 'classnames/types'; // eslint-disable-line import/no-unresolved
import {LayoutType} from '../types';

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion src/components/row.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import classNames from 'classnames/dedupe';
import Label from './label';
import {ClassValue} from 'classnames/types';
import {ClassValue} from 'classnames/types'; // eslint-disable-line import/no-unresolved
import {LayoutType} from '../types';

interface RowProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const defaultProps = {
changeDebounceInterval: 500,
cols: 0,
rows: 3,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
blurCallback: (name: string, value: string): void => {},
};

Expand Down
2 changes: 1 addition & 1 deletion src/context/frc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createContext} from 'react';
import {ClassValue} from 'classnames/types';
import {ClassValue} from 'classnames/types'; // eslint-disable-line import/no-unresolved
import {LayoutType} from '../types';

const defaultContextValue = {
Expand Down
2 changes: 1 addition & 1 deletion src/form.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import classNames from 'classnames/dedupe';
import Formsy, {FormsyProps} from 'formsy-react';
import {ClassValue} from 'classnames/types';
import {ClassValue} from 'classnames/types'; // eslint-disable-line import/no-unresolved
import {LayoutType} from './types';
import FrcContext from './context/frc';

Expand Down
190 changes: 95 additions & 95 deletions src/hoc/__tests__/component-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ describe('The component HOC', () => {
);
const componentProps = wrapper.find(TestComponent).props();

describe('`name`', () => {
it('is required', () => {});
it('should be a string', () => {});
it('is passed through to the composed component', () => {});
});
//describe('`name`', () => {
// it('is required', () => {});
// it('should be a string', () => {});
// it('is passed through to the composed component', () => {});
//});

describe('`disabled`', () => {
const disabledProp = componentProps.disabled;
Expand All @@ -49,96 +49,96 @@ describe('The component HOC', () => {
});
});

describe('`help`', () => {
it('should be a string', () => {});
it('is passed through to the composed component', () => {});
});

describe('`label`', () => {
it('should be a string', () => {});
it('is passed through to the composed component', () => {});
});

describe('`id`', () => {
it('should be a string', () => {});
it('is generated for the composed component when not supplied', () => {
//expect(typeof componentProps.id).toBe('string');
//expect(componentProps.id.startsWith('frc-')).toBe(true);
});
it('is passed through to the composed component', () => {});
});

describe('`layout`', () => {
it('defaults to `horizontal` if not supplied', () => {});
it('is merged with a master value set in a parent context', () => {});
it('is passed through to the composed component', () => {});
});

describe('`validatePristine`', () => {
it('determines whether to show errors on pristine (untouched) values', () => {});
it('is merged with a master value set in a parent context', () => {});
it('is not passed through to the composed component', () => {});
});

describe('`validateBeforeSubmit`', () => {
it('determines whether to hide errors until an attempt to submit the form is made', () => {});
it('is merged with a master value set in a parent context', () => {});
it('is not passed through to the composed component', () => {});
});

describe('other props', () => {
it('are passed through to the composed component', () => {});
});
//describe('`help`', () => {
// it('should be a string', () => {});
// it('is passed through to the composed component', () => {});
//});

//describe('`label`', () => {
// it('should be a string', () => {});
// it('is passed through to the composed component', () => {});
//});

//describe('`id`', () => {
// it('should be a string', () => {});
// it('is generated for the composed component when not supplied', () => {
// //expect(typeof componentProps.id).toBe('string');
// //expect(componentProps.id.startsWith('frc-')).toBe(true);
// });
// it('is passed through to the composed component', () => {});
//});

//describe('`layout`', () => {
// it('defaults to `horizontal` if not supplied', () => {});
// it('is merged with a master value set in a parent context', () => {});
// it('is passed through to the composed component', () => {});
//});

//describe('`validatePristine`', () => {
// it('determines whether to show errors on pristine (untouched) values', () => {});
// it('is merged with a master value set in a parent context', () => {});
// it('is not passed through to the composed component', () => {});
//});

//describe('`validateBeforeSubmit`', () => {
// it('determines whether to hide errors until an attempt to submit the form is made', () => {});
// it('is merged with a master value set in a parent context', () => {});
// it('is not passed through to the composed component', () => {});
//});

//describe('other props', () => {
// it('are passed through to the composed component', () => {});
//});
});

describe('props set on the composed component', () => {
// "Describle (v): To create a meaningless description."

describe('`errorMessages`', () => {
it('is an array', () => {});
it('is the result of formsy `getErrorMessages`', () => {});
// errorMessages: this.props.getErrorMessages(),
});

describe('`id`', () => {
it('is a string', () => {});
// id: this.getId(),
});

describe('`layout`', () => {
it('is a string', () => {});
});

describe('`required`', () => {
it('is a boolean', () => {});
it('is the result of formsy `isRequired`', () => {});
// required: this.props.isRequired(),
});

describe('`showErrors`', () => {
it('is a boolean', () => {});
// showErrors: this.shouldShowErrors(),
});

describe('css class name properties', () => {
// elementWrapperClassName
// labelClassName
// rowClassName
});

describe('`value`', () => {
it('`value` is the result of formsy getValue()', () => {});
});

describe('`disabled`', () => {
it('is a boolean', () => {});
// this.props.isFormDisabled() || this.props.disabled,
it('is overridden by formsy `isFormDisabled` (if true)', () => {});
});

describe('`onSetValue`', () => {
it('is a function', () => {});
it('is just formsy setValue, with name changed to fit with project naming convention', () => {});
});
});
//describe('props set on the composed component', () => {
// // "Describle (v): To create a meaningless description."

// describe('`errorMessages`', () => {
// it('is an array', () => {});
// it('is the result of formsy `getErrorMessages`', () => {});
// // errorMessages: this.props.getErrorMessages(),
// });

// describe('`id`', () => {
// it('is a string', () => {});
// // id: this.getId(),
// });

// describe('`layout`', () => {
// it('is a string', () => {});
// });

// describe('`required`', () => {
// it('is a boolean', () => {});
// it('is the result of formsy `isRequired`', () => {});
// // required: this.props.isRequired(),
// });

// describe('`showErrors`', () => {
// it('is a boolean', () => {});
// // showErrors: this.shouldShowErrors(),
// });

// describe('css class name properties', () => {
// // elementWrapperClassName
// // labelClassName
// // rowClassName
// });

// describe('`value`', () => {
// it('`value` is the result of formsy getValue()', () => {});
// });

// describe('`disabled`', () => {
// it('is a boolean', () => {});
// // this.props.isFormDisabled() || this.props.disabled,
// it('is overridden by formsy `isFormDisabled` (if true)', () => {});
// });

// describe('`onSetValue`', () => {
// it('is a function', () => {});
// it('is just formsy setValue, with name changed to fit with project naming convention', () => {});
// });
//});
});

0 comments on commit 479ebd6

Please sign in to comment.