{ "root": true, "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": "latest", "sourceType": "module", "ecmaFeatures": { "jsx": true } }, "extends": ["prettier"], "env": { "browser": true, "es2021": true }, "ignorePatterns": ["preact/", "node_modules/"], "rules": { "no-restricted-imports": [ "error", { "patterns": [ { "group": ["./**", "../**"], "message": "Relative imports are not allowed in this package. Import via the package name instead, e.g. \"@bonniernews/dn-design-system-web/components/button/button-types.ts\" -- this keeps type resolution correct once the package is built and published." } ] } ], "no-restricted-syntax": [ "warn", { "selector": "ImportDeclaration[importKind='type'][source.value=/\\.tsx$/]", "message": "Avoid importing types from a .tsx file. Move the shared type to a .ts file and import it from there instead." }, { "selector": "ImportDeclaration:has(ImportSpecifier[importKind='type'])[source.value=/\\.tsx$/]", "message": "Avoid importing types from a .tsx file. Move the shared type to a .ts file and import it from there instead." } ] } }