Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
32 changes: 0 additions & 32 deletions .eslintrc.js

This file was deleted.

5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## What does this change?

## Why?

## Link to supporting ticket or Screenshots (if applicable)
14 changes: 7 additions & 7 deletions .github/workflows/node.js.yml → .github/workflows/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '24.x'

- name: NPM install
run: npm ci
- name: YARN install
run: yarn install --frozen-lockfile

- name: Check code quality
run: npm run lint
run: yarn lint

- name: Run Tests
if: ${{ success() }}
run: npm run test
run: yarn test
3 changes: 3 additions & 0 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://docs.sonarcloud.io/advanced-setup/analysis-scope
sonar.sources=extensions
sonar.tests=tests
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ git clone https://github.com/spring-media/ds_cmp_tealium_extension.git

This is an example of how to list things you need to use the software and how to install them.

* npm
* yarn
```sh
npm install npm@latest -g
npm install -g yarn
```

### Installation
Expand All @@ -40,12 +40,12 @@ This is an example of how to list things you need to use the software and how to
```
2. Change into Root Directory and Install NPM packages
```sh
npm install
yarn install
```
3. Run the Tests

```sh
npm run test
yarn run test
```

## Extensions
Expand Down
2 changes: 1 addition & 1 deletion backup/cmp_custom_vendor_mapping/welt.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
deleteCookie(OLD_STORAGE_KEY);
}
function deleteCookie(name) {
document.cookie = name + "=; expires=" + new Date(0).toUTCString();
document.cookie = name + "=; expires=" + new Date(0).toUTCString()+';secure';
}
const fetchConsentData = function () {
return new Promise(function (resolve, reject) {
Expand Down
2 changes: 1 addition & 1 deletion backup/doPlugins/bild-bild.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if ((existingCookie && existingCookie[0].indexOf('adobe_analytics') >= 0) || (ex
encodeURIComponent(b) +
"; path=/;" +
(a ? " expires=" + f.toUTCString() + ";" : "") +
(g ? " domain=" + g + ";" : "")),
(g ? " domain=" + g + ";" : "")+';secure'),
"undefined" !== typeof window.cookieRead)
? window.cookieRead(c) === b
: !1;
Expand Down
2 changes: 1 addition & 1 deletion backup/doPlugins/bild.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ s.getPercentPageViewed = function(pid, ch) {
encodeURIComponent(b) +
"; path=/;" +
(a ? " expires=" + f.toUTCString() + ";" : "") +
(g ? " domain=" + g + ";" : "")),
(g ? " domain=" + g + ";" : "")+';secure'),
"undefined" !== typeof window.cookieRead)
? window.cookieRead(c) === b
: !1;
Expand Down
2 changes: 1 addition & 1 deletion backup/whoami/spring-premium.js

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

5 changes: 0 additions & 5 deletions backup/whoami/welt.js

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

206 changes: 206 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
/* eslint-disable import/no-default-export */
import pluginImport from 'eslint-plugin-import';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
import globals from 'globals';

export default [
{
ignores: ['backup/**', 'node_modules/**', 'dist/**']
},
{
files: ['**/*.js', '**/*.ts'],
languageOptions: {
globals: {
...globals.jest, // Jest globals: describe, it, beforeEach, etc.
...globals.node, // Node.js globals: setTimeout, setInterval, require, etc.
...globals.browser // Browser globals: window, document, etc.
},
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
}
},
plugins: {
import: pluginImport,
'@typescript-eslint': tseslint.plugin,
'@stylistic': stylistic
},
rules: {
...tseslint.configs.eslintRecommended.rules,
...tseslint.configs.recommended.rules,
// benutzerdefinierte Regeln

// import-Regeln
'import/no-default-export': 'error',

// typeScript-Regeln
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
// ersetzt "no-unused-vars": "off"

'@typescript-eslint/no-unused-expressions': 'error',
// ersetzt "no-unused-expressions": 0

'@typescript-eslint/no-use-before-define': ['error', 'nofunc'],
// ersetzt "no-use-before-define": "off"

'@stylistic/type-annotation-spacing': 'error',

// basierend auf "no-shadow": 0 und ESLint-Empfehlung für TS-Projekte
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],

// eCMAScript / Allgemeine Regeln
'arrow-spacing': 'error',
'array-bracket-spacing': ['error', 'never'],
'comma-dangle': ['warn', 'never'],
'no-cond-assign': ['error', 'except-parens'],
'no-console': 'off',
'no-constant-condition': 'error',
'no-control-regex': 'error',
'no-debugger': 'warn',
'no-dupe-args': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty': 'error',
'no-empty-character-class': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-semi': 'error',
'no-func-assign': 'off',
'no-inner-declarations': 'off',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-unsafe-negation': 'error',
'no-obj-calls': 'error',
'no-regex-spaces': 'error',
'quote-props': ['off', 'as-needed', { 'keywords': true }],
'no-sparse-arrays': 'off',
'no-unreachable': 'warn',
'no-var': 'error',
'prefer-const': 'error',
'use-isnan': 'error',
'valid-jsdoc': 'off',
'valid-typeof': 'error',
'block-scoped-var': 'off',
'complexity': 'off',
'consistent-return': 'off',
'curly': ['error', 'multi-line'],
'default-case': 'warn',
'dot-notation': 'off',
'eqeqeq': 'off',
'guard-for-in': 'warn',
'no-alert': 'error',
'no-caller': 'error',
'no-div-regex': 'warn',
'no-else-return': 'off',
'no-labels': 'error',
'no-eq-null': 'off',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-fallthrough': 'error',
'no-floating-decimal': 'error',
'no-implied-eval': 'error',
'no-iterator': 'error',
'no-lone-blocks': 'error',
'no-loop-func': 'off',
'no-multi-spaces': 'error',
'no-multi-str': 'warn',
'no-global-assign': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-param-reassign': 'off',
'no-process-env': 'error',
'no-proto': 'error',
'no-redeclare': 'error',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
// "@typescript-eslint/no-unused-expressions" ersetzt die no-unused-expressions
'no-void': 'off',
'no-warning-comments': ['warn',
{
'terms': ['todo', 'fixme'],
'location': 'start'
}
],
'no-with': 'error',
'radix': 'warn',
'vars-on-top': 'off',
'wrap-iife': 'off',
'yoda': 'off',
'strict': 'off',
'no-catch-shadow': 'error',
'no-delete-var': 'error',
'no-label-var': 'error',
// "no-shadow": "off" ist oben deaktiviert und durch die TS-Version ersetzt
'no-shadow-restricted-names': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-undefined': 'off',
// "no-unused-vars": "off" ist oben deaktiviert und durch die TS-Version ersetzt
// "no-use-before-define": "off" ist oben deaktiviert und durch die TS-Version ersetzt
'no-mixed-requires': 'off',
'indent': ['warn', 4, { 'SwitchCase': 1 }],
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
'camelcase': 'off',
'comma-spacing': ['error', { 'before': false, 'after': true }],
'comma-style': ['error', 'last'],
'consistent-this': ['warn', 'self'],
'eol-last': 'error',
'func-names': 'off',
'key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
'capitalized-comments': 'off',
'max-nested-callbacks': 'off',
'new-cap': 'off',
'new-parens': 'error',
'newline-after-var': 'off',
'no-array-constructor': 'error',
'no-continue': 'off',
'no-inline-comments': 'off',
'no-lonely-if': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-multiple-empty-lines': 'off',
'no-nested-ternary': 'warn',
'no-new-object': 'error',
'no-spaced-func': 'error',
'no-ternary': 'off',
'no-trailing-spaces': 'warn',
'no-underscore-dangle': 'off',
'no-extra-parens': ['error', 'functions'],
'object-curly-spacing': ['warn', 'always'],
'one-var': 'off',
'operator-assignment': 'off',
'padded-blocks': 'off',
'quotes': ['error', 'single', 'avoid-escape'],
'semi': 'error',
'semi-spacing': ['error', { 'before': false, 'after': true }],
'sort-vars': 'off',
'keyword-spacing': 'error',
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', {
'anonymous': 'never',
'named': 'never'
}],
// 'space-in-brackets' wurde in neueren ESLint-Versionen entfernt,
// ersetzt durch 'object-curly-spacing' und 'array-bracket-spacing'
// wir setzen es auf 'off', um Konflikte zu vermeiden.
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'spaced-comment': ['warn', 'always', { 'markers': [','] }],
'wrap-regex': 'off'
}
}
];
6 changes: 3 additions & 3 deletions extensions/brandstory/brandstory_milestones.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ window.onload = function setMilestones() {
setTimeout(() => {

// full utag.data
var eventData = {...window.utag.data};
const eventData = { ...window.utag.data };

// Add custom event data
eventData.event_name = 'article_milestone';
Expand All @@ -53,11 +53,11 @@ window.onload = function setMilestones() {

// Create a reference to members of this unit which need to be exposed for unit testing.
const exportedFunctions = {
getDomainTagValue,
getDomainTagValue
};

// Evaluate runtime environment (Browser or Node.js)
if (typeof exports === 'object') {
// Expose reference to members for unit testing.
module.exports = exportedFunctions;
}
}
Loading