Skip to content

Commit 962678f

Browse files
authored
Add and configure ESLint and update configuration for Prettier (actions#703)
* Add ESLinter and update Prettier * Update eslint config * Update dependencies * Rebuild action * Update package.json * Updates docs * Update docs
1 parent 7c29869 commit 962678f

31 files changed

+3949
-1690
lines changed

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ignore list
2+
/*
3+
4+
# Do not ignore these folders:
5+
!__tests__/
6+
!src/

.eslintrc.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
module.exports = {
2+
extends: [
3+
'eslint:recommended',
4+
'plugin:@typescript-eslint/recommended',
5+
'plugin:eslint-plugin-jest/recommended',
6+
'eslint-config-prettier'
7+
],
8+
parser: '@typescript-eslint/parser',
9+
plugins: ['@typescript-eslint', 'eslint-plugin-jest'],
10+
rules: {
11+
'@typescript-eslint/no-require-imports': 'error',
12+
'@typescript-eslint/no-non-null-assertion': 'off',
13+
'@typescript-eslint/no-explicit-any': 'off',
14+
'@typescript-eslint/no-empty-function': 'off',
15+
'@typescript-eslint/ban-ts-comment': [
16+
'error',
17+
{
18+
'ts-ignore': 'allow-with-description'
19+
}
20+
],
21+
'no-console': 'error',
22+
'yoda': 'error',
23+
'prefer-const': [
24+
'error',
25+
{
26+
destructuring: 'all'
27+
}
28+
],
29+
'no-control-regex': 'off',
30+
'no-constant-condition': ['error', {checkLoops: false}]
31+
},
32+
overrides: [
33+
{
34+
files: ['**/*{test,spec}.ts'],
35+
rules: {
36+
'@typescript-eslint/no-unused-vars': 'off',
37+
'jest/no-standalone-expect': 'off',
38+
'jest/no-conditional-expect': 'off',
39+
'no-console': 'off',
40+
41+
}
42+
}
43+
],
44+
env: {
45+
node: true,
46+
es6: true,
47+
'jest/globals': true
48+
}
49+
};

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
* text=auto eol=lf
12
.licenses/** -diff linguist-generated=true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
blank_issues_enabled: false
1+
blank_issues_enabled: false

.github/workflows/basic-validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ on:
1414
jobs:
1515
call-basic-validation:
1616
name: Basic validation
17-
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
17+
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main

.github/workflows/check-dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ on:
1414
jobs:
1515
call-check-dist:
1616
name: Check dist/
17-
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
17+
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: CodeQL analysis
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88
schedule:
99
- cron: '0 3 * * 0'
1010

1111
jobs:
1212
call-codeQL-analysis:
13-
name: CodeQL analysis
14-
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
13+
name: CodeQL analysis
14+
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main

.github/workflows/release-new-action-version.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
name: releaseNewActionVersion
2222
runs-on: ubuntu-latest
2323
steps:
24-
- name: Update the ${{ env.TAG_NAME }} tag
25-
uses: actions/[email protected]
26-
with:
27-
source-tag: ${{ env.TAG_NAME }}
28-
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
24+
- name: Update the ${{ env.TAG_NAME }} tag
25+
uses: actions/[email protected]
26+
with:
27+
source-tag: ${{ env.TAG_NAME }}
28+
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

.github/workflows/versions.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ jobs:
5757
fail-fast: false
5858
matrix:
5959
os: [ubuntu-latest, windows-latest, macos-latest]
60-
node-version: ['20-v8-canary', '20.0.0-v8-canary','20.0.0-v8-canary20221103f7e2421e91']
60+
node-version:
61+
[
62+
'20-v8-canary',
63+
'20.0.0-v8-canary',
64+
'20.0.0-v8-canary20221103f7e2421e91'
65+
]
6166
steps:
6267
- uses: actions/checkout@v3
6368
- name: Setup Node
@@ -77,7 +82,8 @@ jobs:
7782
fail-fast: false
7883
matrix:
7984
os: [ubuntu-latest, windows-latest, macos-latest]
80-
node-version: [16.0.0-nightly20210420a0261d231c, 17-nightly, 18.0.0-nightly]
85+
node-version:
86+
[16.0.0-nightly20210420a0261d231c, 17-nightly, 18.0.0-nightly]
8187
steps:
8288
- uses: actions/checkout@v3
8389
- name: Setup Node
@@ -170,7 +176,7 @@ jobs:
170176
strategy:
171177
fail-fast: false
172178
matrix:
173-
os: [ ubuntu-latest, windows-latest, macos-latest ]
179+
os: [ubuntu-latest, windows-latest, macos-latest]
174180
steps:
175181
- uses: actions/checkout@v3
176182
- name: Setup node from node version file

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Ignore list
2+
/*
3+
4+
# Do not ignore these folders:
5+
!__tests__/
6+
!.github/
7+
!src/

0 commit comments

Comments
 (0)