-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: v2 preparations * chore: add editorconfig, install prettier, rename tool-versions, drop dead nodejs versions from CI * feat: rewrite architecture from scratch, add basic implementation for plugin system, add abuse-ipdb plugin * feat: work in progress (types) * feat: add example playground for express * feat: fix type issues and inconsistencies * feat: add virus total plugin into ip-based mitigation module * feat: add ratelimiting, add leaky bucket ratelimiter plugin * feat: enable strict and strictNullChecks in tsconfig * chore: update the docs * chore: update package.json commands * chore: bump package.json version * chore: revert version bump * 2.0.0 * fix: re-export plugins * fix: revert changed version * 2.0.0-alpha.1
- Loading branch information
1 parent
6aac63d
commit dd82d41
Showing
83 changed files
with
11,592 additions
and
19,125 deletions.
There are no files selected for viewing
Empty file.
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,12 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,97 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended' | ||
parser: '@typescript-eslint/parser', // Specifies the ESLint parser | ||
extends: [ | ||
'airbnb-base', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier', | ||
'plugin:import/errors', | ||
'plugin:import/warnings', | ||
'plugin:import/typescript', | ||
'plugin:jest/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
plugins: ['@typescript-eslint', 'jest', 'prettier'], | ||
parserOptions: { | ||
ecmaVersion: 12, | ||
sourceType: 'module', | ||
}, | ||
env: { | ||
node: true, | ||
es6: true, | ||
jest: true, | ||
}, | ||
rules: { | ||
'class-methods-use-this': 'off', | ||
'import/prefer-default-export': 'off', | ||
'eol-last': ['error', 'always'], | ||
'newline-before-return': 'error', | ||
'import/extensions': 0, | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: false, | ||
optionalDependencies: false, | ||
peerDependencies: false, | ||
}, | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2019, | ||
sourceType: 'module' | ||
'no-restricted-imports': 'error', | ||
'semi': 'error', | ||
'comma-dangle': 'off', | ||
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'], | ||
'quotes': 'off', | ||
'@typescript-eslint/quotes': [ | ||
'error', | ||
'single', | ||
{ | ||
allowTemplateLiterals: true, | ||
}, | ||
], | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': ['error'], | ||
'arrow-parens': ['error', 'always'], | ||
'indent': 'off', | ||
'@typescript-eslint/indent': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', | ||
{ | ||
argsIgnorePattern: '^_', | ||
}, | ||
], | ||
'spaced-comment': ['error', 'always'], | ||
'no-multiple-empty-lines': [ | ||
'error', | ||
{ | ||
max: 2, | ||
maxEOF: 0, | ||
}, | ||
], | ||
'import/order': [ | ||
'error', | ||
{ | ||
'groups': [['external', 'internal', 'builtin'], ['sibling', 'parent'], 'index', 'object'], | ||
'pathGroupsExcludedImportTypes': ['builtin'], | ||
'newlines-between': 'always', | ||
'alphabetize': { | ||
order: 'asc', | ||
caseInsensitive: true, | ||
}, | ||
}, | ||
], | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.ts', '.jsx', '.tsx'], | ||
}, | ||
}, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['playground/**/*.ts'], | ||
rules: { | ||
'import/no-extraneous-dependencies': ['off'], | ||
}, | ||
}, | ||
rules: { | ||
'@typescript-eslint/member-delimiter-style': ['off'], | ||
'@typescript-eslint/ban-ts-ignore': ['off'] | ||
} | ||
}; | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node: [18, 20] | ||
|
||
name: Build (node v${{ matrix.node }}) | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install | ||
run: npm install | ||
|
||
- name: lint | ||
run: npm run lint | ||
|
||
- name: typecheck | ||
run: npx tsc --noEmit |
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
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,11 @@ | ||
printWidth: 120 | ||
tabWidth: 2 | ||
useTabs: false | ||
semi: true | ||
singleQuote: true | ||
trailingComma: all | ||
bracketSpacing: true | ||
bracketSameLine: false | ||
arrowParens: always | ||
quoteProps: consistent | ||
endOfLine: lf |
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 @@ | ||
nodejs 18.18.0 |
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,17 @@ | ||
{ | ||
"editor.tabSize": 2, | ||
"editor.insertSpaces": true, | ||
"editor.formatOnSave": true, | ||
"editor.trimAutoWhitespace": true, | ||
"files.insertFinalNewline": true, | ||
"files.encoding": "utf8", | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"typescript.preferences.importModuleSpecifier": "relative", | ||
"prettier.prettierPath": "./node_modules/prettier" | ||
} |
Oops, something went wrong.