Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Backlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

## ordered log (for production release)

### linter plugin

file navigation via links see Issue:

- https://github.com/microsoft/vscode/issues/54272

### gifs for transporting this topic a bit more light hearted

https://www.pinatafarm.com/memegenerator/89da5b38-ba30-4f76-b971-5e8819076eb1

Monty Python stoning = lets bring back classes to react..
john travolta = you should hire an architect
johnny depp = you are the worst architect i heard of, but you have heard of me

### fix interface collision & test case

two interface of the same name and in different files are resolved inproperly
Expand Down
86 changes: 86 additions & 0 deletions examples/tdi2-basic-example/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// eslint.config.js - TDI2 ESLint Configuration
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";

// Import the TDI2 ESLint plugin for interface resolution context
import tdi2Plugin from "@tdi2/eslint-plugin-tdi2";

export default tseslint.config(
{
ignores: [
"dist",
"node_modules",
"src/.tdi2/**",
"**/di-config.ts",
"**/*.di-transformed.*",
],
},
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parser: tseslint.parser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
"tdi2": tdi2Plugin,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],

// TDI2 interface resolution context rules
"tdi2/show-interface-resolution": "warn",
"tdi2/show-implementation-context": "warn",
"tdi2/show-interface-implementations": "warn",
"tdi2/show-missing-services-context": "warn",

// Relax TypeScript rules for DI usage
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_|^services$",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-empty-interface": [
"error",
{
allowSingleExtends: true,
},
],
},
settings: {
react: {
version: "detect",
},
},
},
// Special configuration for transformed files
{
files: ["**/*.di-transformed.*", "src/.tdi2/**/*"],
rules: {
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
"tdi2/show-interface-resolution": "off",
"tdi2/show-implementation-context": "off",
"tdi2/show-interface-implementations": "off",
},
}
);
11 changes: 8 additions & 3 deletions examples/tdi2-basic-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "vite",
"clean": "rm -rf node_modules/.tdi2 src/.tdi2 node_modules/.vite node_modules/.vite-temp",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint .",
"preview": "vite preview",
"di:clean": "rm -rf .tdi2"
},
Expand All @@ -17,13 +17,18 @@
"react-dom": "^19.0.0"
},
"devDependencies": {
"@tdi2/eslint-plugin-tdi2": "latest",
"@tdi2/vite-plugin-di": "latest",
"@eslint/js": "^9.25.0",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.4.1",
"eslint": "^9.25.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^16.0.0",
"typescript": "^5.0.2",
"typescript-eslint": "^8.30.1",
"vite": "^6.0.0",
"vite-plugin-inspect": "^11.3.3"
}
Expand Down
Loading
Loading