Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/funny-adults-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sap-cloud-sdk/eslint-config': patch
---

[Improvement] Open the peer dependency range of the `eslint` module to include version 8 and 9. Version 9 can now be used without the potentially unsafe npm flag `--legacy-peer-deps`.
71 changes: 0 additions & 71 deletions .eslintrc.js

This file was deleted.

3 changes: 2 additions & 1 deletion .github/actions/changesets-fixed-version-bump/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/actions/check-public-api/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/actions/get-changelog/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build-packages/changesets-fixed-version-bump/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"devDependencies": {
"@vercel/ncc": "^0.38.4",
"depcheck": "^1.4.7",
"eslint": "^8.57.1",
"eslint": "^9.39.2",
"prettier": "^3.7.4",
"typescript": "~5.9.3"
}
Expand Down
3 changes: 2 additions & 1 deletion build-packages/changesets-fixed-version-bump/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { info } from 'node:console';
import getReleasePlan from '@changesets/get-release-plan';
import { inc } from 'semver';
// eslint-disable-next-line import/no-internal-modules
import { getPackageVersion } from '../../scripts/get-package-version';

const bumpTypeOrder = ['major', 'minor', 'patch', 'none'] as const;
Expand All @@ -18,7 +19,7 @@ export async function getNextVersion(): Promise<{
info(`Bump type: ${bumpType}`);

if (bumpType === 'none' || !bumpType) {
throw new Error(`No changesets to release`);
throw new Error('No changesets to release');
}

const version = inc(currentVersion, bumpType);
Expand Down
2 changes: 1 addition & 1 deletion build-packages/check-license/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"@vercel/ncc": "^0.38.4",
"depcheck": "^1.4.7",
"eslint": "^8.57.0",
"eslint": "^9.39.2",
"prettier": "^3.7.4",
"typescript": "~5.9.3"
}
Expand Down
2 changes: 1 addition & 1 deletion build-packages/check-pr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"devDependencies": {
"@vercel/ncc": "^0.38.4",
"depcheck": "^1.4.7",
"eslint": "^8.57.1",
"eslint": "^9.39.2",
"mock-fs": "^5.5.0",
"prettier": "^3.7.4",
"typescript": "~5.9.3"
Expand Down
4 changes: 3 additions & 1 deletion build-packages/check-public-api/check-public-api.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import mock from 'mock-fs';
import path from 'path';
import mock from 'mock-fs';
import * as core from '@actions/core';
// eslint-disable-next-line no-restricted-imports
import {
checkBarrelRecursive,
checkIndexFileExists,
Expand All @@ -10,6 +11,7 @@ import {
parseExportedObjectsInFile,
regexExportedIndex,
typeDescriptorPaths
// eslint-disable-next-line import/no-useless-path-segments
} from './index';

describe('check-public-api', () => {
Expand Down
4 changes: 2 additions & 2 deletions build-packages/check-public-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"devDependencies": {
"@vercel/ncc": "^0.38.4",
"depcheck": "^1.4.7",
"eslint": "^8.57.0",
"eslint": "^9.39.2",
"prettier": "^3.7.4",
"typescript": "~5.9.3"
}
}
}
1 change: 1 addition & 0 deletions build-packages/get-changelog/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { setOutput, setFailed } from '@actions/core';
// eslint-disable-next-line import/no-internal-modules
import { getChangelog } from '../../scripts/get-changelog';

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion build-packages/get-changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"@vercel/ncc": "^0.38.4",
"depcheck": "^1.4.7",
"eslint": "^8.57.1",
"eslint": "^9.39.2",
"prettier": "^3.7.4",
"typescript": "~5.9.3"
}
Expand Down
2 changes: 1 addition & 1 deletion build-packages/merge-and-write-changelogs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@vercel/ncc": "^0.38.3",
"depcheck": "^1.4.7",
"eslint": "^8.57.1",
"eslint": "^9.39.2",
"prettier": "^3.5.2",
"typescript": "~5.7.3"
}
Expand Down
93 changes: 93 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
const { defineConfig, globalIgnores } = require('eslint/config');

const globals = require('globals');
const tsParser = require('@typescript-eslint/parser');
const js = require('@eslint/js');

const { FlatCompat } = require('@eslint/eslintrc');

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

module.exports = defineConfig([
{
languageOptions: {
globals: {
...globals.node,
...globals.jest
},
parser: tsParser,
sourceType: 'module',
parserOptions: {
project: {
extends: 'tsconfig.json',
include: ['**/*.ts'],

exclude: [
'**/*.d.ts',
'**/dist/**/*',
'**/node_modules/**/*',
'test-packages/test-services*/**/*',
'test-packages/test-services-e2e/**/*',
'test-packages/memory-tests/sdk-v1/test-service/*',
'test-packages/memory-tests/sdk-canary/test-service/*',
'build-packages/check-pr/lib/**',
'build-packages/get-changelog/lib/**',
'packages/rest-generator/test/test-services/**/*',
'test-resources/cli/**/*',
'**/test-output/**',
'**/README.md'
]
}
}
},
extends: compat.extends('@sap-cloud-sdk'),
rules: {
radix: 'off',
'no-restricted-syntax': [
'error',
{
selector: 'TSEnumDeclaration',
message:
'Enums are weird in TypeScript. Prefer union types or const objects instead.'
}
]
}
},
globalIgnores([
'**/dist',
'**/node_modules',
'**/README.md',
'test-packages/test-services-odata-v2',
'test-packages/test-services-odata-v4',
'test-packages/test-services-odata-common',
'test-packages/test-services-openapi',
'test-packages/test-services-e2e',
'test-packages/e2e-tests/test/generator-test-output',
'test-packages/memory-tests/sdk-v1/test-service',
'test-packages/memory-tests/sdk-canary/test-service',
'packages/rest-generator/test/test-services',
'**/scripts/',
'test-resources/cli/',
'test-resources/generator/test-output',
'**/*.js',
'**/*.json'
]),
{
files: ['**/test/**/*', '**/*.spec.ts'],
rules: {
'import/no-internal-modules': 'off',
'no-unused-expressions': 'off',
'jsdoc/require-jsdoc': 'off'
}
},
{
files: ['**/index.ts'],
rules: {
'jsdoc/require-description-complete-sentence': 'off'
}
}
]);
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@
"type-tests": "yarn workspace @sap-cloud-sdk/type-tests"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@changesets/cli": "^2.29.8",
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^9.39.2",
"@types/jest": "^30.0.0",
"@types/jsonwebtoken": "^9.0.10",
"@types/license-checker": "^25.0.6",
"@types/mock-fs": "^4.13.4",
Expand All @@ -98,9 +100,10 @@
"axios": "^1.13.2",
"cross-env": "10.1.0",
"depcheck": "^1.4.7",
"eslint": "^8.57.1",
"eslint": "^9.39.2",
"execa": "^5.0.0",
"glob": "^13.0.0",
"globals": "^17.0.0",
"jest": "^30.2.0",
"jest-junit": "^16.0.0",
"license-checker": "^25.0.1",
Expand Down
3 changes: 1 addition & 2 deletions packages/connectivity/src/scp-cf/destination/destination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ export interface DestinationConfiguration {
*/
Type?: 'HTTP' | 'LDAP' | 'MAIL' | 'RFC';
}
/* eslint-disable-next-line valid-jsdoc */

/**
* @internal
*/
Expand All @@ -409,7 +409,6 @@ export function isDestinationConfiguration(
return destination.URL !== undefined;
}

/* eslint-disable-next-line valid-jsdoc */
/**
* @internal
*/
Expand Down
2 changes: 0 additions & 2 deletions packages/connectivity/src/scp-cf/protocol.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/export */

const protocols = {
http: 'http',
https: 'https',
Expand Down
10 changes: 10 additions & 0 deletions packages/eslint-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ It also uses the `eslint-config-prettier` to avoid any formatting conflicts when

## How to use

Import the flat configuration in your `eslint.config.js`:

```
import sapCloudSdkConfig from '@sap-cloud-sdk/eslint-config/flat-config';
```

Then add it to your own configuration in `defineConfig()`: `defineConfig(sapCloudSdkConfig, /* your config */)`.

### Legacy ESLint configuration files

To add the configuration please adjust your ESlint configuration (usually called `.eslintrc` or `.eslintrc.js`):

```
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"typescript-eslint": "^8.51.0"
},
"peerDependencies": {
"eslint": "^8.0.0"
"eslint": ">=8.0.0"
}
}
1 change: 0 additions & 1 deletion packages/generator-common/src/file-writer/package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface PackageJsonOptions {
moduleType?: ModuleType;
}

/* eslint-disable valid-jsdoc */
/**
* @internal
*/
Expand Down
1 change: 0 additions & 1 deletion packages/odata-v4/src/filter-function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type {
FilterFunctionReturnType as FilterFunctionReturnTypeBase
} from '@sap-cloud-sdk/odata-common/internal';
import type { Entity } from './entity';
// eslint-disable valid-jsdoc

export function filterFunction<EntityT extends Entity>(
functionName: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Function imports should reject on error response, using \`functionImports\` import 1`] = `
exports['Function imports should reject on error response, using `functionImports` import 1'] = `
"get request to https://example.com/sap/opu/odata/sap/API_TEST_SRV failed! Some error occured
{"code":"ABC","message":{"lang":"en","value":"Some error occured"},"innererror":{"application":{"component_id":"XYZ","service_namespace":"/SAP/","service_id":"API_TEST_SRV","service_version":"0001"},"transactionid":"0123456789ABCDEFGHIJKLMNOPQRSTUV","timestamp":"20130410220202.0726600","Error_Resolution":{"SAP_Transaction":"You can do something!","SAP_Note":"See SAP Note XXXX for error analysis."},"errordetails":[{"code":"ABC","message":"Some error occured","longtext_url":"URL","propertyref":"","severity":"error","target":""}]}}
Cause: Request failed with status code 400"
Expand Down
Loading
Loading