Skip to content
Open
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
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

41 changes: 0 additions & 41 deletions .eslintrc.js

This file was deleted.

30 changes: 20 additions & 10 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

examples:
name: Lint Examples
lint:
name: Lint
runs-on: ubuntu-latest
if: >
github.event_name == 'push' ||
Expand All @@ -45,7 +45,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'

- run: npm install --ignore-scripts

Expand All @@ -54,15 +54,22 @@ jobs:
- name: print versions
run: echo npm $(npm -v), node $(node -v)

- run: pushd ./examples/aml-check && npm install --ignore-scripts && npm update && npm run lint && popd
- run: npm install --ignore-scripts -p ./examples/aml-check
- run: npm install --ignore-scripts -p ./examples/digital-identity
- run: npm install --ignore-scripts -p ./examples/idv
- run: npm install --ignore-scripts -p ./examples/idv-identity-checks
- run: npm install --ignore-scripts -p ./examples/profile
- run: npm install --ignore-scripts -p ./examples/profile-identity-checks

- run: pushd ./examples/idv && npm install --ignore-scripts && npm update && npm run lint && popd
- run: npm run lint

- run: pushd ./examples/idv-identity-checks && npm install --ignore-scripts && npm update && npm run lint && popd

- run: pushd ./examples/profile && npm install --ignore-scripts && npm update && npm run lint && popd

- run: pushd ./examples/profile-identity-checks && npm install --ignore-scripts && npm update && npm run lint && popd
# - run: pushd ./examples/idv && npm install --ignore-scripts && npm update && npm run lint && popd
#
# - run: pushd ./examples/idv-identity-checks && npm install --ignore-scripts && npm update && npm run lint && popd
#
# - run: pushd ./examples/profile && npm install --ignore-scripts && npm update && npm run lint && popd
#
# - run: pushd ./examples/profile-identity-checks && npm install --ignore-scripts && npm update && npm run lint && popd

node-compatibility:
name: Node ${{ matrix.node-version }}
Expand All @@ -88,6 +95,9 @@ jobs:

- run: npm update

# Jest 30 does not support Node 14/16
- run: npm install --ignore-scripts jest@29

- run: npm run test

os-compatibility:
Expand Down
5 changes: 1 addition & 4 deletions audit-ci.jsonc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"moderate": true,
"skip-dev": false,
"allowlist": [
"GHSA-p5wg-g6qr-c7cg|eslint",
"GHSA-p5wg-g6qr-c7cg|eslint-config-airbnb-base>eslint"
]
"allowlist": []
}
1 change: 1 addition & 0 deletions config/yoti.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const yoti = {
connectApi: process.env.YOTI_CONNECT_API || process.env.YOTI_API_URL || `${constants.API_BASE_URL}/api/v1`,
idvApi: process.env.YOTI_IDV_API || process.env.YOTI_IDV_API_URL || `${constants.API_BASE_URL}/idverify/v1`,
digitalIdentityApi: process.env.YOTI_DIGITAL_IDENTITY_API_URL || `${constants.API_BASE_URL}/share`,
authApi: process.env.YOTI_AUTH_API_URL || `${constants.AUTH_API_BASE_URL}/v1/oauth/token`,
};

module.exports = yoti;
83 changes: 83 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import path from 'path';

import { includeIgnoreFile } from '@eslint/compat';
import js from '@eslint/js';
import { defineConfig } from 'eslint/config';
import { configs, plugins } from 'eslint-config-airbnb-extended';
import pluginJest from 'eslint-plugin-jest';

const gitignorePath = path.resolve('.', '.gitignore');
const gitIgnored = includeIgnoreFile(gitignorePath);

const jsConfig = defineConfig([
// ESLint recommended config
{
name: 'js/config',
...js.configs.recommended,
},
// Stylistic plugin
plugins.stylistic,
// Import X plugin
plugins.importX,
// Airbnb base recommended config
...configs.base.recommended,
]);

const nodeConfig = defineConfig([
// Node plugin
plugins.node,
// Airbnb Node recommended config
...configs.node.recommended,
]);

const fullConfig = defineConfig([
{
ignores: [...gitIgnored.ignores, 'types'],
},
// JavaScript config
...jsConfig,
// Node config
...nodeConfig,
{
files: ['**/*.spec.js'],
plugins: { jest: pluginJest },
languageOptions: {
globals: pluginJest.environments.globals.globals,
},
rules: {
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
},
{
rules: {
'n/no-sync': 'off',
strict: 'off',
'default-param-last': 'off',
'prefer-object-spread': 'off',
'@stylistic/comma-dangle': ['error', {
arrays: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
imports: 'always-multiline',
objects: 'always-multiline',
}],
'@stylistic/max-len': ['error', {
code: 160,
tabWidth: 2,
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignorePattern: '\\* @typedef \\{import',
}],
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
},
},
]);

export default fullConfig;
11 changes: 0 additions & 11 deletions examples/aml-check/.eslintrc.js

This file was deleted.

Loading
Loading