diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..da36d0b --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,37 @@ +import { defineConfig } from '@vida0905/eslint-config' + +const RESTRICTED_IMPORTS_NODE = { + regex: '^node:', + message: 'Node.js built-in modules are not available in browser environments.', +} + +export default defineConfig( + { + pnpm: true, + ignores: ['playground'], + }, + { + name: 'extensions/all', + files: ['src/**/*'], + rules: { + 'no-restricted-imports': ['error', { + patterns: [RESTRICTED_IMPORTS_NODE], + }], + }, + }, + { + name: 'extensions/commands', + files: ['src/commands/**'], + rules: { + 'no-restricted-imports': ['error', { + paths: [ + { + name: 'reactive-vscode', + message: 'Do not use reactive-vscode composables in command handlers. Use vscode API directly.', + }, + ], + patterns: [RESTRICTED_IMPORTS_NODE], + }], + }, + }, +) diff --git a/eslint.config.ts b/eslint.config.ts deleted file mode 100644 index 332251b..0000000 --- a/eslint.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineConfig } from '@vida0905/eslint-config' - -export default defineConfig( - { - pnpm: true, - ignores: ['playground'], - }, - { - files: ['src/commands/**'], - rules: { - 'no-restricted-imports': ['error', { - paths: [{ - name: 'reactive-vscode', - message: 'Do not use reactive-vscode composables in command handlers. Use vscode API directly.', - }], - }], - }, - }, -) diff --git a/package.json b/package.json index c3e86fa..83eb2ee 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,10 @@ "Other" ], "main": "./dist/index.mjs", + "browser": "./dist/index.mjs", + "extensionKind": [ + "workspace" + ], "icon": "res/logo.png", "files": [ "LICENSE.md",