Skip to content

Commit b0a3ec2

Browse files
committed
Update to latest linting rules and for real release 0.14.11
1 parent 9aec0bd commit b0a3ec2

File tree

10 files changed

+387
-362
lines changed

10 files changed

+387
-362
lines changed

.eslintrc.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"SwitchCase": 1
2727
}],
2828
"linebreak-style": ["error", "unix"],
29+
"no-constant-condition": ["error", {
30+
"checkLoops": false
31+
}],
2932
"quotes": ["error", "single",
3033
{
3134
"allowTemplateLiterals": false,
@@ -35,14 +38,30 @@
3538
"semi": ["error", "always"],
3639
"no-trailing-spaces": "error",
3740
"eol-last": "error",
38-
"@typescript-eslint/no-inferrable-types": "off",
3941
"@typescript-eslint/ban-ts-comment": ["error",
4042
{
4143
"ts-expect-error": "allow-with-description"
4244
}
4345
],
46+
"@typescript-eslint/ban-tslint-comment": "error",
47+
"@typescript-eslint/consistent-type-assertions": ["error", {
48+
"assertionStyle": "as",
49+
"objectLiteralTypeAssertions": "never"
50+
}],
51+
"@typescript-eslint/member-delimiter-style": "error",
52+
"@typescript-eslint/no-inferrable-types": "off",
4453
"@typescript-eslint/no-explicit-any" : 0,
45-
"@typescript-eslint/no-unused-vars": ["error"],
54+
"@typescript-eslint/no-for-in-array": "error",
55+
"@typescript-eslint/no-invalid-void-type": "error",
56+
"@typescript-eslint/no-namespace": "error",
57+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
58+
"@typescript-eslint/no-unused-vars": ["error", {
59+
"ignoreRestSiblings": true,
60+
"args": "none"
61+
}],
62+
"@typescript-eslint/prefer-for-of": ["error"],
63+
"@typescript-eslint/prefer-optional-chain": ["error"],
64+
"@typescript-eslint/prefer-ts-expect-error": ["error"],
4665
"no-console": ["error"]
4766
}
4867
}

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Changelog
22
=========
33

4-
0.14.11 (2021-04-28)
4+
0.14.11 (2021-05-23)
55
--------------------
66

77
* Upgrade to Ketting 7 for parsing hypermedia bodies.

package-lock.json

Lines changed: 332 additions & 326 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/alternate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type Type = {
77
[s: string]: {
88
label: string;
99
cssClass: string;
10-
}
10+
};
1111
};
1212

1313
const types: Type = {

src/components/forms/ketting-action-button.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { Action, Field } from 'ketting';
33
import { Button } from './button';
44

55
type FormProps = {
6-
csrfToken: string | null,
7-
action: Action
6+
csrfToken: string | null;
7+
action: Action;
88
}
99
type FieldProps = {
10-
field: Field,
10+
field: Field;
1111
}
1212

1313
/**

src/components/forms/ketting-action.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { Action, Field } from 'ketting';
33
import { Button } from './button';
44

55
type FormProps = {
6-
csrfToken: string | null,
7-
action: Action
6+
csrfToken: string | null;
7+
action: Action;
88
}
99
type FieldProps = {
10-
field: Field,
10+
field: Field;
1111
}
1212

1313
export function ActionForm(props: FormProps) {

src/components/forms/templated-links.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { PageProps } from '../../types';
33
import { Button } from './button';
44

55
type Field = {
6-
label: string,
7-
value: string,
8-
name: string
6+
label: string;
7+
value: string;
8+
name: string;
99
};
1010

1111
export function TemplatedLinks(props: PageProps) {

src/components/search.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import * as React from 'react';
55
import { Options } from '../types';
66

77
type Props = {
8-
options: Options,
9-
resourceState: State,
8+
options: Options;
9+
resourceState: State;
1010
};
1111

1212
export function Search(props: Props) {

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export default function browser(options?: Partial<Options>): Middleware {
158158
// If Content-Disposition: attachment was set, it means the API author
159159
// intended to create a download, we will also not render HTML.
160160
const cd = ctx.response.headers.get('Content-Disposition');
161-
if (cd && cd.startsWith('attachment')) {
161+
if (cd?.startsWith('attachment')) {
162162
return;
163163
}
164164

src/types.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,56 +9,56 @@ export type Options = {
99
/**
1010
* Application title
1111
*/
12-
title: string,
12+
title: string;
1313

1414
/**
1515
* Theme
1616
*
1717
* Possible options: spicy-oj, lfo, curveball
1818
*/
19-
theme: 'spicy-oj' | 'lfo' | 'curveball' | 'xmas',
19+
theme: 'spicy-oj' | 'lfo' | 'curveball' | 'xmas';
2020

2121
/**
2222
* List of custom stylesheets to embed.
2323
*
2424
* Note that setting this will cause 'theme' to be ignored.
2525
*/
26-
stylesheets: string[],
26+
stylesheets: string[];
2727

2828
/**
2929
* List of links that should be lifted to navigation sections
3030
*/
31-
navigationLinks: SureNavigationLinkMap,
31+
navigationLinks: SureNavigationLinkMap;
3232

3333
/**
3434
* Where the base assets are located
3535
*/
36-
assetBaseUrl: string,
36+
assetBaseUrl: string;
3737

3838
/**
3939
* Should this plugin handle serving the assets.
4040
*
4141
* Disable if the assets are hosted elsewhere
4242
*/
43-
serveAssets: boolean,
43+
serveAssets: boolean;
4444

4545
/**
4646
* List of hardcoded links that should show up on every page.
4747
*/
48-
defaultLinks: Link[],
48+
defaultLinks: Link[];
4949

5050
/**
5151
* List of uninteresting link relationships that should be hidden by default.
5252
*/
53-
hiddenRels: string[],
53+
hiddenRels: string[];
5454

5555
/**
5656
* If turned on, full JSON bodies are always rendered.
5757
*
5858
* This can also be turned on during runtime by adding a ?_browser-fullbody
5959
* query parameter
6060
*/
61-
fullBody: boolean,
61+
fullBody: boolean;
6262
};
6363

6464
/**
@@ -67,7 +67,7 @@ export type Options = {
6767
export type NavigationLinkMap = {
6868

6969
// Navigation links are nullable so they can be overridden
70-
[rel: string]: NavigationLink | null | true
70+
[rel: string]: NavigationLink | null | true;
7171

7272
};
7373

@@ -79,7 +79,7 @@ export type NavigationLinkMap = {
7979
export type SureNavigationLinkMap = {
8080

8181
// Navigation links are nullable so they can be overridden
82-
[rel: string]: NavigationLink
82+
[rel: string]: NavigationLink;
8383

8484
};
8585

@@ -95,28 +95,28 @@ export type NavigationPosition = 'header' | 'header-right' | 'pager' | 'alternat
9595
export type NavigationLink = {
9696

9797
// A CSS class. If it's not specified, we'll default to "rel-" + rel
98-
cssClass?: string,
98+
cssClass?: string;
9999

100100
// A title we'll put in the HTML title= attribute if it wasn't overriden.
101-
defaultTitle?: string,
101+
defaultTitle?: string;
102102

103103
// A relative URI to an icon. If it's not specified, we'll default to
104104
// [rel].svg
105-
icon?: string,
105+
icon?: string;
106106

107107
// Where the icon should appear
108-
position?: NavigationPosition,
108+
position?: NavigationPosition;
109109

110110
// Set this to to make an icon appear earlier or later. Default is 0, lower is earlier.
111-
priority?: number,
111+
priority?: number;
112112

113113
// Whether or not to show the 'title' as the button label.
114-
showLabel?: boolean
114+
showLabel?: boolean;
115115

116116
};
117117

118118
export type PageProps = {
119-
resourceState: State,
120-
options: Options,
121-
csrfToken: string | null,
119+
resourceState: State;
120+
options: Options;
121+
csrfToken: string | null;
122122
}

0 commit comments

Comments
 (0)