Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/correct linting #12

Merged
merged 3 commits into from
Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,39 @@ module.exports = {
es6: true,
},
rules: {
'function-paren-newline': ['error', 'consistent'],

/* THE FOLLOWING OVERRIDES TO AIRBNB ARE CURRENTLY REQUIRED TO MAKE CODE PASS: */

/* I like these rules! */
"function-paren-newline": 0,
"keyword-spacing": 0, /* Recommend: 'function-paren-newline': ['error', 'consistent'], */
"import/first": 0,
"import/no-extraneous-dependencies": 0,
"indent": 0,
"linebreak-style": 0,
"max-len": 0,
"no-undef": 0,
"no-trailing-spaces": 0,
"no-unneeded-ternary": 0,
"object-curly-newline": 0,
"object-curly-spacing": 0,
"react/forbid-prop-types": 0,
"react/jsx-closing-bracket-location": 0,
"react/jsx-closing-tag-location": 0,
"react/jsx-curly-spacing": 0,
"react/jsx-no-comment-textnodes": 0,
"react/jsx-tag-spacing": 0,
"react/jsx-wrap-multilines": 0,
"react/no-array-index-key": 0,
'react/require-default-props': 0,
"react/sort-comp": 0,

/* Up for discussion */
"arrow-body-style": 0,
"arrow-parens": 0, /* Could relax "requireForBlockBody": true */
"no-confusing-arrow": 0,

/* Copied from govuk/react */
'react/jsx-filename-extension': 0,
'jsx-a11y/label-has-for': 0,
'filenames/match-exported': 0,
Expand Down
2 changes: 1 addition & 1 deletion components/arrow-left/src/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { mount, shallow } from 'enzyme';
import { shallow } from 'enzyme';
import { createMatchers } from 'jest-emotion';
import * as emotion from 'emotion';
import Component from '.';
Expand Down
10 changes: 5 additions & 5 deletions components/counter-bar/src/stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ stories.add('Component default', () =>
{ id: 'pqr', name: 'Counter 6', score: 1 },
{ id: 'stu', name: 'Counter 7', score: 0 },
]}
/>
/>,
);

stories.add('Active Counter', () =>
Expand All @@ -61,7 +61,7 @@ stories.add('Active Counter', () =>
{ active: true, id: 'def', name: 'Counter 2', score: 2 },
{ id: 'ghi', name: 'Counter 3', score: 2 },
]}
/>
/>,
);

stories.add('Active Title', () =>
Expand All @@ -74,7 +74,7 @@ stories.add('Active Title', () =>
{ id: 'def', name: 'Counter 2', score: 2 },
{ id: 'ghi', name: 'Counter 3', score: 0 },
]}
/>
/>,
);

stories.add('Active Counter and Title on click', () => <ControlledCounterBar />);
Expand Down Expand Up @@ -110,7 +110,7 @@ stories.add('CounterBar with padded container', () =>
{ id: 'stu', name: 'Counter 7', score: 2 },
]}
/>
</div>
</div>,
);

stories.add('Zero/no scores', () =>
Expand All @@ -122,5 +122,5 @@ stories.add('Zero/no scores', () =>
{ id: 'def', name: 'Counter 2' },
{ id: 'ghi', name: 'Counter 3', score: 0 },
]}
/>
/>,
);
10 changes: 5 additions & 5 deletions components/header-button/src/stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import Keyline from '@govuk-frederic/keyline';
const stories = storiesOf('Buttons/HeaderButton', module);

stories.add('Component default', () =>
<HeaderButton>One</HeaderButton>
<HeaderButton>One</HeaderButton>,
);

stories.add('Multiple Header Buttons', () =>
<Fragment>
<HeaderButton>One</HeaderButton>
<HeaderButton>Two</HeaderButton>
</Fragment>
</Fragment>,
);

stories.add('Multiple Header Buttons with keyline', () =>
Expand All @@ -22,13 +22,13 @@ stories.add('Multiple Header Buttons with keyline', () =>
<HeaderButton>One</HeaderButton>
<HeaderButton>Two</HeaderButton>
</Keyline>
</Fragment>
</Fragment>,
);

stories.add('Active Header Button', () =>
<HeaderButton active>On</HeaderButton>
<HeaderButton active>On</HeaderButton>,
);

stories.add('Disable Header Button', () =>
<HeaderButton disabled>Off</HeaderButton>
<HeaderButton disabled>Off</HeaderButton>,
);
10 changes: 5 additions & 5 deletions components/table/src/stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ const exampleNames = ['one', 'two', 'three', 'four'];
const stories = storiesOf('Tables/Table', module);

stories.add('Component default', () =>
<Table titles={arrayExampleHeadings} rows={arrayExampleContent} names={exampleNames} />
<Table titles={arrayExampleHeadings} rows={arrayExampleContent} names={exampleNames} />,
);

stories.add('rowIncludesHeading', () =>
<Table titles={arrayExampleHeadings} rows={arrayExampleContent} rowIncludesHeading />
<Table titles={arrayExampleHeadings} rows={arrayExampleContent} rowIncludesHeading />,
);

stories.add('rowIncludesHeading, no titles', () =>
<Table rows={arrayExampleContent} rowIncludesHeading names={exampleNames} />
<Table rows={arrayExampleContent} rowIncludesHeading names={exampleNames} />,
);

stories.add('rowIncludesHeading, no titles, small single row', () =>
<Table rows={[['title', 'value']]} rowIncludesHeading />
<Table rows={[['title', 'value']]} rowIncludesHeading />,
);

stories.add('rowIncludesHeading, with flexible columns', () =>
<Table titles={arrayExampleHeadings} rows={arrayExampleContent} flexibleColumns rowIncludesHeading />
<Table titles={arrayExampleHeadings} rows={arrayExampleContent} flexibleColumns rowIncludesHeading />,
);