Skip to content

Commit 0de5c66

Browse files
authored
Add and configure ESLint and update configuration for Prettier (actions#458)
* Add ESLint config and update Prettier * Update test files * Rebuild action * Update docs * Update licenses * Update tsconfig * Rebuild action * Update tsconfig.json * Fix console.time calls * Rebuild action * Rebuild action on Linux
1 parent ea15b3b commit 0de5c66

Some content is hidden

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

55 files changed

+4415
-1330
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,3 +1,4 @@
1+
* text=auto eol=lf
12
dist/index.js -diff -merge
23
dist/index.js linguist-generated=true
34
.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/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/e2e-cache.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ jobs:
151151
exit 1
152152
fi
153153
154-
155154
- name: Check files to cache on ubuntu-latest
156155
if: matrix.os == 'ubuntu-latest'
157156
run: |

.github/workflows/e2e-publishing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
if ($content -notlike '*maven*') {
8787
throw "settings.xml file is not overwritten"
8888
}
89-
89+
9090
test-publishing-skip-overwrite:
9191
name: settings.xml is not overwritten if flag is false
9292
runs-on: ${{ matrix.os }}
@@ -150,4 +150,4 @@ jobs:
150150
$path = Join-Path $env:RUNNER_TEMP "settings.xml"
151151
if (-not (Test-Path $path)) {
152152
throw "settings.xml file is not found in expected location"
153-
}
153+
}

.github/workflows/e2e-versions.yml

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
paths-ignore:
1212
- '**.md'
1313
schedule:
14-
- cron: '0 */12 * * *'
14+
- cron: '0 */12 * * *'
1515
workflow_dispatch:
1616
jobs:
1717
setup-java-major-versions:
@@ -21,21 +21,29 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
os: [macos-latest, windows-latest, ubuntu-latest]
24-
distribution: ['temurin', 'adopt', 'adopt-openj9', 'zulu', 'liberica', 'microsoft', 'corretto' ] # internally 'adopt-hotspot' is the same as 'adopt'
24+
distribution: [
25+
'temurin',
26+
'adopt',
27+
'adopt-openj9',
28+
'zulu',
29+
'liberica',
30+
'microsoft',
31+
'corretto'
32+
] # internally 'adopt-hotspot' is the same as 'adopt'
2533
version: ['8', '11', '16']
2634
exclude:
27-
- distribution: microsoft
28-
version: 8
35+
- distribution: microsoft
36+
version: 8
2937
include:
30-
- distribution: oracle
31-
os: macos-latest
32-
version: 17
33-
- distribution: oracle
34-
os: windows-latest
35-
version: 19
36-
- distribution: oracle
37-
os: ubuntu-latest
38-
version: 19
38+
- distribution: oracle
39+
os: macos-latest
40+
version: 17
41+
- distribution: oracle
42+
os: windows-latest
43+
version: 19
44+
- distribution: oracle
45+
os: ubuntu-latest
46+
version: 19
3947
steps:
4048
- name: Checkout
4149
uses: actions/checkout@v3
@@ -59,13 +67,13 @@ jobs:
5967
os: [macos-latest, windows-latest, ubuntu-latest]
6068
distribution: ['temurin', 'zulu', 'liberica']
6169
version:
62-
- '11.0'
63-
- '8.0.302'
64-
- '16.0.2+7'
70+
- '11.0'
71+
- '8.0.302'
72+
- '16.0.2+7'
6573
include:
66-
- distribution: oracle
67-
os: ubuntu-latest
68-
version: '19.0.1'
74+
- distribution: oracle
75+
os: ubuntu-latest
76+
version: '19.0.1'
6977
steps:
7078
- name: Checkout
7179
uses: actions/checkout@v3
@@ -262,7 +270,7 @@ jobs:
262270
fail-fast: false
263271
matrix:
264272
os: [macos-latest, windows-latest, ubuntu-latest]
265-
distribution: ['temurin', 'microsoft', 'corretto' ]
273+
distribution: ['temurin', 'microsoft', 'corretto']
266274
steps:
267275
- name: Checkout
268276
uses: actions/checkout@v3
@@ -287,7 +295,7 @@ jobs:
287295
fail-fast: false
288296
matrix:
289297
os: [macos-latest, windows-latest, ubuntu-latest]
290-
distribution: ['temurin', 'zulu', 'liberica', 'microsoft', 'corretto' ]
298+
distribution: ['temurin', 'zulu', 'liberica', 'microsoft', 'corretto']
291299
steps:
292300
- name: Checkout
293301
uses: actions/checkout@v3
@@ -311,7 +319,7 @@ jobs:
311319
fail-fast: false
312320
matrix:
313321
os: [macos-latest, windows-latest, ubuntu-latest]
314-
distribution: [ 'adopt', 'adopt-openj9', 'zulu' ]
322+
distribution: ['adopt', 'adopt-openj9', 'zulu']
315323
steps:
316324
- name: Checkout
317325
uses: actions/checkout@v3
@@ -335,7 +343,7 @@ jobs:
335343
fail-fast: false
336344
matrix:
337345
os: [macos-latest, windows-latest, ubuntu-latest]
338-
distribution: ['adopt', 'zulu', 'liberica' ]
346+
distribution: ['adopt', 'zulu', 'liberica']
339347
steps:
340348
- name: Checkout
341349
uses: actions/checkout@v3

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
name: releaseNewActionVersion
2222
runs-on: ubuntu-latest
2323
steps:
24-
- name: Update the ${{ env.TAG_NAME }} tag
25-
id: update-major-tag
26-
uses: actions/publish-action@v0.2.2
27-
with:
28-
source-tag: ${{ env.TAG_NAME }}
29-
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
24+
- name: Update the ${{ env.TAG_NAME }} tag
25+
id: update-major-tag
26+
uses: actions/publish-action@v0.2.2
27+
with:
28+
source-tag: ${{ env.TAG_NAME }}
29+
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy