|
| 1 | +import eslint from "@eslint/js"; |
| 2 | +import tseslint from "typescript-eslint"; |
| 3 | +import eslintConfigPrettier from "eslint-config-prettier"; |
| 4 | + |
| 5 | +export default tseslint.config( |
| 6 | + { |
| 7 | + ignores: ["out/", "test-out/", "dist/", "test-dist/", "**/*.d.ts", "node_modules/", "lib/"], |
| 8 | + }, |
| 9 | + eslint.configs.recommended, |
| 10 | + eslintConfigPrettier, |
| 11 | + { |
| 12 | + files: ["src/**/*.ts"], |
| 13 | + plugins: { |
| 14 | + "@typescript-eslint": tseslint.plugin, |
| 15 | + }, |
| 16 | + languageOptions: { |
| 17 | + parser: tseslint.parser, |
| 18 | + ecmaVersion: 2020, |
| 19 | + sourceType: "module", |
| 20 | + globals: { |
| 21 | + Buffer: "readonly", |
| 22 | + NodeJS: "readonly", |
| 23 | + console: "readonly", |
| 24 | + process: "readonly", |
| 25 | + setTimeout: "readonly", |
| 26 | + clearTimeout: "readonly", |
| 27 | + setInterval: "readonly", |
| 28 | + clearInterval: "readonly", |
| 29 | + URL: "readonly", |
| 30 | + __dirname: "readonly", |
| 31 | + __filename: "readonly", |
| 32 | + require: "readonly", |
| 33 | + module: "readonly", |
| 34 | + exports: "readonly", |
| 35 | + }, |
| 36 | + }, |
| 37 | + rules: { |
| 38 | + "no-unused-vars": "off", |
| 39 | + "@typescript-eslint/naming-convention": [ |
| 40 | + "warn", |
| 41 | + { |
| 42 | + selector: "import", |
| 43 | + format: ["camelCase", "PascalCase"], |
| 44 | + }, |
| 45 | + ], |
| 46 | + curly: "warn", |
| 47 | + eqeqeq: "warn", |
| 48 | + "no-throw-literal": "warn", |
| 49 | + semi: "off", |
| 50 | + }, |
| 51 | + }, |
| 52 | + { |
| 53 | + files: ["src/ui/webview/**/*.js"], |
| 54 | + languageOptions: { |
| 55 | + ecmaVersion: 2020, |
| 56 | + sourceType: "module", |
| 57 | + globals: { |
| 58 | + document: "readonly", |
| 59 | + window: "readonly", |
| 60 | + console: "readonly", |
| 61 | + acquireVsCodeApi: "readonly", |
| 62 | + setTimeout: "readonly", |
| 63 | + clearTimeout: "readonly", |
| 64 | + MutationObserver: "readonly", |
| 65 | + HTMLElement: "readonly", |
| 66 | + }, |
| 67 | + }, |
| 68 | + rules: { |
| 69 | + "no-unused-vars": "off", |
| 70 | + curly: "warn", |
| 71 | + eqeqeq: "warn", |
| 72 | + semi: "off", |
| 73 | + }, |
| 74 | + } |
| 75 | +); |
0 commit comments