Advertisement
xapu

Untitled

Aug 11th, 2021
1,198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 11.24 KB | None | 0 0
  1. module.exports = {
  2.   "root": true,
  3.   "env": {
  4.     "browser": true,
  5.     "es2020": true,
  6.     "node": true
  7.   },
  8.   "overrides": [
  9.     {
  10.       "files": ["*.ts"],
  11.       "extends": [
  12.         "eslint:recommended",
  13.         "plugin:@angular-eslint/recommended",
  14.         "plugin:@typescript-eslint/recommended",
  15.         "plugin:@typescript-eslint/recommended-requiring-type-checking"
  16.       ],
  17.       "parserOptions": {
  18.         "createDefaultProgram": true,
  19.         "project": "tsconfig.json",
  20.         "sourceType": "module"
  21.       },
  22.       "plugins": [
  23.         "@angular-eslint/eslint-plugin",
  24.         "eslint-plugin-import",
  25.         "eslint-plugin-prefer-arrow",
  26.         "eslint-plugin-unicorn",
  27.         "eslint-plugin-custom-rules"
  28.       ],
  29.       "rules": {
  30.         "@angular-eslint/component-selector": [
  31.           "error",
  32.           {
  33.             "type": "element",
  34.             "prefix": "app",
  35.             "style": "kebab-case"
  36.           }
  37.         ],
  38.         "@angular-eslint/contextual-decorator": "error",
  39.         "@angular-eslint/directive-selector": [
  40.           "error",
  41.           {
  42.             "type": "attribute",
  43.             "prefix": "app",
  44.             "style": "camelCase"
  45.           }
  46.         ],
  47.         "@angular-eslint/no-host-metadata-property": "off",
  48.         "@angular-eslint/no-lifecycle-call": "error",
  49.         "@angular-eslint/no-pipe-impure": "error",
  50.         "@angular-eslint/prefer-on-push-component-change-detection": "warn",
  51.         "@angular-eslint/relative-url-prefix": "warn",
  52.         "@angular-eslint/use-pipe-decorator": "error",
  53.  
  54.         "@typescript-eslint/array-type": "off",
  55.         "@typescript-eslint/ban-ts-comment": "off",
  56.         "@typescript-eslint/brace-style": "error",
  57.         "@typescript-eslint/comma-dangle": ["error", "always-multiline"],
  58.         "@typescript-eslint/comma-spacing": "error",
  59.         "@typescript-eslint/consistent-type-assertions": "error",
  60.         "@typescript-eslint/consistent-type-definitions": "error",
  61.         "@typescript-eslint/dot-notation": "off",
  62.         "@typescript-eslint/explicit-function-return-type": [
  63.           "error",
  64.           {
  65.             "allowExpressions": true
  66.           }
  67.         ],
  68.         "@typescript-eslint/explicit-member-accessibility": [
  69.           "error",
  70.           {
  71.             "accessibility": "no-public"
  72.           }
  73.         ],
  74.         "@typescript-eslint/explicit-module-boundary-types": [
  75.           "error",
  76.           {"allowArgumentsExplicitlyTypedAsAny": true}
  77.         ],
  78.         "@typescript-eslint/indent": ["error", 2],
  79.         "@typescript-eslint/keyword-spacing": "error",
  80.         "@typescript-eslint/member-delimiter-style": [
  81.           "error",
  82.           {
  83.             "multiline": {
  84.               "delimiter": "semi",
  85.               "requireLast": true
  86.             },
  87.             "singleline": {
  88.               "delimiter": "semi",
  89.               "requireLast": true
  90.             }
  91.           }
  92.         ],
  93.         "@typescript-eslint/member-ordering": "off",
  94.         "@typescript-eslint/method-signature-style": "error",
  95.         "@typescript-eslint/no-confusing-non-null-assertion": "error",
  96.         "@typescript-eslint/no-confusing-void-expression": "error",
  97.         "@typescript-eslint/no-dynamic-delete": "warn",
  98.         "@typescript-eslint/no-dupe-class-members": "error",
  99.         "@typescript-eslint/no-floating-promises": "off",
  100.         "@typescript-eslint/naming-convention": "warn",
  101.         "@typescript-eslint/no-extra-parens": "error",
  102.         "@typescript-eslint/no-invalid-void-type": "error",
  103.         "@typescript-eslint/no-parameter-properties": "off",
  104.         "@typescript-eslint/no-shadow": [
  105.           "error",
  106.           {
  107.             "hoist": "all"
  108.           }
  109.         ],
  110.         "@typescript-eslint/no-unnecessary-type-arguments": "error",
  111.         "@typescript-eslint/no-unnecessary-type-constraint": "error",
  112.         "@typescript-eslint/no-unused-expressions": [
  113.           "error",
  114.           {
  115.             "allowShortCircuit": true
  116.           }
  117.         ],
  118.         "@typescript-eslint/no-unused-vars": "warn",
  119.         "@typescript-eslint/no-use-before-define": "off",
  120.         "@typescript-eslint/no-useless-constructor": "error",
  121.         "@typescript-eslint/object-curly-spacing": "error",
  122.         "@typescript-eslint/prefer-for-of": "warn",
  123.         "@typescript-eslint/prefer-function-type": "error",
  124.         "@typescript-eslint/prefer-includes": "error",
  125.         "@typescript-eslint/prefer-nullish-coalescing": "error",
  126.         "@typescript-eslint/prefer-optional-chain": "error",
  127.         "@typescript-eslint/prefer-readonly": "error",
  128.         "@typescript-eslint/prefer-string-starts-ends-with": "error",
  129.         "@typescript-eslint/quotes": ["error", "single"],
  130.         "@typescript-eslint/semi": ["error", "always"],
  131.         "@typescript-eslint/type-annotation-spacing": "error",
  132.         "@typescript-eslint/unbound-method": ["warn", {"ignoreStatic": true}],
  133.         "@typescript-eslint/unified-signatures": "error",
  134.         "@typescript-eslint/no-unsafe-assignment": "off",
  135.         "@typescript-eslint/no-unsafe-call": "off",
  136.         "@typescript-eslint/no-unsafe-member-access": "off",
  137.         "@typescript-eslint/no-unsafe-return": "warn",
  138.  
  139.         "custom-rules/sort-class-members": [
  140.           "error",
  141.           {
  142.             "order": [
  143.               "static-properties",
  144.  
  145.               "inputs-properties",
  146.               "outputs-properties",
  147.  
  148.               "view-child-properties",
  149.               "view-children-properties",
  150.  
  151.               "content-child-properties",
  152.               "content-children-properties",
  153.  
  154.               "public-properties",
  155.               "protected-properties",
  156.               "private-properties",
  157.  
  158.               "constructor",
  159.               "ng-on-changes-method",
  160.               "ng-on-init-method",
  161.               "ng-do-check-method",
  162.               "ng-after-content-init-method",
  163.               "ng-after-content-checked-method",
  164.               "ng-after-view-init-method",
  165.               "ng-after-view-checked-method",
  166.               "ng-on-destroy-method",
  167.  
  168.               "public-methods",
  169.               "protected-methods",
  170.               "private-methods",
  171.               "static-methods",
  172.  
  173.               "readonly",
  174.               "read-write",
  175.  
  176.               "setter",
  177.               "getter"
  178.             ],
  179.             "groups": {
  180.               "inputs-properties": {"groupByDecorator": "Input"},
  181.               "outputs-properties": {"type": "property", "groupByDecorator": "Output"},
  182.               "view-child-properties": {"type": "property", "groupByDecorator": "ViewChild"},
  183.               "view-children-properties": {"type": "property", "groupByDecorator": "ViewChildren"},
  184.               "content-child-properties": {"type": "property", "groupByDecorator": "ContentChild"},
  185.               "content-children-properties": {"type": "property", "groupByDecorator": "ContentChildren"},
  186.               "ng-on-changes-method": {"type": "method", "name": "ngOnChanges"},
  187.               "ng-on-init-method": {"type": "method", "name": "ngOnInit"},
  188.               "ng-do-check-method": {"type": "method", "name": "ngDoCheck"},
  189.               "ng-after-content-init-method": {"type": "method", "name": "ngAfterContentInit"},
  190.               "ng-after-content-checked-method": {"type": "method", "name": "ngAfterContentChecked"},
  191.               "ng-after-view-init-method": {"type": "method", "name": "ngAfterViewInit"},
  192.               "ng-after-view-checked-method": {"type": "method", "name": "ngAfterViewChecked"},
  193.               "ng-on-destroy-method": {"type": "method", "name": "ngOnDestroy"},
  194.               "readonly": {"readonly": true},
  195.               "read-write": {"readonly": false}
  196.             }
  197.           }
  198.         ],
  199.  
  200.         "arrow-body-style": "error",
  201.         "arrow-parens": [
  202.           "error",
  203.           "as-needed"
  204.         ],
  205.         "brace-style": "off",
  206.         "comma-dangle": "off",
  207.         "comma-spacing": "off",
  208.         "complexity": "off",
  209.         "curly": "error",
  210.         "default-case": "error",
  211.         "eol-last": "error",
  212.         "eqeqeq": [
  213.           "error",
  214.           "smart"
  215.         ],
  216.         "guard-for-in": "off",
  217.         "import/newline-after-import": "error",
  218.         "import/no-default-export": "error",
  219.         "import/no-deprecated": "warn",
  220.         "import/order": [
  221.           "warn",
  222.           {
  223.             "alphabetize": {
  224.               "caseInsensitive": true,
  225.               "order": "asc"
  226.             },
  227.             "groups": ["builtin", "external", "parent", "sibling", "index"],
  228.             "newlines-between": "always-and-inside-groups"
  229.           }
  230.         ],
  231.         "indent": "off",
  232.         "keyword-spacing": "off",
  233.         "max-classes-per-file": "off",
  234.         "max-len": [
  235.           "warn",
  236.           {
  237.             "code": 140
  238.           }
  239.         ],
  240.         "new-parens": "error",
  241.         "no-bitwise": "error",
  242.         "no-caller": "error",
  243.         "no-console": [
  244.           "error",
  245.           {
  246.             "allow": ["error"]
  247.           }
  248.         ],
  249.         "no-dupe-class-members": "off",
  250.         "no-duplicate-imports": "error",
  251.         "no-eval": "error",
  252.         "no-extra-parens": "off",
  253.         "no-invalid-this": "error",
  254.         "no-multiple-empty-lines": ["error", {"max": 1}],
  255.         "no-nested-ternary": "off",
  256.         "no-new-func": "error",
  257.         "no-new-wrappers": "error",
  258.         "no-sequences": "error",
  259.         "no-shadow": "off",
  260.         "no-template-curly-in-string": "error",
  261.         "no-throw-literal": "error",
  262.         "no-trailing-spaces": "error",
  263.         "no-undef-init": "error",
  264.         "no-underscore-dangle": ["error", {"allowAfterThis": true}],
  265.         "no-unused-expressions": "off",
  266.         "no-useless-constructor": "off",
  267.         "no-void": "error",
  268.         "object-curly-spacing": "off",
  269.         "object-shorthand": "error",
  270.         "one-var": ["error", "never"],
  271.         "padding-line-between-statements": [
  272.           "error",
  273.           {
  274.             "blankLine": "always",
  275.             "prev": ["const", "let", "var"],
  276.             "next": "*"
  277.           },
  278.           {
  279.             "blankLine": "any",
  280.             "prev": ["const", "let", "var"],
  281.             "next": ["const", "let", "var"]
  282.           },
  283.           {
  284.             "blankLine": "always",
  285.             "prev": "*",
  286.             "next": "return"
  287.           }
  288.         ],
  289.         "prefer-arrow/prefer-arrow-functions": "error",
  290.         "prefer-object-spread": "error",
  291.         "prefer-template": "error",
  292.         "quotes": "off",
  293.         "quote-props": [
  294.           "error",
  295.           "as-needed"
  296.         ],
  297.         "radix": "error",
  298.         "semi": "off",
  299.         "space-before-function-paren": [
  300.           "error",
  301.           {
  302.             "anonymous": "never",
  303.             "asyncArrow": "always",
  304.             "named": "never"
  305.           }
  306.         ],
  307.         "spaced-comment": [
  308.           "error",
  309.           "always",
  310.           {
  311.             "markers": [
  312.               "/"
  313.             ]
  314.           }
  315.         ],
  316.         "unicorn/empty-brace-spaces": "error",
  317.         "unicorn/filename-case": "error",
  318.         "unicorn/no-nested-ternary": "error"
  319.       }
  320.     },
  321.     {
  322.       "files": ["*.html"],
  323.       "extends": [
  324.         "plugin:@angular-eslint/template/recommended"
  325.       ]
  326.     }
  327.   ]
  328. };
  329.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement