Skip to content

Commit a9d0cf9

Browse files
Added enforced linting (#436)
* applied linting rules and added workflow * renamed RC files * added import plugin * remove no-unresolved * added bracket and spacing rules * fixed ci * Update .eslintrc.json Co-authored-by: Anuraag Agrawal <[email protected]> Co-authored-by: Anuraag Agrawal <[email protected]>
1 parent 85b75d1 commit a9d0cf9

File tree

108 files changed

+1378
-901
lines changed

Some content is hidden

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

108 files changed

+1378
-901
lines changed

.eslintrc.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"mocha": true,
5+
"es6": true
6+
},
7+
"parser": "@typescript-eslint/parser",
8+
"extends": [
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:import/recommended",
11+
"plugin:import/typescript"
12+
],
13+
"rules": {
14+
"indent": [
15+
"error",
16+
2
17+
],
18+
"curly": [
19+
"error",
20+
"all"
21+
],
22+
"space-before-blocks": "error",
23+
"no-console": "off",
24+
"brace-style": "error",
25+
"keyword-spacing": "error",
26+
"import/no-unresolved": "off",
27+
"linebreak-style": [
28+
"error",
29+
"unix"
30+
],
31+
"quotes": [
32+
"error",
33+
"single"
34+
],
35+
"semi": [
36+
"error",
37+
"always"
38+
],
39+
"eol-last": [
40+
"error",
41+
"always"
42+
],
43+
"no-trailing-spaces": "error",
44+
45+
/** Turn off enforcement */
46+
"@typescript-eslint/ban-types": "off",
47+
"@typescript-eslint/ban-ts-comment": "off",
48+
"@typescript-eslint/no-var-requires": "off",
49+
"@typescript-eslint/no-empty-function": "off",
50+
"@typescript-eslint/no-empty-interface": "off",
51+
"@typescript-eslint/no-explicit-any": "off",
52+
"@typescript-eslint/explicit-module-boundary-types": "off",
53+
"prefer-rest-params": "off",
54+
"@typescript-eslint/no-non-null-assertion": "off"
55+
},
56+
"parserOptions": {
57+
"ecmaVersion": 2020
58+
}
59+
}

.github/workflows/pr-build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,26 @@ jobs:
6262
env:
6363
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6464
CI: true
65+
66+
lint:
67+
name: Check code style
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Checkout AWS XRay SDK Node Repository @ default branch latest
71+
uses: actions/checkout@v2
72+
73+
- name: Setup Node
74+
uses: actions/setup-node@v1
75+
with:
76+
node-version: 14.x
77+
78+
- name: Cache NPM modules
79+
uses: actions/cache@v2
80+
with:
81+
path: $HOME/.npm
82+
key: ${{ hashFiles('package-lock.json') }}
83+
84+
- name: Lint repository
85+
run: |
86+
npx lerna bootstrap --hoist
87+
npx lerna run lint

0 commit comments

Comments
 (0)