Skip to content

Commit 952c1aa

Browse files
committed
feat: add eslint and prettier config
1 parent 16ca2a4 commit 952c1aa

File tree

5 files changed

+378
-16
lines changed

5 files changed

+378
-16
lines changed

.eslintrc.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
3+
parserOptions: {
4+
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
5+
sourceType: "module" // Allows for the use of imports
6+
},
7+
extends: [
8+
"plugin:@typescript-eslint/recommended" // Uses the recommended rules from the @typescript-eslint/eslint-plugin
9+
],
10+
rules: {
11+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
12+
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
13+
}
14+
};

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: "all",
4+
singleQuote: true,
5+
printWidth: 120,
6+
tabWidth: 4
7+
};

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"test:integration-legacy": "cucumber-js --fail-fast",
2121
"test:integration": "jest --config jest.config.integ.js --passWithNoTests",
2222
"test:protocols": "yarn build:protocols && lerna run test --scope '@aws-sdk/aws-*'",
23-
"local-publish": "node ./scripts/verdaccio-publish/index.js"
23+
"local-publish": "node ./scripts/verdaccio-publish/index.js",
24+
"lint": "eslint 'packages/**/src/*.ts' --quiet --fix"
2425
},
2526
"repository": {
2627
"type": "git",
@@ -42,10 +43,15 @@
4243
"@types/chai-as-promised": "^7.1.2",
4344
"@types/fs-extra": "^8.0.1",
4445
"@types/jest": "^26.0.4",
46+
"@typescript-eslint/eslint-plugin": "^3.6.0",
47+
"@typescript-eslint/parser": "^3.6.0",
4548
"chai": "^4.2.0",
4649
"chai-as-promised": "^7.1.1",
4750
"codecov": "^3.4.0",
4851
"cucumber": "^6.0.5",
52+
"eslint": "^7.4.0",
53+
"eslint-config-prettier": "^6.11.0",
54+
"eslint-plugin-prettier": "^3.1.4",
4955
"fs-extra": "^9.0.0",
5056
"generate-changelog": "^1.7.1",
5157
"husky": "^4.2.3",
@@ -66,7 +72,7 @@
6672
"lerna": "3.22.1",
6773
"lint-staged": "^10.0.1",
6874
"mocha": "^8.0.1",
69-
"prettier": "2.0.5",
75+
"prettier": "^2.0.5",
7076
"puppeteer": "^4.0.0",
7177
"ts-loader": "^7.0.5",
7278
"typescript": "~3.8.3",

tsconfig.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99
"noUnusedParameters": false,
1010
"removeComments": false,
1111
"incremental": true,
12-
/**
13-
* Nice to have:
14-
*/
1512
// "preserveConstEnums": true,
13+
"noImplicitAny": true,
14+
// "sourceMap": true,
15+
"noUnusedLocals": true,
16+
// "noImplicitReturns": true,
17+
// "noImplicitThis": true,
18+
// "alwaysStrict": true,
19+
// "noFallthroughCasesInSwitch": true,
1620
"module": "commonjs",
1721
"moduleResolution": "node",
1822
"target": "es5",

0 commit comments

Comments
 (0)