From f25d2597796408b546c65081782f6a325fdbe5d7 Mon Sep 17 00:00:00 2001 From: AyushNautiyalDeveloper Date: Sun, 21 Apr 2024 20:41:45 +0530 Subject: [PATCH] fixed the eslintrc file. --- .eslintignore | 4 +- .eslintrc | 134 ------------------------------------ .eslintrc.js | 10 --- apps/parser/.eslintignore | 11 +++ apps/parser/.eslintrc | 131 +++++++++++++++++++++++++++++++++++ apps/parser/src/iterator.ts | 2 +- package.json | 11 +-- tsconfig.json | 3 - turbo.json | 4 +- 9 files changed, 155 insertions(+), 155 deletions(-) delete mode 100644 .eslintrc delete mode 100644 .eslintrc.js create mode 100644 apps/parser/.eslintignore create mode 100644 apps/parser/.eslintrc delete mode 100644 tsconfig.json diff --git a/.eslintignore b/.eslintignore index 329c07896..2fb12ca0f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,4 +6,6 @@ node_modules /lib /esm /cjs -/browser \ No newline at end of file +/browser +esm +cjs diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 6ddc11a44..000000000 --- a/.eslintrc +++ /dev/null @@ -1,134 +0,0 @@ -parser: "@typescript-eslint/parser" - -env: - node: true - es6: true - jest: true - mocha: true - browser: true - -plugins: - - "@typescript-eslint" - - sonarjs - - security - - github - -extends: - - eslint:recommended - - plugin:@typescript-eslint/eslint-recommended - - plugin:@typescript-eslint/recommended - - plugin:sonarjs/recommended - - plugin:security/recommended - -parserOptions: - ecmaVersion: 2018 - -rules: - # Ignore Rules - strict: 0 - no-underscore-dangle: 0 - no-mixed-requires: 0 - no-process-exit: 0 - no-warning-comments: 0 - no-use-before-define: 0 - curly: 0 - no-multi-spaces: 0 - no-alert: 0 - consistent-return: 0 - consistent-this: [0, self] - func-style: 0 - max-nested-callbacks: 0 - camelcase: 0 - no-dupe-class-members: 0 - security/detect-object-injection: 0 - sonarjs/no-small-switch: 0 - sonarjs/no-nested-template-literals: 0 - - # Warnings - no-debugger: 1 - no-empty: 1 - no-invalid-regexp: 1 - no-unused-expressions: 1 - no-native-reassign: 1 - no-fallthrough: 1 - sonarjs/cognitive-complexity: 1 - - # Errors - eqeqeq: 2 - no-undef: 2 - no-dupe-keys: 2 - no-empty-character-class: 2 - no-self-compare: 2 - valid-typeof: 2 - handle-callback-err: 2 - no-shadow-restricted-names: 2 - no-new-require: 2 - no-mixed-spaces-and-tabs: 2 - block-scoped-var: 2 - no-else-return: 2 - no-throw-literal: 2 - no-void: 2 - radix: 2 - wrap-iife: [2, outside] - no-shadow: 0 - no-path-concat: 2 - valid-jsdoc: [0, {requireReturn: false, requireParamDescription: false, requireReturnDescription: false}] - - # stylistic errors - no-spaced-func: 2 - semi-spacing: 2 - quotes: [2, 'single'] - key-spacing: [2, { beforeColon: false, afterColon: true }] - indent: [2, 2] - no-lonely-if: 2 - no-floating-decimal: 2 - brace-style: [2, 1tbs, { allowSingleLine: true }] - comma-style: [2, last] - no-multiple-empty-lines: [2, {max: 1}] - no-nested-ternary: 2 - operator-assignment: [2, always] - padded-blocks: [2, never] - quote-props: [2, as-needed] - keyword-spacing: [2, {'before': true, 'after': true, 'overrides': {}}] - space-before-blocks: [2, always] - array-bracket-spacing: [2, never] - computed-property-spacing: [2, never] - space-in-parens: [2, never] - space-unary-ops: [2, {words: true, nonwords: false}] - wrap-regex: 2 - linebreak-style: 0 - semi: [2, always] - arrow-spacing: [2, {before: true, after: true}] - no-class-assign: 2 - no-const-assign: 2 - no-this-before-super: 2 - no-var: 2 - object-shorthand: [2, always] - prefer-arrow-callback: 2 - prefer-const: 2 - prefer-spread: 2 - prefer-template: 2 - - # TypeScript - "@typescript-eslint/no-empty-interface": "off" - "@typescript-eslint/no-use-before-define": ["off"] - "@typescript-eslint/no-empty-function": "off" - "@typescript-eslint/ban-ts-comment": "off" - "@typescript-eslint/no-explicit-any": "off" - "@typescript-eslint/explicit-module-boundary-types": "off" - "@typescript-eslint/no-this-alias": "off" - "@typescript-eslint/no-unnecessary-type-constraint": "off" - "@typescript-eslint/ban-types": "off" - -overrides: - - files: - - "test/**" - - "*.spec.ts" - - "*.test.ts" - rules: - prefer-arrow-callback: 0 - sonarjs/no-duplicate-string: 0 - security/detect-object-injection: 0 - security/detect-non-literal-fs-filename: 0 - "@typescript-eslint/no-non-null-assertion": 0 - "@typescript-eslint/no-unused-vars": 0 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index e928b8686..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -// This configuration only applies to the package manager root. -/** @type {import("eslint").Linter.Config} */ -module.exports = { - ignorePatterns: ["apps/**", "packages/**"], - extends: ["@repo/eslint-config/library.js"], - parser: "@typescript-eslint/parser", - parserOptions: { - project: true, - }, -}; diff --git a/apps/parser/.eslintignore b/apps/parser/.eslintignore new file mode 100644 index 000000000..2fb12ca0f --- /dev/null +++ b/apps/parser/.eslintignore @@ -0,0 +1,11 @@ +node_modules +.vscode +.DS_Store +/docs +/coverage +/lib +/esm +/cjs +/browser +esm +cjs diff --git a/apps/parser/.eslintrc b/apps/parser/.eslintrc new file mode 100644 index 000000000..2fe1b8bc2 --- /dev/null +++ b/apps/parser/.eslintrc @@ -0,0 +1,131 @@ +{ + "parser": "@typescript-eslint/parser", + "env": { + "node": true, + "es6": true, + "jest": true, + "mocha": true, + "browser": true + }, + "plugins": [ + "@typescript-eslint", + "sonarjs", + "security", + "github" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:sonarjs/recommended", + "plugin:security/recommended" + ], + "parserOptions": { + "ecmaVersion": 2018 + }, + "rules": { + "strict": 0, + "no-underscore-dangle": 0, + "no-mixed-requires": 0, + "no-process-exit": 0, + "no-warning-comments": 0, + "no-use-before-define": 0, + "curly": 0, + "no-multi-spaces": 0, + "no-alert": 0, + "consistent-return": 0, + "consistent-this": [0, "self"], + "func-style": 0, + "max-nested-callbacks": 0, + "camelcase": 0, + "no-dupe-class-members": 0, + "security/detect-object-injection": 0, + "sonarjs/no-small-switch": 0, + "sonarjs/no-nested-template-literals": 0, + "no-debugger": 1, + "no-empty": 1, + "no-invalid-regexp": 1, + "no-unused-expressions": 1, + "no-native-reassign": 1, + "no-fallthrough": 1, + "sonarjs/cognitive-complexity": 1, + "eqeqeq": 2, + "no-undef": 2, + "no-dupe-keys": 2, + "no-empty-character-class": 2, + "no-self-compare": 2, + "valid-typeof": 2, + "handle-callback-err": 2, + "no-shadow-restricted-names": 2, + "no-new-require": 2, + "no-mixed-spaces-and-tabs": 2, + "block-scoped-var": 2, + "no-else-return": 2, + "no-throw-literal": 2, + "no-void": 2, + "radix": 2, + "wrap-iife": [2, "outside"], + "no-shadow": 0, + "no-path-concat": 2, + "valid-jsdoc": [0, {"requireReturn": false, "requireParamDescription": false, "requireReturnDescription": false}], + "no-spaced-func": 2, + "semi-spacing": 2, + "quotes": [2, "single"], + "key-spacing": [2, {"beforeColon": false, "afterColon": true}], + "indent": [2, 2], + "no-lonely-if": 2, + "no-floating-decimal": 2, + "brace-style": [2, "1tbs", {"allowSingleLine": true}], + "comma-style": [2, "last"], + "no-multiple-empty-lines": [2, {"max": 1}], + "no-nested-ternary": 2, + "operator-assignment": [2, "always"], + "padded-blocks": [2, "never"], + "quote-props": [2, "as-needed"], + "keyword-spacing": [2, {"before": true, "after": true, "overrides": {}}], + "space-before-blocks": [2, "always"], + "array-bracket-spacing": [2, "never"], + "computed-property-spacing": [2, "never"], + "space-in-parens": [2, "never"], + "space-unary-ops": [2, {"words": true, "nonwords": false}], + "wrap-regex": 2, + "linebreak-style": 0, + "semi": [2, "always"], + "arrow-spacing": [2, {"before": true, "after": true}], + "no-class-assign": 2, + "no-const-assign": 2, + "no-this-before-super": 2, + "no-var": 2, + "object-shorthand": [2, "always"], + "prefer-arrow-callback": 2, + "prefer-const": 2, + "prefer-spread": 2, + "prefer-template": 2, + "@typescript-eslint/no-empty-interface": "off", + "@typescript-eslint/no-use-before-define": ["off"], + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-this-alias": "off", + "@typescript-eslint/no-unnecessary-type-constraint": "off", + "@typescript-eslint/ban-types": "off" + }, + "overrides": [ + { + "files": [ + "test/**", + "*.spec.ts", + "*.test.ts" + ], + "rules": { + "prefer-arrow-callback": 0, + "sonarjs/no-duplicate-string": 0, + "security/detect-object-injection": 0, + "security/detect-non-literal-fs-filename": 0, + "@typescript-eslint/no-non-null-assertion": 0, + "@typescript-eslint/no-unused-vars": 0 + } + } + ] +} diff --git a/apps/parser/src/iterator.ts b/apps/parser/src/iterator.ts index b6b2eb1f3..25c5bee78 100644 --- a/apps/parser/src/iterator.ts +++ b/apps/parser/src/iterator.ts @@ -246,4 +246,4 @@ function traverseMessageTrait(messageTrait: MessageTraitInterface, options: Trav if (schemaTypesToIterate.includes(SchemaTypesToIterate.Headers) && messageTrait.hasHeaders()) { traverseSchema(messageTrait.headers() as SchemaInterface, null, options); } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 307e06314..b777c5893 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,13 @@ "private": true, "scripts": { "test": "turbo run test", - "lint":"turbo run lint", + "lint": "turbo run lint", + "lint:fix": "turbo run lint:fix", "build": "turbo run build", - "parser:test:unit":"turbo run test:unit --filter=@asyncapi/parser", - "parser:test":"turbo run test --filter=@asyncapi/parser", - "parser:test:browser":"turbo run test:browser --filter=@asyncapi/parser", - "parser:build":"turbo run build --filter=@asyncapi/parser" + "parser:test:unit": "turbo run test:unit --filter=@asyncapi/parser", + "parser:test": "turbo run test --filter=@asyncapi/parser", + "parser:test:browser": "turbo run test:browser --filter=@asyncapi/parser", + "parser:build": "turbo run build --filter=@asyncapi/parser" }, "devDependencies": { "@repo/eslint-config": "*", diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index c8a018d0f..000000000 --- a/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@repo/typescript-config/base.json" -} diff --git a/turbo.json b/turbo.json index 55e85d89d..2c2fa1430 100644 --- a/turbo.json +++ b/turbo.json @@ -8,6 +8,8 @@ "test": {}, "test:unit": {}, "test:integration": {}, - "test:browser":{} + "test:browser": {}, + "lint": {}, + "lint:fix": {} } }