-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
5,787 additions
and
504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [w3nl] | ||
patreon: w3news |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
Oops, something went wrong.