Skip to content

Commit

Permalink
Add files for the OpenAPI dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
w3nl committed Nov 22, 2023
1 parent 06bc08d commit 1bd1f39
Show file tree
Hide file tree
Showing 31 changed files with 6,469 additions and 504 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
268 changes: 268 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
{
"settings": {
"jsdoc": {
"mode": "typescript"
}
},
"root": true,
"extends": [
"standard",
"plugin:import/recommended",
"plugin:n/recommended",
"plugin:jsdoc/recommended",
"plugin:sonarjs/recommended"
],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "latest"
},
"globals": {
"fetch": false,
"FormData": false,
"Headers": false,
"Request": false,
"Response": false
},
"env": {
"es2022": true,
"node": true,
"browser": true,
"worker": true,
"mongo": true,
"serviceworker": true,
"webextensions": true
},
"rules": {
"block-scoped-var": "error",
"complexity": [
"error",
{
"max": 20
}
],
"consistent-return": "error",
"max-classes-per-file": [
"error",
1
],
"max-params": [
"warn",
5
],
"max-depth": [
"warn",
4
],
"max-statements": [
"warn",
20
],
"linebreak-style": [
"warn",
"unix"
],
"class-methods-use-this": "off",
"no-alert": "error",
"no-caller": "error",
"no-extra-label": "error",
"no-labels": [
"error",
{
"allowLoop": false,
"allowSwitch": false
}
],
"no-loop-func": "error",
"no-prototype-builtins": "off",
"no-restricted-syntax": [
"error",
"ForInStatement",
"LabeledStatement",
"WithStatement"
],
"no-return-await": "error",
"no-else-return": [
"error",
{
"allowElseIf": false
}
],
"no-multi-assign": [
"error"
],
"arrow-body-style": [
"error",
"as-needed"
],
"no-console": "warn",
"no-param-reassign": [
"error",
{
"props": true,
"ignorePropertyModificationsFor": [
"acc",
"accumulator",
"e",
"req",
"request",
"res",
"response"
]
}
],
"no-useless-concat": "error",
"no-nested-ternary": "error",
"no-shadow": [
"error",
{
"hoist": "all",
"allow": [
"resolve",
"reject",
"done",
"next",
"err",
"error"
]
}
],
"radix": "error",
"import/prefer-default-export": "off",
"import/no-unresolved": [
"error",
{
"caseSensitive": true
}
],
"import/named": "error",
"import/no-named-as-default": "error",
"import/no-named-as-default-member": "error",
"import/no-mutable-exports": "error",
"import/order": [
"error",
{
"groups": [
[
"builtin",
"external",
"internal"
]
]
}
],
"import/no-self-import": "error",
"import/no-cycle": [
"error",
{
"maxDepth": "∞"
}
],
"import/no-useless-path-segments": [
"error",
{
"commonjs": true
}
],
"n/no-unpublished-import": "off",
"n/no-unsupported-features/es-syntax": [
"off",
{}
],
"vars-on-top": "error",
"for-direction": "error",
"getter-return": [
"error",
{
"allowImplicit": true
}
],
"no-await-in-loop": "error",
"no-inner-declarations": "error",
"no-var": "error",
"no-lonely-if": "error",
"prefer-arrow-callback": [
"error",
{
"allowNamedFunctions": false,
"allowUnboundThis": true
}
],
"prefer-destructuring": [
"error",
{
"VariableDeclarator": {
"array": false,
"object": true
},
"AssignmentExpression": {
"array": true,
"object": false
}
},
{
"enforceForRenamedProperties": false
}
],
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"require-yield": "error",
"operator-assignment": [
"error",
"always"
],
"prefer-object-spread": "error",
"no-delete-var": "error",
"jsdoc/check-access": "off",
"jsdoc/check-alignment": "error",
"jsdoc/check-examples": "off",
"jsdoc/check-indentation": "error",
"jsdoc/check-line-alignment": "off",
"jsdoc/check-param-names": "error",
"jsdoc/check-property-names": "error",
"jsdoc/check-syntax": "off",
"jsdoc/check-tag-names": "error",
"jsdoc/check-types": [
"error",
{
"unifyParentAndChildTypeChecks": true
}
],
"jsdoc/check-values": "error",
"jsdoc/empty-tags": "error",
"jsdoc/implements-on-classes": "error",
"jsdoc/match-description": "off",
"jsdoc/multiline-blocks": "error",
"jsdoc/no-bad-blocks": "off",
"jsdoc/no-defaults": "off",
"jsdoc/no-missing-syntax": "off",
"jsdoc/no-multi-asterisks": "error",
"jsdoc/no-restricted-syntax": "off",
"jsdoc/no-types": "off",
"jsdoc/no-undefined-types": "error",
"jsdoc/require-asterisk-prefix": "off",
"jsdoc/require-description": "off",
"jsdoc/require-description-complete-sentence": "off",
"jsdoc/require-example": "off",
"jsdoc/require-file-overview": "off",
"jsdoc/require-hyphen-before-param-description": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/require-param": "error",
"jsdoc/require-param-description": "off",
"jsdoc/require-param-name": "error",
"jsdoc/require-param-type": "error",
"jsdoc/require-property": "error",
"jsdoc/require-property-description": "off",
"jsdoc/require-property-name": "error",
"jsdoc/require-property-type": "error",
"jsdoc/require-returns": "error",
"jsdoc/require-returns-check": "error",
"jsdoc/require-returns-description": "off",
"jsdoc/require-returns-type": "error",
"jsdoc/require-throws": "off",
"jsdoc/require-yields": "error",
"jsdoc/require-yields-check": "error",
"jsdoc/tag-lines": "error",
"jsdoc/valid-types": "warn"
}
}
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [w3nl]
patreon: w3news
21 changes: 21 additions & 0 deletions .github/workflows/cpd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node Copy Paste Detector

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
- name: npm cpd
run: |
npm ci
npm run cpd
env:
CI: true
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node Lint

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
- name: npm lint
run: |
npm ci
npm run lint
env:
CI: true
34 changes: 34 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build --if-present
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
27 changes: 27 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: SonarCloud

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
- name: npm install, lint, and test
run: |
npm ci
npm run lint:report
npm test
env:
CI: true
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Loading

0 comments on commit 1bd1f39

Please sign in to comment.