Add package lock and eslint config (#711)
This commit is contained in:
31
.eslintrc
31
.eslintrc
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"plugin:@sap/cds/recommended",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2022": true,
|
||||
"node": true,
|
||||
"jest": true,
|
||||
"mocha": true
|
||||
},
|
||||
"globals": {
|
||||
"SELECT": true,
|
||||
"INSERT": true,
|
||||
"UPSERT": true,
|
||||
"UPDATE": true,
|
||||
"DELETE": true,
|
||||
"CREATE": true,
|
||||
"DROP": true,
|
||||
"CDL": true,
|
||||
"CQL": true,
|
||||
"cds": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"require-atomic-updates": "off",
|
||||
"require-await":"warn",
|
||||
"no-unused-vars": ["warn", { "argsIgnorePattern": "_" }]
|
||||
}
|
||||
}
|
||||
16
.github/workflows/node.js.yml
vendored
16
.github/workflows/node.js.yml
vendored
@@ -11,7 +11,6 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
@@ -19,10 +18,21 @@ jobs:
|
||||
node-version: [20.x, 18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
|
||||
36
eslint.config.js
Normal file
36
eslint.config.js
Normal file
@@ -0,0 +1,36 @@
|
||||
const cds = require('@sap/eslint-plugin-cds')
|
||||
const globals = require('globals')
|
||||
const js = require('@eslint/js')
|
||||
|
||||
module.exports = [
|
||||
cds.configs.recommended,
|
||||
js.configs.recommended,
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
es2022: true,
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
...globals.jest,
|
||||
...globals.mocha,
|
||||
cds: true,
|
||||
sap: true,
|
||||
CDL: true,
|
||||
CQL: true,
|
||||
CREATE: true,
|
||||
DELETE: true,
|
||||
DROP: true,
|
||||
INSERT: true,
|
||||
SELECT: true,
|
||||
UPDATE: true,
|
||||
UPSERT: true
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||
'require-atomic-updates': 'off',
|
||||
'require-await': 'warn'
|
||||
}
|
||||
}
|
||||
]
|
||||
6888
package-lock.json
generated
6888
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
112
package.json
112
package.json
@@ -1,56 +1,58 @@
|
||||
{
|
||||
"name": "@capire/samples",
|
||||
"version": "2.0.0",
|
||||
"description": "A monorepo with several samples for CAP.",
|
||||
"repository": "https://github.com/sap-samples/cloud-cap-samples.git",
|
||||
"author": "daniel.hutzel@sap.com",
|
||||
"dependencies": {
|
||||
"@sap/cds": ">=7"
|
||||
},
|
||||
"workspaces": [
|
||||
"./bookshop",
|
||||
"./bookstore",
|
||||
"./common",
|
||||
"./data-viewer",
|
||||
"./fiori",
|
||||
"./hello",
|
||||
"./media",
|
||||
"./orders",
|
||||
"./loggers",
|
||||
"./reviews"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@cap-js/sqlite": "^1",
|
||||
"@sap/eslint-plugin-cds": "^2.6.1",
|
||||
"axios": "^1",
|
||||
"chai": "^4.3.4",
|
||||
"chai-as-promised": "^7.1.1",
|
||||
"chai-subset": "^1.6.0",
|
||||
"semver": "^7"
|
||||
},
|
||||
"scripts": {
|
||||
"cleanup": "rm -rf node_modules && rm -rf */node_modules && rm -rf */*/node_modules",
|
||||
"bookshop": "cds watch bookshop",
|
||||
"fiori": "cds watch fiori",
|
||||
"hello": "cds watch hello",
|
||||
"media": "cds watch media",
|
||||
"mocha": "CDS_TEST_SILENT=y npx mocha",
|
||||
"jest": "npx jest --silent",
|
||||
"start": "cds watch fiori",
|
||||
"test": "npm run jest -- --silent",
|
||||
"test:hello": "cd hello && npm test"
|
||||
},
|
||||
"jest": {
|
||||
"testTimeout": 20000,
|
||||
"testMatch": [
|
||||
"**/*.test.js"
|
||||
]
|
||||
},
|
||||
"mocha": {
|
||||
"recursive": true,
|
||||
"parallel": true,
|
||||
"timeout": 6666
|
||||
},
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"private": true
|
||||
}
|
||||
"name": "@capire/samples",
|
||||
"version": "2.0.0",
|
||||
"description": "A monorepo with several samples for CAP.",
|
||||
"repository": "https://github.com/sap-samples/cloud-cap-samples.git",
|
||||
"author": "daniel.hutzel@sap.com",
|
||||
"dependencies": {
|
||||
"@sap/cds": ">=7"
|
||||
},
|
||||
"workspaces": [
|
||||
"./bookshop",
|
||||
"./bookstore",
|
||||
"./common",
|
||||
"./data-viewer",
|
||||
"./fiori",
|
||||
"./hello",
|
||||
"./media",
|
||||
"./orders",
|
||||
"./loggers",
|
||||
"./reviews"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@cap-js/sqlite": "^1",
|
||||
"@sap/eslint-plugin-cds": "^3",
|
||||
"axios": "^1",
|
||||
"chai": "^4.3.4",
|
||||
"chai-as-promised": "^7.1.1",
|
||||
"chai-subset": "^1.6.0",
|
||||
"eslint": "^9",
|
||||
"semver": "^7"
|
||||
},
|
||||
"scripts": {
|
||||
"cleanup": "rm -rf node_modules && rm -rf */node_modules && rm -rf */*/node_modules",
|
||||
"bookshop": "cds watch bookshop",
|
||||
"fiori": "cds watch fiori",
|
||||
"hello": "cds watch hello",
|
||||
"media": "cds watch media",
|
||||
"mocha": "CDS_TEST_SILENT=y npx mocha",
|
||||
"jest": "npx jest --silent",
|
||||
"start": "cds watch fiori",
|
||||
"test": "npm run jest -- --silent",
|
||||
"test:hello": "cd hello && npm test",
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"jest": {
|
||||
"testTimeout": 20000,
|
||||
"testMatch": [
|
||||
"**/*.test.js"
|
||||
]
|
||||
},
|
||||
"mocha": {
|
||||
"recursive": true,
|
||||
"parallel": true,
|
||||
"timeout": 6666
|
||||
},
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"private": true
|
||||
}
|
||||
Reference in New Issue
Block a user