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

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x, 21.x]
node-version: [14.x, 16.x, 18.x, 20.x, 22.x, 23.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
25 changes: 25 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import globals from "globals";
import mochaPlugin from 'eslint-plugin-mocha';
import pluginJs from "@eslint/js";


/** @type {import('eslint').Linter.Config[]} */
export default [
mochaPlugin.configs.flat.recommended,
{
files: ["**/*.js"],
languageOptions: {
sourceType: "commonjs"
}
},
{
languageOptions: {
globals: globals.node
},
rules: {
"mocha/no-mocha-arrows": "off",
"mocha/consistent-spacing-between-blocks": "off",
}
},
pluginJs.configs.recommended,
];
2 changes: 1 addition & 1 deletion example/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const express = require('express');
const { config, hasPermission, getPermissions } = require('./../lib');
const { config, hasPermission, getPermissions, hasOneOfPermissions } = require('./../lib');
const errorhandler = require('./error.middleware');
const permissionService = require('./permission.service');
const { helloWorld, helloWorldAuthz } = require('./demo.controller');
Expand Down
1 change: 1 addition & 0 deletions example/permission.service.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line
function getPermissions(token) {
// Retrieve the users permissions here & return array
return [ 'something' ];
Expand Down
Loading
Loading