Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = {
- "root": true,
- "env": {
- "browser": true,
- "es2020": true,
- "node": true
- },
- "overrides": [
- {
- "files": ["*.ts"],
- "extends": [
- "eslint:recommended",
- "plugin:@angular-eslint/recommended",
- "plugin:@typescript-eslint/recommended",
- "plugin:@typescript-eslint/recommended-requiring-type-checking"
- ],
- "parserOptions": {
- "createDefaultProgram": true,
- "project": "tsconfig.json",
- "sourceType": "module"
- },
- "plugins": [
- "@angular-eslint/eslint-plugin",
- "eslint-plugin-import",
- "eslint-plugin-prefer-arrow",
- "eslint-plugin-unicorn",
- "eslint-plugin-custom-rules"
- ],
- "rules": {
- "@angular-eslint/component-selector": [
- "error",
- {
- "type": "element",
- "prefix": "app",
- "style": "kebab-case"
- }
- ],
- "@angular-eslint/contextual-decorator": "error",
- "@angular-eslint/directive-selector": [
- "error",
- {
- "type": "attribute",
- "prefix": "app",
- "style": "camelCase"
- }
- ],
- "@angular-eslint/no-host-metadata-property": "off",
- "@angular-eslint/no-lifecycle-call": "error",
- "@angular-eslint/no-pipe-impure": "error",
- "@angular-eslint/prefer-on-push-component-change-detection": "warn",
- "@angular-eslint/relative-url-prefix": "warn",
- "@angular-eslint/use-pipe-decorator": "error",
- "@typescript-eslint/array-type": "off",
- "@typescript-eslint/ban-ts-comment": "off",
- "@typescript-eslint/brace-style": "error",
- "@typescript-eslint/comma-dangle": ["error", "always-multiline"],
- "@typescript-eslint/comma-spacing": "error",
- "@typescript-eslint/consistent-type-assertions": "error",
- "@typescript-eslint/consistent-type-definitions": "error",
- "@typescript-eslint/dot-notation": "off",
- "@typescript-eslint/explicit-function-return-type": [
- "error",
- {
- "allowExpressions": true
- }
- ],
- "@typescript-eslint/explicit-member-accessibility": [
- "error",
- {
- "accessibility": "no-public"
- }
- ],
- "@typescript-eslint/explicit-module-boundary-types": [
- "error",
- {"allowArgumentsExplicitlyTypedAsAny": true}
- ],
- "@typescript-eslint/indent": ["error", 2],
- "@typescript-eslint/keyword-spacing": "error",
- "@typescript-eslint/member-delimiter-style": [
- "error",
- {
- "multiline": {
- "delimiter": "semi",
- "requireLast": true
- },
- "singleline": {
- "delimiter": "semi",
- "requireLast": true
- }
- }
- ],
- "@typescript-eslint/member-ordering": "off",
- "@typescript-eslint/method-signature-style": "error",
- "@typescript-eslint/no-confusing-non-null-assertion": "error",
- "@typescript-eslint/no-confusing-void-expression": "error",
- "@typescript-eslint/no-dynamic-delete": "warn",
- "@typescript-eslint/no-dupe-class-members": "error",
- "@typescript-eslint/no-floating-promises": "off",
- "@typescript-eslint/naming-convention": "warn",
- "@typescript-eslint/no-extra-parens": "error",
- "@typescript-eslint/no-invalid-void-type": "error",
- "@typescript-eslint/no-parameter-properties": "off",
- "@typescript-eslint/no-shadow": [
- "error",
- {
- "hoist": "all"
- }
- ],
- "@typescript-eslint/no-unnecessary-type-arguments": "error",
- "@typescript-eslint/no-unnecessary-type-constraint": "error",
- "@typescript-eslint/no-unused-expressions": [
- "error",
- {
- "allowShortCircuit": true
- }
- ],
- "@typescript-eslint/no-unused-vars": "warn",
- "@typescript-eslint/no-use-before-define": "off",
- "@typescript-eslint/no-useless-constructor": "error",
- "@typescript-eslint/object-curly-spacing": "error",
- "@typescript-eslint/prefer-for-of": "warn",
- "@typescript-eslint/prefer-function-type": "error",
- "@typescript-eslint/prefer-includes": "error",
- "@typescript-eslint/prefer-nullish-coalescing": "error",
- "@typescript-eslint/prefer-optional-chain": "error",
- "@typescript-eslint/prefer-readonly": "error",
- "@typescript-eslint/prefer-string-starts-ends-with": "error",
- "@typescript-eslint/quotes": ["error", "single"],
- "@typescript-eslint/semi": ["error", "always"],
- "@typescript-eslint/type-annotation-spacing": "error",
- "@typescript-eslint/unbound-method": ["warn", {"ignoreStatic": true}],
- "@typescript-eslint/unified-signatures": "error",
- "@typescript-eslint/no-unsafe-assignment": "off",
- "@typescript-eslint/no-unsafe-call": "off",
- "@typescript-eslint/no-unsafe-member-access": "off",
- "@typescript-eslint/no-unsafe-return": "warn",
- "custom-rules/sort-class-members": [
- "error",
- {
- "order": [
- "static-properties",
- "inputs-properties",
- "outputs-properties",
- "view-child-properties",
- "view-children-properties",
- "content-child-properties",
- "content-children-properties",
- "public-properties",
- "protected-properties",
- "private-properties",
- "constructor",
- "ng-on-changes-method",
- "ng-on-init-method",
- "ng-do-check-method",
- "ng-after-content-init-method",
- "ng-after-content-checked-method",
- "ng-after-view-init-method",
- "ng-after-view-checked-method",
- "ng-on-destroy-method",
- "public-methods",
- "protected-methods",
- "private-methods",
- "static-methods",
- "readonly",
- "read-write",
- "setter",
- "getter"
- ],
- "groups": {
- "inputs-properties": {"groupByDecorator": "Input"},
- "outputs-properties": {"type": "property", "groupByDecorator": "Output"},
- "view-child-properties": {"type": "property", "groupByDecorator": "ViewChild"},
- "view-children-properties": {"type": "property", "groupByDecorator": "ViewChildren"},
- "content-child-properties": {"type": "property", "groupByDecorator": "ContentChild"},
- "content-children-properties": {"type": "property", "groupByDecorator": "ContentChildren"},
- "ng-on-changes-method": {"type": "method", "name": "ngOnChanges"},
- "ng-on-init-method": {"type": "method", "name": "ngOnInit"},
- "ng-do-check-method": {"type": "method", "name": "ngDoCheck"},
- "ng-after-content-init-method": {"type": "method", "name": "ngAfterContentInit"},
- "ng-after-content-checked-method": {"type": "method", "name": "ngAfterContentChecked"},
- "ng-after-view-init-method": {"type": "method", "name": "ngAfterViewInit"},
- "ng-after-view-checked-method": {"type": "method", "name": "ngAfterViewChecked"},
- "ng-on-destroy-method": {"type": "method", "name": "ngOnDestroy"},
- "readonly": {"readonly": true},
- "read-write": {"readonly": false}
- }
- }
- ],
- "arrow-body-style": "error",
- "arrow-parens": [
- "error",
- "as-needed"
- ],
- "brace-style": "off",
- "comma-dangle": "off",
- "comma-spacing": "off",
- "complexity": "off",
- "curly": "error",
- "default-case": "error",
- "eol-last": "error",
- "eqeqeq": [
- "error",
- "smart"
- ],
- "guard-for-in": "off",
- "import/newline-after-import": "error",
- "import/no-default-export": "error",
- "import/no-deprecated": "warn",
- "import/order": [
- "warn",
- {
- "alphabetize": {
- "caseInsensitive": true,
- "order": "asc"
- },
- "groups": ["builtin", "external", "parent", "sibling", "index"],
- "newlines-between": "always-and-inside-groups"
- }
- ],
- "indent": "off",
- "keyword-spacing": "off",
- "max-classes-per-file": "off",
- "max-len": [
- "warn",
- {
- "code": 140
- }
- ],
- "new-parens": "error",
- "no-bitwise": "error",
- "no-caller": "error",
- "no-console": [
- "error",
- {
- "allow": ["error"]
- }
- ],
- "no-dupe-class-members": "off",
- "no-duplicate-imports": "error",
- "no-eval": "error",
- "no-extra-parens": "off",
- "no-invalid-this": "error",
- "no-multiple-empty-lines": ["error", {"max": 1}],
- "no-nested-ternary": "off",
- "no-new-func": "error",
- "no-new-wrappers": "error",
- "no-sequences": "error",
- "no-shadow": "off",
- "no-template-curly-in-string": "error",
- "no-throw-literal": "error",
- "no-trailing-spaces": "error",
- "no-undef-init": "error",
- "no-underscore-dangle": ["error", {"allowAfterThis": true}],
- "no-unused-expressions": "off",
- "no-useless-constructor": "off",
- "no-void": "error",
- "object-curly-spacing": "off",
- "object-shorthand": "error",
- "one-var": ["error", "never"],
- "padding-line-between-statements": [
- "error",
- {
- "blankLine": "always",
- "prev": ["const", "let", "var"],
- "next": "*"
- },
- {
- "blankLine": "any",
- "prev": ["const", "let", "var"],
- "next": ["const", "let", "var"]
- },
- {
- "blankLine": "always",
- "prev": "*",
- "next": "return"
- }
- ],
- "prefer-arrow/prefer-arrow-functions": "error",
- "prefer-object-spread": "error",
- "prefer-template": "error",
- "quotes": "off",
- "quote-props": [
- "error",
- "as-needed"
- ],
- "radix": "error",
- "semi": "off",
- "space-before-function-paren": [
- "error",
- {
- "anonymous": "never",
- "asyncArrow": "always",
- "named": "never"
- }
- ],
- "spaced-comment": [
- "error",
- "always",
- {
- "markers": [
- "/"
- ]
- }
- ],
- "unicorn/empty-brace-spaces": "error",
- "unicorn/filename-case": "error",
- "unicorn/no-nested-ternary": "error"
- }
- },
- {
- "files": ["*.html"],
- "extends": [
- "plugin:@angular-eslint/template/recommended"
- ]
- }
- ]
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement