Skip to content

Commit 0bd6fe6

Browse files
authored
chore(ci): enable linter on PR (#3257)
* ci: add changed-file lint gate * ci: run lint job on node 22
1 parent b57a81d commit 0bd6fe6

5 files changed

Lines changed: 1401 additions & 31 deletions

File tree

.github/workflows/tests.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ on:
1616
paths-ignore:
1717
- "**/*.md"
1818
jobs:
19+
lint:
20+
if: github.event_name == 'pull_request'
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 1
26+
- name: Use Node.js 22
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 22
30+
- name: Install Packages
31+
run: npm ci
32+
- name: Lint changed files
33+
run: npm run lint:changed
34+
1935
tests:
2036
runs-on: ubuntu-latest
2137
strategy:
@@ -41,4 +57,4 @@ jobs:
4157
node-version: ${{ matrix.node-version }}
4258
redis-tag: ${{ matrix.redis.tag }}
4359
redis-version: ${{ matrix.redis.version }}
44-
otel-authorization-token: ${{ secrets.SELF_CHECK_OTEL_AUTHORIZATION_TOKEN }}
60+
otel-authorization-token: ${{ secrets.SELF_CHECK_OTEL_AUTHORIZATION_TOKEN }}

eslint.config.mjs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import tseslint from 'typescript-eslint';
4+
5+
export default [
6+
{
7+
ignores: [
8+
'**/coverage/**',
9+
'**/dist/**',
10+
'**/junit-results/**',
11+
'**/node_modules/**',
12+
'documentation/**'
13+
]
14+
},
15+
js.configs.recommended,
16+
...tseslint.configs.recommended,
17+
{
18+
files: ['**/*.{cjs,js,mjs,ts}'],
19+
languageOptions: {
20+
ecmaVersion: 'latest',
21+
sourceType: 'module',
22+
globals: {
23+
...globals.es2023,
24+
...globals.node
25+
}
26+
},
27+
rules: {
28+
'no-empty': ['error', { allowEmptyCatch: true }]
29+
}
30+
},
31+
{
32+
files: ['**/*.ts'],
33+
rules: {
34+
'no-undef': 'off',
35+
'no-unused-vars': 'off',
36+
'@typescript-eslint/no-unused-vars': ['error', {
37+
argsIgnorePattern: '^_',
38+
caughtErrorsIgnorePattern: '^_',
39+
varsIgnorePattern: '^_'
40+
}]
41+
}
42+
},
43+
{
44+
files: ['**/*.spec.ts', '**/integration-tests/**/*.ts'],
45+
languageOptions: {
46+
globals: globals.mocha
47+
}
48+
}
49+
];

0 commit comments

Comments
 (0)