Skip to content

Commit d2bbdf9

Browse files
remove tslint; add prettier
closes #10
1 parent 75453a2 commit d2bbdf9

File tree

230 files changed

+10325
-9393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+10325
-9393
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[*]
2+
indent_style = space
3+
indent_size = 2

.eslintrc

+5-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
2-
"extends": "eslint:recommended",
2+
"extends": "plugin:prettier/recommended",
33
"parser": "typescript-eslint-parser",
44
"plugins": [
5+
"prettier",
6+
"import",
57
"typescript",
68
"mocha"
79
],
@@ -22,6 +24,7 @@
2224
{
2325
"files": ["*/src/**/*.*spec.ts"],
2426
"rules": {
27+
"mocha/no-exclusive-tests": "error",
2528
"no-magic-numbers": "off"
2629
}
2730
},
@@ -41,7 +44,6 @@
4144
],
4245
"rules": {
4346
"array-bracket-newline": ["error", "consistent"],
44-
"array-bracket-spacing": ["error", "always"],
4547
"block-spacing": ["error", "always"],
4648
"brace-style": ["error", "1tbs"],
4749
"camelcase": ["error", { "properties": "always" }],
@@ -56,12 +58,7 @@
5658
"curly": ["error", "all"],
5759
"eqeqeq": ["error", "always"],
5860
"eol-last": ["error", "always"],
59-
"implicit-arrow-linebreak": ["error", "beside"],
60-
"indent": ["error", 4, {
61-
"FunctionExpression": { "parameters": "first" },
62-
"CallExpression": { "arguments": "first" },
63-
"flatTernaryExpressions": false
64-
}],
61+
"import/order": ["error"],
6562
"key-spacing": ["warn", {
6663
"beforeColon": false,
6764
"afterColon": true,
@@ -76,7 +73,6 @@
7673
"exceptAfterSingleLine": true
7774
}],
7875
"max-statements-per-line": ["error", { "max": 1 }],
79-
"mocha/no-exclusive-tests": "error",
8076
"multiline-ternary": ["error", "always-multiline"],
8177
"new-cap": ["error", { "newIsCap": true, "capIsNew": true, "properties": true }],
8278
"new-parens": ["error"],
@@ -103,22 +99,14 @@
10399
"no-lonely-if": ["error"],
104100
"no-multi-assign": ["error"],
105101
"no-redeclare": "off", // doesn't play nice with decorators in constructors
106-
"no-tabs": ["error"],
107-
"no-trailing-spaces": ["error"],
108102
"no-unneeded-ternary": ["error"],
109103
"no-var": ["error"],
110104
"no-whitespace-before-property": ["error"],
111105
"object-curly-newline": ["error", { "multiline": true, "consistent": true }],
112106
"one-var-declaration-per-line": ["error", "initializations"],
113107
"operator-linebreak": ["error", "after"],
114-
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
115108
"semi-spacing": ["error", { "before": false, "after": true }],
116109

117-
"space-before-blocks": ["error", "always"],
118-
"space-before-function-paren": ["error", { "anonymous": "always", "named": "never", "asyncArrow": "always" }],
119-
"space-in-parens": ["error", "never"],
120-
"spaced-comment": ["error", "always", { "block": { "balanced": true } }],
121-
122110
"typescript/no-unused-vars": ["error"]
123111
}
124112
}

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v10.7.0

.prettierrc.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# .prettierrc
2+
trailingComma: all
3+
singleQuote: true
4+
arrowParens: always
+15-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
import { HttpEventOptions } from './http.event.options';
1+
import { HttpEventOptions } from './http.event.options';
22
import { HttpEventTransformer } from './http.event.transformer';
3-
import { HttpResponder } from './http.responder';
3+
import { HttpResponder } from './http.responder';
44

55
export interface AwsLambdaHttpModule extends Array<any> {
6-
configure(options: HttpEventOptions): any[];
6+
configure(options: HttpEventOptions): any[];
77
}
88

99
export const AwsLambdaHttpModule: AwsLambdaHttpModule = [
10-
HttpResponder,
11-
HttpEventTransformer,
10+
HttpResponder,
11+
HttpEventTransformer,
1212
] as any;
1313
Object.defineProperty(AwsLambdaHttpModule, 'configure', {
14-
value: (options: HttpEventOptions) => {
15-
return AwsLambdaHttpModule.concat([
16-
{
17-
provide: HttpEventOptions,
18-
useValue: options,
19-
}
20-
]);
21-
},
22-
configurable: false,
23-
writable: false,
14+
value: (options: HttpEventOptions) => {
15+
return AwsLambdaHttpModule.concat([
16+
{
17+
provide: HttpEventOptions,
18+
useValue: options,
19+
},
20+
]);
21+
},
22+
configurable: false,
23+
writable: false,
2424
});
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { AppError } from '@dandi/common';
22

33
export class DandiAwsLambdaError extends AppError {
4-
5-
constructor(message?: string, innerError?: Error) {
6-
super(message, innerError);
7-
}
8-
4+
constructor(message?: string, innerError?: Error) {
5+
super(message, innerError);
6+
}
97
}

aws-lambda-wrap/src/dynamo.stream.event.transformer.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import { DynamoDBRecord, DynamoDBStreamEvent } from 'aws-lambda';
55
import { LambdaEventTransformer } from './lambda.event.transformer';
66

77
@Injectable()
8-
export class DynamoStreamEventTransformer implements LambdaEventTransformer<DynamoDBStreamEvent, DynamoDBRecord[]> {
9-
10-
public transform(event: DynamoDBStreamEvent): DynamoDBRecord[] {
11-
return event.Records;
12-
}
13-
8+
export class DynamoStreamEventTransformer
9+
implements LambdaEventTransformer<DynamoDBStreamEvent, DynamoDBRecord[]> {
10+
public transform(event: DynamoDBStreamEvent): DynamoDBRecord[] {
11+
return event.Records;
12+
}
1413
}
+7-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import { Constructor } from '@dandi/common';
1+
import { Constructor } from '@dandi/common';
22
import { InjectionToken } from '@dandi/core';
33

44
import { localOpinionatedToken } from './local.token';
55

66
export interface HttpEventOptions {
7-
validateBody?: Constructor<any>;
8-
successStatusCode?: number;
9-
errorStatusCode?: number;
7+
validateBody?: Constructor<any>;
8+
successStatusCode?: number;
9+
errorStatusCode?: number;
1010
}
1111

12-
export const HttpEventOptions: InjectionToken<HttpEventOptions> =
13-
localOpinionatedToken('HttpEventOptions', { multi: false });
12+
export const HttpEventOptions: InjectionToken<
13+
HttpEventOptions
14+
> = localOpinionatedToken('HttpEventOptions', { multi: false });

0 commit comments

Comments
 (0)