|
| 1 | +{ |
| 2 | + "root": true, |
| 3 | + "parser": "@typescript-eslint/parser", |
| 4 | + "parserOptions": { |
| 5 | + "ecmaVersion": 6, |
| 6 | + "sourceType": "module", |
| 7 | + "project": "tsconfig.json" |
| 8 | + }, |
| 9 | + "plugins": [ |
| 10 | + "@typescript-eslint" |
| 11 | + ], |
| 12 | + "rules": { |
| 13 | + "@typescript-eslint/naming-convention": [ // Naming is enforced with some exceptions below |
| 14 | + "warn", |
| 15 | + { // Names should be either camelCase or PascalCase, both are extensively used throughout this project |
| 16 | + "selector": "default", |
| 17 | + "format": [ |
| 18 | + "camelCase", |
| 19 | + "PascalCase" |
| 20 | + ] |
| 21 | + }, |
| 22 | + { // const variables can also have UPPER_CASE |
| 23 | + "selector": "variable", |
| 24 | + "modifiers": [ |
| 25 | + "const" |
| 26 | + ], |
| 27 | + "format": [ |
| 28 | + "camelCase", |
| 29 | + "PascalCase", |
| 30 | + "UPPER_CASE" |
| 31 | + ] |
| 32 | + }, |
| 33 | + { // private class properties can also have leading _underscores |
| 34 | + "selector": "classProperty", |
| 35 | + "modifiers": [ |
| 36 | + "private" |
| 37 | + ], |
| 38 | + "format": [ |
| 39 | + "camelCase", |
| 40 | + "PascalCase" |
| 41 | + ], |
| 42 | + "leadingUnderscore": "allow" |
| 43 | + } |
| 44 | + ], |
| 45 | + "@typescript-eslint/no-floating-promises": "warn", // Floating promises are bad, should do `void thePromise()` |
| 46 | + "@typescript-eslint/no-inferrable-types": "off", // This gets upset about e.g. `const foo: string = 'bar'` because it's obvious that it's a string; it doesn't matter enough to enforce |
| 47 | + "@typescript-eslint/no-unused-vars": [ // Unused variables aren't allowed, with an exception (below) |
| 48 | + "warn", |
| 49 | + { // As a function parameter, unused parameters are allowed |
| 50 | + "args": "none" |
| 51 | + } |
| 52 | + ], |
| 53 | + "@typescript-eslint/semi": "warn", // Elevate this to warning, we like semicolons |
| 54 | + "curly": "warn", // May have been a mistake to include a `{curly}` inside a template string, you might mean `${curly}` |
| 55 | + "eqeqeq": "warn", // Should use `===`, not `==`, nearly 100% of the time |
| 56 | + "no-extra-boolean-cast": "off", // We !!flatten a lot of things into booleans this way |
| 57 | + "no-throw-literal": "warn", // Elevate this from suggestion to warning |
| 58 | + "semi": "off", // Covered by @typescript-eslint/semi |
| 59 | + "@typescript-eslint/no-restricted-imports": [ |
| 60 | + "error", |
| 61 | + { |
| 62 | + "patterns": [ |
| 63 | + { |
| 64 | + "group": [ |
| 65 | + "express", |
| 66 | + "@modelcontextprotocol/*", |
| 67 | + "@microsoft/vscode-azext*" |
| 68 | + ], |
| 69 | + "message": "Please lazily import this package within the function that uses it to reduce extension activation time.", |
| 70 | + "allowTypeImports": true |
| 71 | + } |
| 72 | + ] |
| 73 | + } |
| 74 | + ] |
| 75 | + }, |
| 76 | + "extends": [ |
| 77 | + "eslint:recommended", |
| 78 | + "plugin:@typescript-eslint/eslint-recommended", |
| 79 | + "plugin:@typescript-eslint/recommended" |
| 80 | + ] |
| 81 | +} |
0 commit comments