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

sls-tsc template: migrate from tslint to typescript-eslint #353

Merged
merged 2 commits into from
Jun 4, 2020
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Changed
- `sls-tsc` sample updated to use eslint in favor of deprecated tslint

## [1.8.1] - 2020-06-04
### Added
- `destroy_stack` is now aware of `action=diff` and prints a different confirmation prompt
Expand Down
3 changes: 3 additions & 0 deletions runway/templates/sls-tsc/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
coverage
12 changes: 12 additions & 0 deletions runway/templates/sls-tsc/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
],
};
15 changes: 8 additions & 7 deletions runway/templates/sls-tsc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"docs": "typedoc",
"lint": "tslint -c tslint.json 'src/**/*.ts'",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
"lintfix": "npm run lint -- --fix",
"test": "jest",
"coverage": "npm test -- --coverage"
Expand All @@ -20,16 +20,17 @@
"@types/aws-lambda": "^8.10.20",
"@types/jest": "^24.0.20",
"@types/node": "^11.10.4",
"jest": "^24.9.0",
"@typescript-eslint/eslint-plugin": "^3.1.0",
"@typescript-eslint/parser": "^3.1.0",
"eslint": "^7.1.0",
"eslint-config-prettier": "^6.11.0",
"jest": "^26.0.1",
"prettier": "^1.19.1",
"serverless": "^1.38.0",
"serverless": "^1.71.3",
"serverless-webpack": "^5.2.0",
"ts-jest": "^24.1.0",
"ts-jest": "^26.1.0",
"ts-loader": "^5.3.3",
"ts-node": "^8.0.2",
"tslint": "^5.20.0",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
"typedoc": "^0.15.6",
"typescript": "^3.3.3333",
"webpack": "^4.29.6"
Expand Down
4 changes: 2 additions & 2 deletions runway/templates/sls-tsc/src/helloWorld.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import {
describe("Test handler", () => {
test("Verify Serverless boilerplate message is returned", async () => {
function unusedCallback<T>() {
return (undefined as any) as T;
return (undefined as any) as T; // eslint-disable-line @typescript-eslint/no-explicit-any
}

const data = await handler(
{} as APIGatewayProxyEvent,
{} as Context,
unusedCallback<any>(),
unusedCallback<any>(), // eslint-disable-line @typescript-eslint/no-explicit-any
);
expect((data as APIGatewayProxyResult).statusCode).toBe(200);
expect((data as APIGatewayProxyResult).body).toBe(
Expand Down
4 changes: 2 additions & 2 deletions runway/templates/sls-tsc/src/helloWorld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
import "source-map-support/register";

/** AWS Lambda entrypoint */
export let handler: APIGatewayProxyHandler = async (
export const handler: APIGatewayProxyHandler = async (
event: APIGatewayProxyEvent,
context: Context,
context: Context, // eslint-disable-line @typescript-eslint/no-unused-vars
): Promise<APIGatewayProxyResult> => {
return {
statusCode: 200,
Expand Down
13 changes: 0 additions & 13 deletions runway/templates/sls-tsc/tslint.json

This file was deleted.