Skip to content

Commit

Permalink
fix all files, eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Havunen committed Feb 6, 2017
1 parent f84f2d0 commit 33e468e
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -80,7 +80,7 @@
"wrap-iife": [2, "inside"],
"yoda": 2,
"strict": [2, "never"],
"no-mixed-operators": 2,
"no-mixed-operators": 0,
"no-delete-var": 2,
"no-shadow-restricted-names": 2,
"no-unused-vars": 0,
Expand Down
Expand Up @@ -229,7 +229,7 @@ function runBenchmark(container) {
} } onBlur={function () {
} }
className={'_5vwz _45hc'} wrapper={function () {
} } shouldWrapTab={true} mockSpacebarClick={true} role={'presentation'}>
} } shouldWrapTab={true} mockSpacebarClick={true} role={'presentation'}>
<a aria-selected={false} onKeyDown={function () { } }>
<div className={'_4jq5'}>{'Audiences'}</div>
<span className={'_13xf'}/>
Expand Down Expand Up @@ -504,7 +504,7 @@ function runBenchmark(container) {
return (
<a style={{ maxWidth: '200px' }} image={null} label={null} imageRight={{}} className={' _5bbf _55pi _2agf _5bbf _55pi _4jy0 _4jy4 _517h _51sy _42ft'} href={'#'} haschevron={true}
onClick={function () {
} } size={'large'} use={'default'} borderShade={'light'} suppressed={false} disabled={null} rel={undefined}>
}} size={'large'} use={'default'} borderShade={'light'} suppressed={false} disabled={null} rel={undefined}>
{null}
<span className={'_55pe'} style={{ maxWidth: '186px' }}>
<ReactImage70 />
Expand Down Expand Up @@ -1523,7 +1523,7 @@ function runBenchmark(container) {
return (
<label className={'_4h2r _55sg _kv1'}>
<input checked={undefined} onChange={function () {
} } className={null} type={'checkbox'}/>
} } className={null} type={'checkbox'}/>
<span data-hover={null} aria-label={undefined}/>
</label>
);
Expand Down Expand Up @@ -2209,7 +2209,7 @@ function runBenchmark(container) {
<div isHeaderCell={true} label={'Social %'} width={80} dataKey={'stats.social_percent'} className={'_4lgc _4h2u'} columnData={{}} cellRenderer={function () {
} }
headerDataGetter={function () {
} } columnKey={'stats.social_percent'} height={25} style={{ height: 25, width: 80 }}>
} } columnKey={'stats.social_percent'} height={25} style={{ height: 25, width: 80 }}>
<div className={'_4lgd _4h2w'}>
<div className={'_4lge _4h2x'}>
<FixedDataTableSortableHeader278 />
Expand Down Expand Up @@ -2703,7 +2703,7 @@ function runBenchmark(container) {
return (
<div className={'_4lg0 _4h2m'} style={{ height: 25, width: 80, left: 1760 }}>
<div className={'_4lg9'} style={{ height: 25 }} onMouseDown={function () {
} }>
} }>
<div className={'_4lga _4lgb'} style={{ height: 25 }}></div>
</div>
<TransitionCell329/>
Expand Down Expand Up @@ -3718,7 +3718,7 @@ function runBenchmark(container) {
columnKey={'ad.creative.body'} height={32} rowIndex={0} style={{ height: 32, width: 80 }}>
<div className={'_4lgd _4h2w'}>
<div className={'_4lge _4h2x'}>
<div className={'_2d6h _4h2r'}>{`It's an example.`}</div>
<div className={'_2d6h _4h2r'}>{'It\'s an example.'}</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -4891,7 +4891,7 @@ function runBenchmark(container) {
<div className={'_2vla _1h1g'}>
<div>
{null}
<textarea value={`It' s an example.`}/>
<textarea value={'It\' s an example.'}/>
{null}
</div>
<div className={'_2vlk'}></div>
Expand Down
96 changes: 50 additions & 46 deletions packages/inferno-create-element/__tests__/children.spec.jsx
Expand Up @@ -1859,26 +1859,26 @@ describe('Children - (JSX)', () => {

describe('Children lifecycle with fastUnmount Functional Components', () => {
it('Should call componentWillUnmount for children', () => {
function Wrapper({ bool }) {
return (
<div>
<span>foobar</span>
{bool ? <FooBar onComponentWillMount={FoobarLifecycle.componentWillMount}
onComponentWillUnmount={FoobarLifecycle.componentWillUnmount}/> : null}
</div>
);
}

let mountCalls = 0;
let unMountCalls = 0;
const FoobarLifecycle = {
const foobarLifecycle = {
componentWillUnmount: () => {
unMountCalls++;
},
componentWillMount: () => {
mountCalls++;
}
};

function Wrapper({ bool }) {
return (
<div>
<span>foobar</span>
{bool ? <FooBar onComponentWillMount={foobarLifecycle.componentWillMount}
onComponentWillUnmount={foobarLifecycle.componentWillUnmount}/> : null}
</div>
);
}
function FooBar() {
return (
<span>
Expand Down Expand Up @@ -1952,6 +1952,20 @@ describe('Children - (JSX)', () => {
});

it('Should call componentWillUnmount for nested children #2', () => {
let unMountTest = 0, unMountFoo = 0;

const testLifeCycle = {
componentWillUnmount: () => {
unMountTest++;
}
};

const fooLifecycle = {
componentWillUnmount: () => {
unMountFoo++;
}
};

function Wrapper({ bool }) {
return (
<div>
Expand All @@ -1964,28 +1978,16 @@ describe('Children - (JSX)', () => {
function FooBar() {
return (
<span>
<Test onComponentWillUnmount={TestLifecycle.componentWillUnmount}/>
<Foo onComponentWillUnmount={FooLifecycle.componentWillUnmount}/>
<Test onComponentWillUnmount={testLifeCycle.componentWillUnmount}/>
<Foo onComponentWillUnmount={fooLifecycle.componentWillUnmount}/>
</span>
);
}

let unMountTest = 0, unMountFoo = 0;

const TestLifecycle = {
componentWillUnmount: () => {
unMountTest++;
}
};
function Test() {
return <em>f</em>;
}

const FooLifecycle = {
componentWillUnmount: () => {
unMountFoo++;
}
};
function Foo() {
return <em>f</em>;
}
Expand All @@ -2001,6 +2003,14 @@ describe('Children - (JSX)', () => {
});

it('Should call componentWillUnmount for deeply nested children', () => {
let unMountTest = 0;

const testLifecycle = {
componentWillUnmount: () => {
unMountTest++;
}
};

function Wrapper({ bool }) {
return (
<div>
Expand Down Expand Up @@ -2036,18 +2046,12 @@ describe('Children - (JSX)', () => {
return (
<div>
<span></span>
<Test5 onComponentWillUnmount={TestLifecycle.componentWillUnmount}/>
<Test5 onComponentWillUnmount={testLifecycle.componentWillUnmount}/>
<span></span>
</div>
);
}
let unMountTest = 0;

const TestLifecycle = {
componentWillUnmount: () => {
unMountTest++;
}
};
function Test5() {
return <h1>ShouldUnMountMe</h1>;
}
Expand All @@ -2063,11 +2067,23 @@ describe('Children - (JSX)', () => {
});

it('Should call componentWillUnmount for parent when children dont have componentWIllUnmount', (done) => {
let unMountTest = 0,
unMountTwoTest = 0;

const testLifecycle = {
componentWillUnmount: () => {
unMountTest++;
},
componentWillUnmountTwo: () => {
unMountTwoTest++;
}
};

function Wrapper() {
return (
<div>
<span>foobar</span>
<FooBar onComponentWillUnmount={TestLifecycle.componentWillUnmountTwo}/>
<FooBar onComponentWillUnmount={testLifecycle.componentWillUnmountTwo}/>
</div>
);
}
Expand All @@ -2084,19 +2100,7 @@ describe('Children - (JSX)', () => {
return <em>f</em>;
}

let unMountTest = 0,
unMountTwoTest = 0;

const TestLifecycle = {
componentWillUnmount: () => {
unMountTest++;
},
componentWillUnmountTwo: () => {
unMountTwoTest++;
}
};

render(<Wrapper onComponentWillUnmount={TestLifecycle.componentWillUnmount}/>, container);
render(<Wrapper onComponentWillUnmount={testLifecycle.componentWillUnmount}/>, container);

expect(container.innerHTML).to.eql('<div><span>foobar</span><span><em>f</em></span></div>');

Expand Down
3 changes: 3 additions & 0 deletions packages/inferno-create-element/__tests__/components.spec.jsx
Expand Up @@ -2408,6 +2408,7 @@ describe('Components (JSX)', () => {

render() {
if (this.state.n) {
// eslint-disable-next-line
return <div ref={ (dom) => div = dom } onClick={this.onClick}>DIV</div>;
}
return <span onClick={this.onClick}>SPAN</span>;
Expand Down Expand Up @@ -2492,6 +2493,7 @@ describe('Components (JSX)', () => {

render() {
if (this.state.n) {
// eslint-disable-next-line
return <div ref={ (dom) => div = dom } onClick={this.onClick}>DIV</div>;
}
return <span onClick={this.onClick}>SPAN</span>;
Expand Down Expand Up @@ -2580,6 +2582,7 @@ describe('Components (JSX)', () => {

render() {
if (this.state.n) {
// eslint-disable-next-line
return <div ref={ (dom) => div = dom } onClick={this.onClick}>DIV</div>;
}
return <span onClick={this.onClick}>SPAN</span>;
Expand Down
3 changes: 3 additions & 0 deletions packages/inferno-create-element/__tests__/functional.spec.jsx
Expand Up @@ -14,6 +14,7 @@ describe('Functional methods (JSX)', () => {

it('A basic example', (done) => {
// Update
// eslint-disable-next-line new-cap
const Action = Type({ Increment: [], Decrement: [] });

const update = (model, action) => Action.case({
Expand All @@ -24,7 +25,9 @@ describe('Functional methods (JSX)', () => {
const actions$ = hold(1, sync());

const emitAction = (action) => actions$.next(action);
// eslint-disable-next-line new-cap
const emitDecrement = (_) => emitAction(Action.Decrement());
// eslint-disable-next-line new-cap
const emitIncrement = (_) => emitAction(Action.Increment());

// View
Expand Down

0 comments on commit 33e468e

Please sign in to comment.