Skip to content

Commit e76d89e

Browse files
authored
Merge pull request #647 from MaxGenash/STRF-8672_update_eslint
STRF-8672: Update ESLint
2 parents 399b7d0 + 300de1e commit e76d89e

98 files changed

Lines changed: 6834 additions & 4931 deletions

File tree

Some content is hidden

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

.eslintrc

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,49 @@
55
"impliedStrict": true
66
}
77
},
8-
"plugins": ["jest"],
8+
"plugins": ["jest", "node", "prettier"],
99
"extends": [
10+
"eslint:recommended",
11+
"airbnb-base",
12+
"plugin:node/recommended",
1013
"plugin:jest/recommended",
11-
"plugin:jest/style"
14+
"plugin:jest/style",
15+
"prettier",
16+
"plugin:prettier/recommended"
1217
],
1318
"env": {
1419
"es2020": true,
1520
"jest/globals": true,
1621
"node": true
1722
},
1823
"rules": {
19-
"curly": 2,
20-
"no-eq-null": 2,
21-
"comma-dangle": [ 2, "always-multiline" ],
22-
"no-caller": 2,
23-
"dot-notation": 0,
24-
"no-debugger": 2,
25-
"no-undef": 2,
26-
"no-unused-vars": 2,
27-
"semi": 2,
28-
"arrow-parens": [2, "as-needed"]
24+
///////////////////////////////////////// Our rules /////////////////////////////////////////
25+
"no-eq-null": "error",
26+
27+
///////////////////////////////////////// Overrides ////////////////////////////////////////
28+
"prettier/prettier": "warn",
29+
"no-console": "off",
30+
"class-methods-use-this": "off",
31+
"no-continue": "off",
32+
// Overwrites airbnb-base because our Node version doesn't allow to use private properies syntax yet, so we use underscores
33+
"no-underscore-dangle": ["error", { "allowAfterThis": true }],
34+
// Overwrites airbnb-base to allow for..of:
35+
"no-restricted-syntax": [
36+
"error",
37+
{
38+
"selector": "ForInStatement",
39+
"message": "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array."
40+
},
41+
{
42+
"selector": "LabeledStatement",
43+
"message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
44+
},
45+
{
46+
"selector": "WithStatement",
47+
"message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
48+
}
49+
],
50+
// Overwrites airbnb-base because woks badly with prettier making multyline strings ugly
51+
"prefer-template": "off"
2952
}
3053
}

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
### Expected behavior
22

3-
43
### Actual behavior
54

6-
75
### Steps to reproduce behavior
8-

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ A description about what this pull request implements and its purpose. Try to be
66

77
Add links to any relevant tickets and documentation.
88

9-
- [Link 1](http://example.com)
10-
- ...
9+
- [Link 1](http://example.com)
10+
- ...
1111

1212
#### Screenshots (if appropriate)
1313

.github/workflows/pull_request_review.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,42 @@
44
name: Tests
55

66
on:
7-
pull_request:
8-
branches: [ master, main ]
9-
push:
10-
branches: [ master, main ]
7+
pull_request:
8+
branches: [master, main]
9+
push:
10+
branches: [master, main]
1111

1212
jobs:
13-
build:
14-
strategy:
15-
matrix:
16-
node: [10.x, 12.x]
17-
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
18-
19-
runs-on: ${{ matrix.os }}
20-
21-
steps:
22-
- name: Checkout code
23-
uses: actions/checkout@v2
24-
25-
- name: Use Node.js ${{ matrix.node }}
26-
uses: actions/setup-node@v2-beta
27-
with:
28-
node-version: ${{ matrix.node }}
29-
30-
- name: Get npm cache directory
31-
id: npm-cache
32-
run: |
33-
echo "::set-output name=dir::$(npm config get cache)"
34-
- uses: actions/cache@v2
35-
with:
36-
path: ${{ steps.npm-cache.outputs.dir }}
37-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
38-
restore-keys: |
39-
${{ runner.os }}-node-
40-
41-
- name: Install Dependencies
42-
run: npm i
43-
44-
- name: Run tests
45-
run: npm test
13+
build:
14+
strategy:
15+
matrix:
16+
node: [10.x, 12.x]
17+
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
18+
19+
runs-on: ${{ matrix.os }}
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Use Node.js ${{ matrix.node }}
26+
uses: actions/setup-node@v2-beta
27+
with:
28+
node-version: ${{ matrix.node }}
29+
30+
- name: Get npm cache directory
31+
id: npm-cache
32+
run: |
33+
echo "::set-output name=dir::$(npm config get cache)"
34+
- uses: actions/cache@v2
35+
with:
36+
path: ${{ steps.npm-cache.outputs.dir }}
37+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
38+
restore-keys: |
39+
${{ runner.os }}-node-
40+
41+
- name: Install Dependencies
42+
run: npm i
43+
44+
- name: Run tests
45+
run: npm test

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.idea/
2+
.vscode
3+
node_modules
4+
.coverage/
5+
test/_mocks/
6+

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 100,
3+
"trailingComma": "all",
4+
"singleQuote": true
5+
}

0 commit comments

Comments
 (0)