Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: eslint^9 #111

Merged
merged 7 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .eslintrc

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
branches: [ main ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm i
- run: npm run lint
test:
runs-on: ubuntu-latest
strategy:
Expand All @@ -25,7 +31,6 @@ jobs:
- run: npm i
- run: npm i @sap/cds@${{ matrix.cds-version }}
- run: cds v
- run: npm run lint
- run: npm run test
env:
ALS_CREDS_OAUTH2: ${{ secrets.ALS_CREDS_OAUTH2 }}
Expand Down
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import cds from '@sap/cds/eslint.config.mjs'
export default [...cds.recommended]
2 changes: 2 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const cds = require('@sap/cds')

const WRITE = { CREATE: 1, UPDATE: 1, DELETE: 1 }

const $hasPersonalData = Symbol('@cap-js/audit-logging:hasPersonalData')
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint": "npx eslint .",
"test": "npm run test-new-db && npm run test-old-db",
"test-new-db": "CDS_ENV='better-sqlite' npx jest --silent",
"test-old-db": "npx jest --silent"
"test-old-db": "CDS_ENV='legacy-sqlite' npx jest --silent"
},
"peerDependencies": {
"@sap/cds": ">=7"
Expand All @@ -25,7 +25,7 @@
"@cap-js/audit-logging": "file:.",
"@cap-js/sqlite": "^1",
"axios": "^1",
"eslint": "^8",
"eslint": "^9",
"express": "^4",
"jest": "^29",
"sqlite3": "^5.1.6"
Expand Down
1 change: 1 addition & 0 deletions srv/log2console.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = class AuditLog2Console extends AuditLogService {
this.on('*', function (req) {
const { event, data } = req

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

Expand Down
1 change: 1 addition & 0 deletions test/api/MyAuditLogService.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class MyAuditLogService extends AuditLogService {
this.on('*', function (req) {
const { event, data } = req

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

Expand Down
2 changes: 2 additions & 0 deletions test/api/srv/api-service.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const cds = require('@sap/cds')

module.exports = async function () {
const audit = await cds.connect.to('audit-log')

Expand Down
2 changes: 2 additions & 0 deletions test/integration/srv/integration-service.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const cds = require('@sap/cds')

module.exports = async function () {
const audit = await cds.connect.to('audit-log')

Expand Down
2 changes: 1 addition & 1 deletion test/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function toContainMatchObject(received, expected) {
try {
expect(each).toMatchObject(expected)
pass = true
} catch (e) {
} catch {
// ignore
}

Expand Down
Loading