From d28e9d909b4e1aa9059c668453da7d8dc2f0b6f0 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 14 Feb 2020 12:45:20 +0400 Subject: feat(project): Refactoring directories Signed-off-by: Valentin Popov --- src/javascript.ts | 12 +- src/rules/default.json | 610 --------------------------------- src/rules/eslint-comments.json | 1 - src/rules/eslint-comments/default.json | 1 + src/rules/import.json | 17 - src/rules/import/default.json | 17 + src/rules/javascript/default.json | 610 +++++++++++++++++++++++++++++++++ src/rules/security.json | 1 - src/rules/security/default.json | 1 + src/rules/sonarjs.json | 1 - src/rules/sonarjs/default.json | 1 + src/rules/unicorn.json | 1 - src/rules/unicorn/default.json | 1 + 13 files changed, 637 insertions(+), 637 deletions(-) delete mode 100644 src/rules/default.json delete mode 100644 src/rules/eslint-comments.json create mode 100644 src/rules/eslint-comments/default.json delete mode 100644 src/rules/import.json create mode 100644 src/rules/import/default.json create mode 100644 src/rules/javascript/default.json delete mode 100644 src/rules/security.json create mode 100644 src/rules/security/default.json delete mode 100644 src/rules/sonarjs.json create mode 100644 src/rules/sonarjs/default.json delete mode 100644 src/rules/unicorn.json create mode 100644 src/rules/unicorn/default.json (limited to 'src') diff --git a/src/javascript.ts b/src/javascript.ts index 294380e..bd02c45 100644 --- a/src/javascript.ts +++ b/src/javascript.ts @@ -1,9 +1,9 @@ -import rComments from "./rules/eslint-comments.json"; -import rDefault from "./rules/default.json"; -import rImport from "./rules/import.json"; -import rSecurity from "./rules/security.json"; -import rSonarJS from "./rules/sonarjs.json"; -import rUnicorn from "./rules/unicorn.json"; +import rComments from "./rules/eslint-comments/default.json"; +import rDefault from "./rules/javascript/default.json"; +import rImport from "./rules/import/default.json"; +import rSecurity from "./rules/security/default.json"; +import rSonarJS from "./rules/sonarjs/default.json"; +import rUnicorn from "./rules/unicorn/default.json"; module.exports = { "extends": [ diff --git a/src/rules/default.json b/src/rules/default.json deleted file mode 100644 index 8f30d7e..0000000 --- a/src/rules/default.json +++ /dev/null @@ -1,610 +0,0 @@ -{ - "array-callback-return": [ - "error", - { - "allowImplicit": false - } - ], - "arrow-parens": [ - "error", - "always" - ], - "arrow-spacing": [ - "error", - { - "after": true, - "before": true - } - ], - "brace-style": [ - "error", - "1tbs", - { - "allowSingleLine": false - } - ], - "callback-return": [ - "warn" - ], - "camelcase": [ - "error", - { - "allow": [ - "^UNSAFE_" - ], - "ignoreDestructuring": true, - "ignoreImports": false, - "properties": "always" - } - ], - "class-methods-use-this": [ - "warn" - ], - "comma-dangle": [ - "error", - "always-multiline" - ], - "comma-spacing": [ - "error", - { - "after": true, - "before": false - } - ], - "comma-style": [ - "error", - "last", - { - "exceptions": {} - } - ], - "curly": [ - "error", - "all" - ], - "dot-notation": [ - "error", - { - "allowKeywords": true - } - ], - "eol-last": [ - "error", - "always" - ], - "eqeqeq": [ - "error", - "always" - ], - "function-call-argument-newline": [ - "error", - "consistent" - ], - "handle-callback-err": [ - "error" - ], - "id-length": [ - "warn", - { - "max": 32, - "min": 2, - "properties": "always" - } - ], - "indent": [ - "error", - "tab", - { - "ArrayExpression": 1, - "CallExpression": { - "arguments": 1 - }, - "FunctionDeclaration": { - "body": 1, - "parameters": 1 - }, - "FunctionExpression": { - "body": 1, - "parameters": 1 - }, - "ImportDeclaration": 1, - "MemberExpression": 1, - "ObjectExpression": 1, - "SwitchCase": 1, - "VariableDeclarator": "first", - "flatTernaryExpressions": true, - "ignoreComments": false, - "ignoredNodes": [], - "outerIIFEBody": 1 - } - ], - "indent-legacy": [ - "off" - ], - "key-spacing": [ - "error", - { - "afterColon": true, - "beforeColon": false, - "mode": "strict" - } - ], - "keyword-spacing": [ - "error", - { - "after": true, - "before": true - } - ], - "linebreak-style": [ - "error", - "unix" - ], - "lines-around-comment": [ - "error", - { - "afterBlockComment": false, - "afterLineComment": false, - "allowArrayEnd": false, - "allowArrayStart": true, - "allowBlockEnd": false, - "allowBlockStart": true, - "allowClassEnd": false, - "allowClassStart": true, - "allowObjectEnd": false, - "allowObjectStart": true, - "beforeBlockComment": true, - "beforeLineComment": false - } - ], - "lines-around-directive": [ - "off" - ], - "lines-between-class-members": [ - "error", - "always", - { - "exceptAfterSingleLine": false - } - ], - "max-len": [ - "warn", - { - "code": 180, - "comments": 72, - "ignoreComments": false, - "ignoreRegExpLiterals": false, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreTrailingComments": false, - "ignoreUrls": true, - "tabWidth": 4 - } - ], - "max-lines": [ - "off" - ], - "max-lines-per-function": [ - "warn", - { - "IIFEs": false, - "max": 128, - "skipBlankLines": true, - "skipComments": true - } - ], - "max-statements": [ - "off" - ], - "multiline-comment-style": [ - "error", - "starred-block" - ], - "new-cap": [ - "error", - { - "capIsNew": true, - "newIsCap": true, - "properties": false - } - ], - "newline-after-var": [ - "off" - ], - "newline-before-return": [ - "off" - ], - "no-alert": [ - "warn" - ], - "no-buffer-constructor": [ - "error" - ], - "no-caller": [ - "error" - ], - "no-catch-shadow": [ - "off" - ], - "no-console": [ - "warn" - ], - "no-constant-condition": [ - "error", - { - "checkLoops": true - } - ], - "no-debugger": [ - "warn" - ], - "no-duplicate-imports": [ - "error", - { - "includeExports": true - } - ], - "no-else-return": [ - "error", - { - "allowElseIf": false - } - ], - "no-empty": [ - "warn", - { - "allowEmptyCatch": false - } - ], - "no-eval": [ - "error", - { - "allowIndirect": false - } - ], - "no-extend-native": [ - "error" - ], - "no-extra-bind": [ - "error" - ], - "no-extra-semi": [ - "error" - ], - "no-implied-eval": [ - "error" - ], - "no-iterator": [ - "error" - ], - "no-labels": [ - "error" - ], - "no-lone-blocks": [ - "error" - ], - "no-magic-numbers": [ - "warn", - { - "detectObjects": false, - "enforceConst": true, - "ignoreArrayIndexes": false - } - ], - "no-mixed-spaces-and-tabs": [ - "error", - "smart-tabs" - ], - "no-multi-spaces": [ - "error", - { - "exceptions": {}, - "ignoreEOLComments": false - } - ], - "no-multi-str": [ - "error" - ], - "no-multiple-empty-lines": [ - "error", - { - "max": 1, - "maxBOF": 1, - "maxEOF": 1 - } - ], - "no-native-reassign": [ - "off" - ], - "no-negated-in-lhs": [ - "off" - ], - "no-nested-ternary": [ - "error" - ], - "no-new-func": [ - "error" - ], - "no-new-require": [ - "error" - ], - "no-new-wrappers": [ - "error" - ], - "no-octal-escape": [ - "error" - ], - "no-path-concat": [ - "error" - ], - "no-proto": [ - "error" - ], - "no-restricted-properties": [ - "error", - { - "message": "Use the exponentiation operator (**) instead of Math.pow()", - "object": "Math", - "property": "pow" - } - ], - "no-return-await": [ - "error" - ], - "no-script-url": [ - "error" - ], - "no-self-compare": [ - "error" - ], - "no-sequences": [ - "error" - ], - "no-spaced-func": [ - "off" - ], - "no-tabs": [ - "error", - { - "allowIndentationTabs": true - } - ], - "no-ternary": [ - "off" - ], - "no-undef-init": [ - "error" - ], - "no-undefined": [ - "off" - ], - "no-underscore-dangle": [ - "error", - { - "allowAfterSuper": false, - "allowAfterThis": true, - "allowAfterThisConstructor": false, - "enforceInMethodNames": false - } - ], - "no-unmodified-loop-condition": [ - "error" - ], - "no-unneeded-ternary": [ - "error", - { - "defaultAssignment": true - } - ], - "no-unused-vars": [ - "error", - { - "args": "after-used", - "caughtErrors": "all", - "ignoreRestSiblings": false, - "vars": "all" - } - ], - "no-use-before-define": [ - "error", - { - "classes": true, - "functions": true, - "variables": true - } - ], - "no-useless-call": [ - "error" - ], - "no-useless-computed-key": [ - "error", - { - "enforceForClassMembers": true - } - ], - "no-useless-constructor": [ - "error" - ], - "no-useless-rename": [ - "error", - { - "ignoreDestructuring": false, - "ignoreExport": false, - "ignoreImport": false - } - ], - "no-useless-return": [ - "error" - ], - "no-var": [ - "error" - ], - "no-with": [ - "error" - ], - "object-curly-newline": [ - "error", - { - "consistent": true, - "minProperties": 2, - "multiline": true - } - ], - "object-curly-spacing": [ - "error", - "always", - { - "arraysInObjects": false, - "objectsInObjects": false - } - ], - "object-property-newline": [ - "error", - { - "allowAllPropertiesOnSameLine": false - } - ], - "object-shorthand": [ - "error", - "consistent-as-needed" - ], - "one-var": [ - "error", - "never" - ], - "prefer-arrow-callback": [ - "error", - { - "allowNamedFunctions": false, - "allowUnboundThis": false - } - ], - "prefer-const": [ - "error", - { - "destructuring": "any", - "ignoreReadBeforeAssign": false - } - ], - "prefer-numeric-literals": [ - "error" - ], - "prefer-object-spread": [ - "error" - ], - "prefer-reflect": [ - "off" - ], - "prefer-rest-params": [ - "error" - ], - "prefer-spread": [ - "error" - ], - "prefer-template": [ - "error" - ], - "quote-props": [ - "error", - "consistent-as-needed", - { - "keywords": true, - "numbers": true, - "unnecessary": true - } - ], - "quotes": [ - "error", - "double", - { - "allowTemplateLiterals": false, - "avoidEscape": false - } - ], - "require-await": [ - "warn" - ], - "require-jsdoc": [ - "off" - ], - "semi": [ - "error", - "always", - { - "omitLastInOneLineBlock": false - } - ], - "semi-spacing": [ - "error", - { - "after": true, - "before": false - } - ], - "semi-style": [ - "error", - "last" - ], - "sort-imports": [ - "error", - { - "ignoreCase": false, - "ignoreDeclarationSort": true, - "ignoreMemberSort": false, - "memberSyntaxSortOrder": [ - "all", - "multiple", - "single", - "none" - ] - } - ], - "sort-keys": [ - "warn", - "asc", - { - "caseSensitive": true, - "minKeys": 2, - "natural": true - } - ], - "sort-vars": [ - "error", - { - "ignoreCase": false - } - ], - "space-before-blocks": [ - "error", - "always" - ], - "space-before-function-paren": [ - "error", - { - "anonymous": "always", - "asyncArrow": "always", - "named": "never" - } - ], - "strict": [ - "error", - "safe" - ], - "valid-jsdoc": [ - "off" - ], - "valid-typeof": [ - "error", - { - "requireStringLiterals": true - } - ], - "yoda": [ - "error", - "never", - { - "exceptRange": false, - "onlyEquality": false - } - ] -} diff --git a/src/rules/eslint-comments.json b/src/rules/eslint-comments.json deleted file mode 100644 index 0967ef4..0000000 --- a/src/rules/eslint-comments.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/rules/eslint-comments/default.json b/src/rules/eslint-comments/default.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/src/rules/eslint-comments/default.json @@ -0,0 +1 @@ +{} diff --git a/src/rules/import.json b/src/rules/import.json deleted file mode 100644 index 77ec282..0000000 --- a/src/rules/import.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "import/exports-last": [ - "error" - ], - "import/first": [ - "error" - ], - "import/newline-after-import": [ - "error", - { - "count": 1 - } - ], - "import/no-webpack-loader-syntax": [ - "error" - ] -} diff --git a/src/rules/import/default.json b/src/rules/import/default.json new file mode 100644 index 0000000..77ec282 --- /dev/null +++ b/src/rules/import/default.json @@ -0,0 +1,17 @@ +{ + "import/exports-last": [ + "error" + ], + "import/first": [ + "error" + ], + "import/newline-after-import": [ + "error", + { + "count": 1 + } + ], + "import/no-webpack-loader-syntax": [ + "error" + ] +} diff --git a/src/rules/javascript/default.json b/src/rules/javascript/default.json new file mode 100644 index 0000000..8f30d7e --- /dev/null +++ b/src/rules/javascript/default.json @@ -0,0 +1,610 @@ +{ + "array-callback-return": [ + "error", + { + "allowImplicit": false + } + ], + "arrow-parens": [ + "error", + "always" + ], + "arrow-spacing": [ + "error", + { + "after": true, + "before": true + } + ], + "brace-style": [ + "error", + "1tbs", + { + "allowSingleLine": false + } + ], + "callback-return": [ + "warn" + ], + "camelcase": [ + "error", + { + "allow": [ + "^UNSAFE_" + ], + "ignoreDestructuring": true, + "ignoreImports": false, + "properties": "always" + } + ], + "class-methods-use-this": [ + "warn" + ], + "comma-dangle": [ + "error", + "always-multiline" + ], + "comma-spacing": [ + "error", + { + "after": true, + "before": false + } + ], + "comma-style": [ + "error", + "last", + { + "exceptions": {} + } + ], + "curly": [ + "error", + "all" + ], + "dot-notation": [ + "error", + { + "allowKeywords": true + } + ], + "eol-last": [ + "error", + "always" + ], + "eqeqeq": [ + "error", + "always" + ], + "function-call-argument-newline": [ + "error", + "consistent" + ], + "handle-callback-err": [ + "error" + ], + "id-length": [ + "warn", + { + "max": 32, + "min": 2, + "properties": "always" + } + ], + "indent": [ + "error", + "tab", + { + "ArrayExpression": 1, + "CallExpression": { + "arguments": 1 + }, + "FunctionDeclaration": { + "body": 1, + "parameters": 1 + }, + "FunctionExpression": { + "body": 1, + "parameters": 1 + }, + "ImportDeclaration": 1, + "MemberExpression": 1, + "ObjectExpression": 1, + "SwitchCase": 1, + "VariableDeclarator": "first", + "flatTernaryExpressions": true, + "ignoreComments": false, + "ignoredNodes": [], + "outerIIFEBody": 1 + } + ], + "indent-legacy": [ + "off" + ], + "key-spacing": [ + "error", + { + "afterColon": true, + "beforeColon": false, + "mode": "strict" + } + ], + "keyword-spacing": [ + "error", + { + "after": true, + "before": true + } + ], + "linebreak-style": [ + "error", + "unix" + ], + "lines-around-comment": [ + "error", + { + "afterBlockComment": false, + "afterLineComment": false, + "allowArrayEnd": false, + "allowArrayStart": true, + "allowBlockEnd": false, + "allowBlockStart": true, + "allowClassEnd": false, + "allowClassStart": true, + "allowObjectEnd": false, + "allowObjectStart": true, + "beforeBlockComment": true, + "beforeLineComment": false + } + ], + "lines-around-directive": [ + "off" + ], + "lines-between-class-members": [ + "error", + "always", + { + "exceptAfterSingleLine": false + } + ], + "max-len": [ + "warn", + { + "code": 180, + "comments": 72, + "ignoreComments": false, + "ignoreRegExpLiterals": false, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreTrailingComments": false, + "ignoreUrls": true, + "tabWidth": 4 + } + ], + "max-lines": [ + "off" + ], + "max-lines-per-function": [ + "warn", + { + "IIFEs": false, + "max": 128, + "skipBlankLines": true, + "skipComments": true + } + ], + "max-statements": [ + "off" + ], + "multiline-comment-style": [ + "error", + "starred-block" + ], + "new-cap": [ + "error", + { + "capIsNew": true, + "newIsCap": true, + "properties": false + } + ], + "newline-after-var": [ + "off" + ], + "newline-before-return": [ + "off" + ], + "no-alert": [ + "warn" + ], + "no-buffer-constructor": [ + "error" + ], + "no-caller": [ + "error" + ], + "no-catch-shadow": [ + "off" + ], + "no-console": [ + "warn" + ], + "no-constant-condition": [ + "error", + { + "checkLoops": true + } + ], + "no-debugger": [ + "warn" + ], + "no-duplicate-imports": [ + "error", + { + "includeExports": true + } + ], + "no-else-return": [ + "error", + { + "allowElseIf": false + } + ], + "no-empty": [ + "warn", + { + "allowEmptyCatch": false + } + ], + "no-eval": [ + "error", + { + "allowIndirect": false + } + ], + "no-extend-native": [ + "error" + ], + "no-extra-bind": [ + "error" + ], + "no-extra-semi": [ + "error" + ], + "no-implied-eval": [ + "error" + ], + "no-iterator": [ + "error" + ], + "no-labels": [ + "error" + ], + "no-lone-blocks": [ + "error" + ], + "no-magic-numbers": [ + "warn", + { + "detectObjects": false, + "enforceConst": true, + "ignoreArrayIndexes": false + } + ], + "no-mixed-spaces-and-tabs": [ + "error", + "smart-tabs" + ], + "no-multi-spaces": [ + "error", + { + "exceptions": {}, + "ignoreEOLComments": false + } + ], + "no-multi-str": [ + "error" + ], + "no-multiple-empty-lines": [ + "error", + { + "max": 1, + "maxBOF": 1, + "maxEOF": 1 + } + ], + "no-native-reassign": [ + "off" + ], + "no-negated-in-lhs": [ + "off" + ], + "no-nested-ternary": [ + "error" + ], + "no-new-func": [ + "error" + ], + "no-new-require": [ + "error" + ], + "no-new-wrappers": [ + "error" + ], + "no-octal-escape": [ + "error" + ], + "no-path-concat": [ + "error" + ], + "no-proto": [ + "error" + ], + "no-restricted-properties": [ + "error", + { + "message": "Use the exponentiation operator (**) instead of Math.pow()", + "object": "Math", + "property": "pow" + } + ], + "no-return-await": [ + "error" + ], + "no-script-url": [ + "error" + ], + "no-self-compare": [ + "error" + ], + "no-sequences": [ + "error" + ], + "no-spaced-func": [ + "off" + ], + "no-tabs": [ + "error", + { + "allowIndentationTabs": true + } + ], + "no-ternary": [ + "off" + ], + "no-undef-init": [ + "error" + ], + "no-undefined": [ + "off" + ], + "no-underscore-dangle": [ + "error", + { + "allowAfterSuper": false, + "allowAfterThis": true, + "allowAfterThisConstructor": false, + "enforceInMethodNames": false + } + ], + "no-unmodified-loop-condition": [ + "error" + ], + "no-unneeded-ternary": [ + "error", + { + "defaultAssignment": true + } + ], + "no-unused-vars": [ + "error", + { + "args": "after-used", + "caughtErrors": "all", + "ignoreRestSiblings": false, + "vars": "all" + } + ], + "no-use-before-define": [ + "error", + { + "classes": true, + "functions": true, + "variables": true + } + ], + "no-useless-call": [ + "error" + ], + "no-useless-computed-key": [ + "error", + { + "enforceForClassMembers": true + } + ], + "no-useless-constructor": [ + "error" + ], + "no-useless-rename": [ + "error", + { + "ignoreDestructuring": false, + "ignoreExport": false, + "ignoreImport": false + } + ], + "no-useless-return": [ + "error" + ], + "no-var": [ + "error" + ], + "no-with": [ + "error" + ], + "object-curly-newline": [ + "error", + { + "consistent": true, + "minProperties": 2, + "multiline": true + } + ], + "object-curly-spacing": [ + "error", + "always", + { + "arraysInObjects": false, + "objectsInObjects": false + } + ], + "object-property-newline": [ + "error", + { + "allowAllPropertiesOnSameLine": false + } + ], + "object-shorthand": [ + "error", + "consistent-as-needed" + ], + "one-var": [ + "error", + "never" + ], + "prefer-arrow-callback": [ + "error", + { + "allowNamedFunctions": false, + "allowUnboundThis": false + } + ], + "prefer-const": [ + "error", + { + "destructuring": "any", + "ignoreReadBeforeAssign": false + } + ], + "prefer-numeric-literals": [ + "error" + ], + "prefer-object-spread": [ + "error" + ], + "prefer-reflect": [ + "off" + ], + "prefer-rest-params": [ + "error" + ], + "prefer-spread": [ + "error" + ], + "prefer-template": [ + "error" + ], + "quote-props": [ + "error", + "consistent-as-needed", + { + "keywords": true, + "numbers": true, + "unnecessary": true + } + ], + "quotes": [ + "error", + "double", + { + "allowTemplateLiterals": false, + "avoidEscape": false + } + ], + "require-await": [ + "warn" + ], + "require-jsdoc": [ + "off" + ], + "semi": [ + "error", + "always", + { + "omitLastInOneLineBlock": false + } + ], + "semi-spacing": [ + "error", + { + "after": true, + "before": false + } + ], + "semi-style": [ + "error", + "last" + ], + "sort-imports": [ + "error", + { + "ignoreCase": false, + "ignoreDeclarationSort": true, + "ignoreMemberSort": false, + "memberSyntaxSortOrder": [ + "all", + "multiple", + "single", + "none" + ] + } + ], + "sort-keys": [ + "warn", + "asc", + { + "caseSensitive": true, + "minKeys": 2, + "natural": true + } + ], + "sort-vars": [ + "error", + { + "ignoreCase": false + } + ], + "space-before-blocks": [ + "error", + "always" + ], + "space-before-function-paren": [ + "error", + { + "anonymous": "always", + "asyncArrow": "always", + "named": "never" + } + ], + "strict": [ + "error", + "safe" + ], + "valid-jsdoc": [ + "off" + ], + "valid-typeof": [ + "error", + { + "requireStringLiterals": true + } + ], + "yoda": [ + "error", + "never", + { + "exceptRange": false, + "onlyEquality": false + } + ] +} diff --git a/src/rules/security.json b/src/rules/security.json deleted file mode 100644 index 0967ef4..0000000 --- a/src/rules/security.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/rules/security/default.json b/src/rules/security/default.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/src/rules/security/default.json @@ -0,0 +1 @@ +{} diff --git a/src/rules/sonarjs.json b/src/rules/sonarjs.json deleted file mode 100644 index 0967ef4..0000000 --- a/src/rules/sonarjs.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/rules/sonarjs/default.json b/src/rules/sonarjs/default.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/src/rules/sonarjs/default.json @@ -0,0 +1 @@ +{} diff --git a/src/rules/unicorn.json b/src/rules/unicorn.json deleted file mode 100644 index 0967ef4..0000000 --- a/src/rules/unicorn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/rules/unicorn/default.json b/src/rules/unicorn/default.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/src/rules/unicorn/default.json @@ -0,0 +1 @@ +{} -- cgit v1.2.3