Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
style: upgrade eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
vladholubiev committed Dec 16, 2021
1 parent f552c6d commit 8a26f4b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 24 deletions.
7 changes: 6 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"root": true,
"extends": ["@shelf/eslint-config/backend"]
"extends": [
"@shelf/eslint-config/typescript"
],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
10 changes: 5 additions & 5 deletions index-another-concurrent-test.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ const ddb = DynamoDBDocument.from(
region: 'local-env',
credentials: {
accessKeyId: 'fakeMyKeyId',
secretAccessKey: 'fakeSecretAccessKey'
}
secretAccessKey: 'fakeSecretAccessKey',
},
}),
{
marshallOptions: {
convertEmptyValues: true
}
convertEmptyValues: true,
},
}
);

Expand All @@ -25,6 +25,6 @@ it('should insert item into another table concurrently', async () => {

expect(Item).toEqual({
id: '1',
hello: 'world'
hello: 'world',
});
});
10 changes: 5 additions & 5 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ const ddb = DynamoDBDocument.from(
region: 'local-env',
credentials: {
accessKeyId: 'fakeMyKeyId',
secretAccessKey: 'fakeSecretAccessKey'
}
secretAccessKey: 'fakeSecretAccessKey',
},
}),
{
marshallOptions: {
convertEmptyValues: true
}
convertEmptyValues: true,
},
}
);

Expand All @@ -25,6 +25,6 @@ it('should insert item into table', async () => {

expect(Item).toEqual({
id: '1',
hello: 'world'
hello: 'world',
});
});
8 changes: 4 additions & 4 deletions jest-dynamodb-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ module.exports = {
TableName: `files`,
KeySchema: [{AttributeName: 'id', KeyType: 'HASH'}],
AttributeDefinitions: [{AttributeName: 'id', AttributeType: 'S'}],
ProvisionedThroughput: {ReadCapacityUnits: 1, WriteCapacityUnits: 1}
ProvisionedThroughput: {ReadCapacityUnits: 1, WriteCapacityUnits: 1},
},
{
TableName: `users`,
KeySchema: [{AttributeName: 'id', KeyType: 'HASH'}],
AttributeDefinitions: [{AttributeName: 'id', AttributeType: 'S'}],
ProvisionedThroughput: {ReadCapacityUnits: 1, WriteCapacityUnits: 1}
}
ProvisionedThroughput: {ReadCapacityUnits: 1, WriteCapacityUnits: 1},
},
],
port: 8000,
options: ['-sharedDb']
options: ['-sharedDb'],
};
2 changes: 1 addition & 1 deletion jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ const {resolve} = require('path');
module.exports = {
globalSetup: resolve(__dirname, './setup.js'),
globalTeardown: resolve(__dirname, './teardown.js'),
testEnvironment: resolve(__dirname, './environment.js')
testEnvironment: resolve(__dirname, './environment.js'),
};
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@
"@aws-sdk/client-dynamodb": "^3.26.0",
"@aws-sdk/lib-dynamodb": "^3.26.0",
"@aws-sdk/util-dynamodb": "^3.26.0",
"@shelf/eslint-config": "0.19.0",
"@shelf/prettier-config": "0.0.7",
"@shelf/eslint-config": "2.7.0",
"@shelf/prettier-config": "1.0.0",
"eslint": "8.4.1",
"husky": "7.0.4",
"jest": "26.2.2",
"lint-staged": "10.2.11",
"prettier": "2.5.1"
"jest": "27.4.5",
"lint-staged": "12.1.2",
"prettier": "2.5.1",
"typescript": "4.5.4"
},
"peerDependencies": {
"@aws-sdk/client-dynamodb": "3.x.x",
Expand Down
6 changes: 3 additions & 3 deletions setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = async function () {
clientConfig,
installerConfig,
port: port = DEFAULT_PORT,
options: options = DEFAULT_OPTIONS
options: options = DEFAULT_OPTIONS,
} = typeof config === 'function' ? await config() : config;

const dynamoDB = new DynamoDB({
Expand All @@ -30,9 +30,9 @@ module.exports = async function () {
region: 'local-env',
credentials: {
accessKeyId: 'fakeMyKeyId',
secretAccessKey: 'fakeSecretAccessKey'
secretAccessKey: 'fakeSecretAccessKey',
},
...clientConfig
...clientConfig,
});

global.__DYNAMODB_CLIENT__ = dynamoDB;
Expand Down

0 comments on commit 8a26f4b

Please sign in to comment.