Skip to content

Commit

Permalink
Fixed eslint errors in updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickroberts committed Jan 1, 2021
1 parent ad8be57 commit b823d5a
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 29 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-redeclare": "error",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-use-before-define": [
"error"
],
"@typescript-eslint/semi": "error",
"@typescript-eslint/space-before-function-paren": [
"error",
Expand Down Expand Up @@ -73,6 +76,7 @@
"no-redeclare": "off",
"no-shadow": "off",
"no-unused-vars": "off",
"no-use-before-define": "off",
"object-curly-newline": [
"error",
{
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
globals: {
'ts-jest': {
tsConfig: {
tsconfig: {
jsx: 'react',
target: 'es2019',
},
Expand Down
142 changes: 127 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@types/react": "^16.14.2",
"@types/react-dom": "^16.9.10",
"@types/react-test-renderer": "^16.9.4",
"@typescript-eslint/eslint-plugin": "4.0.1",
"@typescript-eslint/parser": "4.0.1",
"@typescript-eslint/eslint-plugin": "4.11.1",
"@typescript-eslint/parser": "4.11.1",
"@wessberg/rollup-plugin-ts": "^1.3.8",
"concurrently": "^5.3.0",
"eslint": "^7.16.0",
Expand Down
18 changes: 13 additions & 5 deletions src/__fixtures__/withIdContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ import IdContext, { useIdContext } from '../IdContext';

const withIdContext: (
context: IdContext<ReactNode>
) => ComponentType<{ id?: Id }> = (context) => ({ id = null }) => (
<div>
{useIdContext(context, id)}
</div>
);
) => ComponentType<{ id?: Id }> = (context) => {
const Component = ({ id }: { id?: Id }) => (
<div>
{useIdContext(context, id)}
</div>
);

Component.defaultProps = {
id: null,
};

return Component;
};

export default withIdContext;
18 changes: 13 additions & 5 deletions src/__fixtures__/withService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ import Service, { useService } from '../Service';

const withService: (
service: Service<any, ReactNode>
) => ComponentType<{ id?: Id }> = (service) => ({ id = null }) => (
<div>
{useService(service, id)}
</div>
);
) => ComponentType<{ id?: Id }> = (service) => {
const Component = ({ id }: { id?: Id }) => (
<div>
{useService(service, id)}
</div>
);

Component.defaultProps = {
id: null,
};

return Component;
};

export default withService;
1 change: 0 additions & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"disableOutputCheck": true,
"hideProjectName": true,
"mode": "file",
"out": "docs",
"sourcefile-url-prefix": "https://github.com/patrickroberts/suspense-service/blob/master/src/"
}

0 comments on commit b823d5a

Please sign in to comment.