Skip to content

Commit ed8aca9

Browse files
authored
chore: eslint^9 (#111)
1 parent 523b7c0 commit ed8aca9

File tree

10 files changed

+19
-30
lines changed

10 files changed

+19
-30
lines changed

.eslintrc

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
branches: [ main ]
99

1010
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- run: npm i
16+
- run: npm run lint
1117
test:
1218
runs-on: ubuntu-latest
1319
strategy:
@@ -25,7 +31,6 @@ jobs:
2531
- run: npm i
2632
- run: npm i @sap/cds@${{ matrix.cds-version }}
2733
- run: cds v
28-
- run: npm run lint
2934
- run: npm run test
3035
env:
3136
ALS_CREDS_OAUTH2: ${{ secrets.ALS_CREDS_OAUTH2 }}

eslint.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import cds from '@sap/cds/eslint.config.mjs'
2+
export default [...cds.recommended]

lib/utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const cds = require('@sap/cds')
2+
13
const WRITE = { CREATE: 1, UPDATE: 1, DELETE: 1 }
24

35
const $hasPersonalData = Symbol('@cap-js/audit-logging:hasPersonalData')

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"lint": "npx eslint .",
1717
"test": "npm run test-new-db && npm run test-old-db",
1818
"test-new-db": "CDS_ENV='better-sqlite' npx jest --silent",
19-
"test-old-db": "npx jest --silent"
19+
"test-old-db": "CDS_ENV='legacy-sqlite' npx jest --silent"
2020
},
2121
"peerDependencies": {
2222
"@sap/cds": ">=7"
@@ -25,7 +25,7 @@
2525
"@cap-js/audit-logging": "file:.",
2626
"@cap-js/sqlite": "^1",
2727
"axios": "^1",
28-
"eslint": "^8",
28+
"eslint": "^9",
2929
"express": "^4",
3030
"jest": "^29",
3131
"sqlite3": "^5.1.6"

srv/log2console.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = class AuditLog2Console extends AuditLogService {
55
this.on('*', function (req) {
66
const { event, data } = req
77

8+
// eslint-disable-next-line no-console
89
console.log(`[audit-log] - ${event}:`, data)
910
})
1011

test/api/MyAuditLogService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class MyAuditLogService extends AuditLogService {
55
this.on('*', function (req) {
66
const { event, data } = req
77

8+
// eslint-disable-next-line no-console
89
console.log(`[my-audit-log] - ${event}:`, data)
910
})
1011

test/api/srv/api-service.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const cds = require('@sap/cds')
2+
13
module.exports = async function () {
24
const audit = await cds.connect.to('audit-log')
35

test/integration/srv/integration-service.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const cds = require('@sap/cds')
2+
13
module.exports = async function () {
24
const audit = await cds.connect.to('audit-log')
35

test/jest.setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function toContainMatchObject(received, expected) {
44
try {
55
expect(each).toMatchObject(expected)
66
pass = true
7-
} catch (e) {
7+
} catch {
88
// ignore
99
}
1010

0 commit comments

Comments
 (0)