diff --git a/.eslintrc.json b/.eslintrc.json index 6bcea9dd04..1bd7b04f21 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,106 +4,118 @@ "browser": true, "webextensions": true }, - "plugins": ["@typescript-eslint", "rxjs", "rxjs-angular", "import"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": ["./tsconfig.eslint.json"], - "sourceType": "module" - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:import/recommended", - "plugin:import/typescript", - "prettier", - "plugin:rxjs/recommended" - ], - "settings": { - "import/parsers": { - "@typescript-eslint/parser": [".ts"] - }, - "import/resolver": { - "typescript": { - "alwaysTryTypes": true - } - } - }, - "rules": { - "@typescript-eslint/no-explicit-any": "off", // TODO: This should be re-enabled - "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], - "@typescript-eslint/explicit-member-accessibility": [ - "error", - { - "accessibility": "no-public" - } - ], - "@typescript-eslint/no-this-alias": [ - "error", - { - "allowedNames": ["self"] - } - ], - "no-console": "error", - "import/no-unresolved": "off", // TODO: Look into turning off once each package is an actual package. - "import/order": [ - "error", - { - "alphabetize": { - "order": "asc" + "overrides": [ + { + "files": ["*.ts", "*.js"], + "plugins": ["@typescript-eslint", "rxjs", "rxjs-angular", "import"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": ["./tsconfig.eslint.json"], + "sourceType": "module", + "ecmaVersion": 2020 + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:import/recommended", + "plugin:import/typescript", + "prettier", + "plugin:rxjs/recommended" + ], + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [".ts"] }, - "newlines-between": "always", - "pathGroups": [ + "import/resolver": { + "typescript": { + "alwaysTryTypes": true + } + } + }, + "rules": { + "@typescript-eslint/no-explicit-any": "off", // TODO: This should be re-enabled + "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], + "@typescript-eslint/explicit-member-accessibility": [ + "error", { - "pattern": "@bitwarden/**", - "group": "external", - "position": "after" - }, - { - "pattern": "src/**/*", - "group": "parent", - "position": "before" + "accessibility": "no-public" } ], - "pathGroupsExcludedImportTypes": ["builtin"] - } - ], - "rxjs-angular/prefer-takeuntil": "error", - "rxjs/no-exposed-subjects": ["error", { "allowProtected": true }], - "no-restricted-syntax": [ - "error", - { - "message": "Calling `svgIcon` directly is not allowed", - "selector": "CallExpression[callee.name='svgIcon']" - }, - { - "message": "Accessing FormGroup using `get` is not allowed, use `.value` instead", - "selector": "ChainExpression[expression.object.callee.property.name='get'][expression.property.name='value']" - } - ], - "curly": ["error", "all"], - "import/namespace": ["off"], // This doesn't resolve namespace imports correctly, but TS will throw for this anyway - "import/no-restricted-paths": [ - "error", - { - "zones": [ - // Do not allow angular/node code to be imported into common + "@typescript-eslint/no-this-alias": [ + "error", { - "target": "./libs/common/**/*", - "from": "./libs/angular/**/*" + "allowedNames": ["self"] + } + ], + "no-console": "error", + "import/no-unresolved": "off", // TODO: Look into turning off once each package is an actual package. + "import/order": [ + "error", + { + "alphabetize": { + "order": "asc" + }, + "newlines-between": "always", + "pathGroups": [ + { + "pattern": "@bitwarden/**", + "group": "external", + "position": "after" + }, + { + "pattern": "src/**/*", + "group": "parent", + "position": "before" + } + ], + "pathGroupsExcludedImportTypes": ["builtin"] + } + ], + "rxjs-angular/prefer-takeuntil": "error", + "rxjs/no-exposed-subjects": ["error", { "allowProtected": true }], + "no-restricted-syntax": [ + "error", + { + "message": "Calling `svgIcon` directly is not allowed", + "selector": "CallExpression[callee.name='svgIcon']" }, { - "target": "./libs/common/**/*", - "from": "./libs/node/**/*" + "message": "Accessing FormGroup using `get` is not allowed, use `.value` instead", + "selector": "ChainExpression[expression.object.callee.property.name='get'][expression.property.name='value']" } + ], + "curly": ["error", "all"], + "import/namespace": ["off"], // This doesn't resolve namespace imports correctly, but TS will throw for this anyway + "import/no-restricted-paths": [ + "error", + { + "zones": [ + // Do not allow angular/node code to be imported into common + { + "target": "./libs/common/**/*", + "from": "./libs/angular/**/*" + }, + { + "target": "./libs/common/**/*", + "from": "./libs/node/**/*" + } + ] + } + ], + "no-restricted-imports": [ + "error", + { "patterns": ["src/**/*"], "paths": ["@fluffy-spoon/substitute"] } ] } - ], - "no-restricted-imports": [ - "error", - { "patterns": ["src/**/*"], "paths": ["@fluffy-spoon/substitute"] } - ] - }, - "overrides": [ + }, + { + "files": ["*.html"], + "parser": "@angular-eslint/template-parser", + "plugins": ["@angular-eslint/template"], + "rules": { + "@angular-eslint/template/button-has-type": "error" + } + }, { "files": ["libs/common/src/**/*.ts"], "rules": { diff --git a/apps/browser/src/popup/vault/vault-select.component.html b/apps/browser/src/popup/vault/vault-select.component.html index a25f49ebf2..b6da7308ca 100644 --- a/apps/browser/src/popup/vault/vault-select.component.html +++ b/apps/browser/src/popup/vault/vault-select.component.html @@ -1,3 +1,5 @@ + +
diff --git a/apps/browser/src/popup/vault/view.component.html b/apps/browser/src/popup/vault/view.component.html index 151460d0ac..3d5c5450bc 100644 --- a/apps/browser/src/popup/vault/view.component.html +++ b/apps/browser/src/popup/vault/view.component.html @@ -1,3 +1,5 @@ + +
diff --git a/apps/desktop/src/app/layout/account-switcher.component.html b/apps/desktop/src/app/layout/account-switcher.component.html index 991e0dfb71..e5482b938f 100644 --- a/apps/desktop/src/app/layout/account-switcher.component.html +++ b/apps/desktop/src/app/layout/account-switcher.component.html @@ -1,3 +1,5 @@ + + diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/layout/org-switcher.component.html b/bitwarden_license/bit-web/src/app/secrets-manager/layout/org-switcher.component.html index 9b678157ca..1282b48d5a 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/layout/org-switcher.component.html +++ b/bitwarden_license/bit-web/src/app/secrets-manager/layout/org-switcher.component.html @@ -1,3 +1,5 @@ + + +