|
| 1 | +{ |
| 2 | + "$schema": "./node_modules/oxlint/configuration_schema.json", |
| 3 | + "plugins": ["eslint", "typescript", "unicorn", "oxc", "import"], |
| 4 | + "jsPlugins": [ |
| 5 | + { |
| 6 | + "name": "mocha", |
| 7 | + "specifier": "eslint-plugin-mocha" |
| 8 | + } |
| 9 | + ], |
| 10 | + |
| 11 | + "ignorePatterns": [ |
| 12 | + "resources/playground/**", |
| 13 | + "packages/app-neovim/cursorless.nvim/**", |
| 14 | + "packages/app-vscode/src/keyboard/grammar/generated/**", |
| 15 | + "packages/lib-engine/src/customCommandGrammar/generated/**", |
| 16 | + "packages/lib-engine/src/snippets/vendor/**" |
| 17 | + ], |
| 18 | + |
| 19 | + "options": { |
| 20 | + "typeAware": true, |
| 21 | + "typeCheck": false |
| 22 | + }, |
| 23 | + |
| 24 | + "rules": { |
| 25 | + "curly": "warn", |
| 26 | + "eqeqeq": [ |
| 27 | + "warn", |
| 28 | + "always", |
| 29 | + { |
| 30 | + "null": "never" |
| 31 | + } |
| 32 | + ], |
| 33 | + "eslint/no-constant-condition": [ |
| 34 | + "warn", |
| 35 | + { |
| 36 | + "checkLoops": false |
| 37 | + } |
| 38 | + ], |
| 39 | + "eslint/no-restricted-imports": [ |
| 40 | + "warn", |
| 41 | + { |
| 42 | + "patterns": [ |
| 43 | + { |
| 44 | + "group": ["../*/src", "../*/src/*", "../../*/src", "../../*/src/*"], |
| 45 | + "message": "Relative package imports are not allowed" |
| 46 | + } |
| 47 | + ] |
| 48 | + } |
| 49 | + ], |
| 50 | + "eslint/no-throw-literal": "warn", |
| 51 | + "eslint/no-unused-vars": [ |
| 52 | + "warn", |
| 53 | + { |
| 54 | + "argsIgnorePattern": "^_", |
| 55 | + "varsIgnorePattern": "^_", |
| 56 | + "caughtErrorsIgnorePattern": "^_", |
| 57 | + "ignoreRestSiblings": true |
| 58 | + } |
| 59 | + ], |
| 60 | + "import/no-duplicates": "warn", |
| 61 | + "mocha/no-exclusive-tests": "warn", |
| 62 | + "mocha/no-pending-tests": "warn", |
| 63 | + "no-warning-comments": [ |
| 64 | + "warn", |
| 65 | + { |
| 66 | + "terms": ["todo"] |
| 67 | + } |
| 68 | + ], |
| 69 | + "typescript/consistent-type-assertions": [ |
| 70 | + "warn", |
| 71 | + { |
| 72 | + "assertionStyle": "as" |
| 73 | + } |
| 74 | + ], |
| 75 | + "typescript/consistent-type-imports": "warn", |
| 76 | + "typescript/no-base-to-string": "off", |
| 77 | + "typescript/restrict-template-expressions": "off", |
| 78 | + "typescript/unbound-method": "off", |
| 79 | + "unicorn/prefer-module": "warn", |
| 80 | + "unicorn/throw-new-error": "warn" |
| 81 | + }, |
| 82 | + "overrides": [ |
| 83 | + { |
| 84 | + "files": ["packages/app-vscode/src/scripts/**/*.ts"], |
| 85 | + "rules": { |
| 86 | + "no-restricted-imports": [ |
| 87 | + "warn", |
| 88 | + { |
| 89 | + "paths": [ |
| 90 | + { |
| 91 | + "name": "vscode", |
| 92 | + "message": "Scripts shouldn't depend on vscode" |
| 93 | + } |
| 94 | + ] |
| 95 | + } |
| 96 | + ] |
| 97 | + } |
| 98 | + }, |
| 99 | + |
| 100 | + { |
| 101 | + "files": ["packages/lib-common/**/*.ts", "packages/lib-engine/**/*.ts"], |
| 102 | + "rules": { |
| 103 | + "import/no-nodejs-modules": "warn" |
| 104 | + } |
| 105 | + }, |
| 106 | + |
| 107 | + { |
| 108 | + "files": [ |
| 109 | + "packages/lib-common/**/*.test.ts", |
| 110 | + "packages/lib-engine/**/*.test.ts", |
| 111 | + "packages/lib-engine/src/scripts/**/*.ts", |
| 112 | + "packages/lib-engine/src/testUtil/**/*.ts" |
| 113 | + ], |
| 114 | + "rules": { |
| 115 | + "import/no-nodejs-modules": "off" |
| 116 | + } |
| 117 | + }, |
| 118 | + |
| 119 | + { |
| 120 | + "files": ["packages/lib-common/src/types/command/**/*.ts"], |
| 121 | + "rules": { |
| 122 | + "eslint/no-restricted-imports": [ |
| 123 | + "warn", |
| 124 | + { |
| 125 | + "patterns": [ |
| 126 | + { |
| 127 | + "group": ["@cursorless/*", "../*"], |
| 128 | + "message": "API types shouldn't have any dependencies" |
| 129 | + } |
| 130 | + ], |
| 131 | + "paths": [ |
| 132 | + { |
| 133 | + "name": "@*", |
| 134 | + "message": "API types shouldn't have any dependencies" |
| 135 | + } |
| 136 | + ] |
| 137 | + } |
| 138 | + ] |
| 139 | + } |
| 140 | + } |
| 141 | + ] |
| 142 | +} |
0 commit comments