Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
fmvilas committed Oct 28, 2024
1 parent 2421410 commit 7e11e78
Show file tree
Hide file tree
Showing 38 changed files with 564 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/gleequore/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default class GleeQuore {
* @param {String} [clusterName] The name of the cluster.
* @param {String} [clusterURL] The URL of the cluster.
*/
setClusterAdapter(Adapter: typeof GleeQuoreClusterAdapter, clusterName: string = 'cluster', clusterURL: string) {
setClusterAdapter(Adapter: typeof GleeQuoreClusterAdapter, clusterName = 'cluster', clusterURL: string) {
this._clusterAdapter = {
Adapter,
clusterName,
Expand Down Expand Up @@ -641,6 +641,6 @@ export default class GleeQuore {

async getSelectedServerNames(): Promise<string[]> {
const serverNames = this._adapters.map(a => a.serverName).filter(Boolean)
return [...new Set(serverNames)]; // Dedupe the array
return [...new Set(serverNames)] // Dedupe the array
}
}
2 changes: 1 addition & 1 deletion packages/gleequore/src/lib/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class GleeQuoreAdapter extends EventEmitter {
throw new Error('Method `send` is not implemented.')
}

validate(data: any, schema: object, triggerError: boolean = false) {
validate(data: any, schema: object, triggerError = false) {
const { isValid, errors, humanReadableError } = validateData(data, schema)
if (!isValid && triggerError) {
throw new GleeQuoreError({ humanReadableError, errors })
Expand Down
17 changes: 17 additions & 0 deletions packages/kafka-adapter/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig

root = true

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

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions packages/kafka-adapter/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
examples/social-network/frontend
examples/crypto-websockets
dist
.glee
test
jest.config.js
docs
try.js
53 changes: 53 additions & 0 deletions packages/kafka-adapter/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"sonarjs",
"security",
"github"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:sonarjs/recommended",
"plugin:security/recommended"
],
"rules": {
"curly": [
"error",
"multi-line"
],
"security/detect-non-literal-fs-filename": "off",
"@typescript-eslint/no-explicit-any": "off",
"semi": [
"warn",
"never"
],
"sonarjs/cognitive-complexity": "warn"
},
"globals": {
"process": "readonly"
},
"overrides": [
{
"files": [
"*.spec.ts",
"*.spec.tsx",
"src/help/command.ts"
],
"rules": {
"no-undef": "off",
"security/detect-non-literal-fs-filename": "off",
"sonarjs/no-duplicate-string": "off",
"security/detect-object-injection": "off",
"max-nested-callbacks": "off",
"sonarjs/no-identical-functions": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-use-before-define": "off",
"sonarjs/cognitive-complexity": "off"
}
}
]
}
6 changes: 6 additions & 0 deletions packages/kafka-adapter/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist
coverage
.github
examples
node_modules
docs
4 changes: 4 additions & 0 deletions packages/kafka-adapter/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
trailingComma: "es5"
tabWidth: 2
semi: false
singleQuote: true
17 changes: 17 additions & 0 deletions packages/mqtt-adapter/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig

root = true

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

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions packages/mqtt-adapter/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
examples/social-network/frontend
examples/crypto-websockets
dist
.glee
test
jest.config.js
docs
try.js
53 changes: 53 additions & 0 deletions packages/mqtt-adapter/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"sonarjs",
"security",
"github"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:sonarjs/recommended",
"plugin:security/recommended"
],
"rules": {
"curly": [
"error",
"multi-line"
],
"security/detect-non-literal-fs-filename": "off",
"@typescript-eslint/no-explicit-any": "off",
"semi": [
"warn",
"never"
],
"sonarjs/cognitive-complexity": "warn"
},
"globals": {
"process": "readonly"
},
"overrides": [
{
"files": [
"*.spec.ts",
"*.spec.tsx",
"src/help/command.ts"
],
"rules": {
"no-undef": "off",
"security/detect-non-literal-fs-filename": "off",
"sonarjs/no-duplicate-string": "off",
"security/detect-object-injection": "off",
"max-nested-callbacks": "off",
"sonarjs/no-identical-functions": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-use-before-define": "off",
"sonarjs/cognitive-complexity": "off"
}
}
]
}
6 changes: 6 additions & 0 deletions packages/mqtt-adapter/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist
coverage
.github
examples
node_modules
docs
4 changes: 4 additions & 0 deletions packages/mqtt-adapter/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
trailingComma: "es5"
tabWidth: 2
semi: false
singleQuote: true
17 changes: 17 additions & 0 deletions packages/redis-cluster-adapter/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig

root = true

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

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions packages/redis-cluster-adapter/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
examples/social-network/frontend
examples/crypto-websockets
dist
.glee
test
jest.config.js
docs
try.js
53 changes: 53 additions & 0 deletions packages/redis-cluster-adapter/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"sonarjs",
"security",
"github"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:sonarjs/recommended",
"plugin:security/recommended"
],
"rules": {
"curly": [
"error",
"multi-line"
],
"security/detect-non-literal-fs-filename": "off",
"@typescript-eslint/no-explicit-any": "off",
"semi": [
"warn",
"never"
],
"sonarjs/cognitive-complexity": "warn"
},
"globals": {
"process": "readonly"
},
"overrides": [
{
"files": [
"*.spec.ts",
"*.spec.tsx",
"src/help/command.ts"
],
"rules": {
"no-undef": "off",
"security/detect-non-literal-fs-filename": "off",
"sonarjs/no-duplicate-string": "off",
"security/detect-object-injection": "off",
"max-nested-callbacks": "off",
"sonarjs/no-identical-functions": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-use-before-define": "off",
"sonarjs/cognitive-complexity": "off"
}
}
]
}
6 changes: 6 additions & 0 deletions packages/redis-cluster-adapter/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist
coverage
.github
examples
node_modules
docs
4 changes: 4 additions & 0 deletions packages/redis-cluster-adapter/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
trailingComma: "es5"
tabWidth: 2
semi: false
singleQuote: true
2 changes: 1 addition & 1 deletion packages/shared-utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AsyncAPIDocumentInterface as AsyncAPIDocument, ChannelInterface, ChannelParameterInterface, MessagesInterface } from '@asyncapi/parser'
import { AsyncAPIDocumentInterface as AsyncAPIDocument, MessagesInterface } from '@asyncapi/parser'
import Ajv from 'ajv'
import betterAjvErrors from 'better-ajv-errors'
import { pathToRegexp } from 'path-to-regexp'
Expand Down
6 changes: 6 additions & 0 deletions packages/shared-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"path-to-regexp": "^6.2.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"eslint": "^8.6.0",
"eslint-plugin-github": "^4.3.5",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-sonarjs": "^0.19.0",
"typescript": "^4.5.4"
}
}
17 changes: 17 additions & 0 deletions packages/socket.io-adapter/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig

root = true

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

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions packages/socket.io-adapter/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
examples/social-network/frontend
examples/crypto-websockets
dist
.glee
test
jest.config.js
docs
try.js
Loading

0 comments on commit 7e11e78

Please sign in to comment.