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
18 changes: 0 additions & 18 deletions .eslintrc

This file was deleted.

20 changes: 18 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ name: Build & Test
- cron: 0 16 * * *
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Use Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: '24.x'
cache: 'npm'
- run: npm ci
- run: npm run lint

build:
runs-on: ubuntu-latest
strategy:
Expand All @@ -18,12 +30,16 @@ jobs:
- 17.x
- 18.x
- 19.x
- 20.x
- 22.x
- 24.x
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7
- name: 'Use Node.js ${{ matrix.node-version }}'
uses: actions/setup-node@v1
uses: actions/setup-node@v6
with:
node-version: '${{ matrix.node-version }}'
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ typings/
#Eslint output folder
target/

# Webpack build output
dist/

#Test Result
test-results.xml

Expand Down
12 changes: 0 additions & 12 deletions dist/client-encryption-nodejs.min.js

This file was deleted.

35 changes: 35 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use strict';

const js = require('@eslint/js');
const globals = require('globals');
const prettierConfig = require('eslint-config-prettier');
const pluginMocha = require('eslint-plugin-mocha').default;

module.exports = [
{
ignores: ['node_modules/**', 'dist/**'],
},
js.configs.recommended,
prettierConfig,
pluginMocha.configs.recommended,
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.node,
},
},
rules: {
'no-console': 'error',
'no-empty': 'error',
eqeqeq: ['error', 'always'],
'no-unused-vars': 'warn',
'no-unsafe-negation': 'error',
'prefer-const': 'error',
'no-var': 'error',
'mocha/no-mocha-arrows': 'off',
'mocha/no-setup-in-describe': 'off',
},
},
];
2 changes: 1 addition & 1 deletion lib/mcapi/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
} else {
return JSON.stringify(data);
}
} catch (e) {

Check warning on line 84 in lib/mcapi/utils/utils.js

View workflow job for this annotation

GitHub Actions / lint

'e' is defined but never used

Check warning on line 84 in lib/mcapi/utils/utils.js

View workflow job for this annotation

GitHub Actions / lint

'e' is defined but never used
throw new Error("Json not valid");
throw new Error("Json not valid"); // eslint-disable-line preserve-caught-error
}
};

Expand All @@ -103,7 +103,7 @@
}
try {
return JSON.parse(data);
} catch (e) {

Check warning on line 106 in lib/mcapi/utils/utils.js

View workflow job for this annotation

GitHub Actions / lint

'e' is defined but never used

Check warning on line 106 in lib/mcapi/utils/utils.js

View workflow job for this annotation

GitHub Actions / lint

'e' is defined but never used
return data.valueOf();
}
};
Expand All @@ -111,7 +111,7 @@
function isJson(str) {
try {
JSON.parse(str);
} catch (e) {

Check warning on line 114 in lib/mcapi/utils/utils.js

View workflow job for this annotation

GitHub Actions / lint

'e' is defined but never used

Check warning on line 114 in lib/mcapi/utils/utils.js

View workflow job for this annotation

GitHub Actions / lint

'e' is defined but never used
return false;
}
return true;
Expand Down Expand Up @@ -406,7 +406,7 @@
node: obj,
parent: parent,
};
} catch (e) {

Check warning on line 409 in lib/mcapi/utils/utils.js

View workflow job for this annotation

GitHub Actions / lint

'e' is defined but never used

Check warning on line 409 in lib/mcapi/utils/utils.js

View workflow job for this annotation

GitHub Actions / lint

'e' is defined but never used
return null;
}
};
Expand Down
Loading
Loading