{"id":15982237,"url":"https://github.com/juliancataldo/eslint-plugin-playground","last_synced_at":"2025-04-04T19:17:49.194Z","repository":{"id":223817038,"uuid":"761627669","full_name":"JulianCataldo/eslint-plugin-playground","owner":"JulianCataldo","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-22T08:08:23.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T15:12:29.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JulianCataldo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-22T07:24:35.000Z","updated_at":"2024-02-22T08:08:26.000Z","dependencies_parsed_at":"2024-02-22T08:44:05.672Z","dependency_job_id":null,"html_url":"https://github.com/JulianCataldo/eslint-plugin-playground","commit_stats":null,"previous_names":["juliancataldo/eslint-plugin-playground"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulianCataldo%2Feslint-plugin-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulianCataldo%2Feslint-plugin-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulianCataldo%2Feslint-plugin-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulianCataldo%2Feslint-plugin-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JulianCataldo","download_url":"https://codeload.github.com/JulianCataldo/eslint-plugin-playground/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234944,"owners_count":20905855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T01:01:56.659Z","updated_at":"2025-04-04T19:17:49.170Z","avatar_url":"https://github.com/JulianCataldo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESLint Plugin Playground\n\nExperiment for making [ESLint Stylistic](https://eslint.style/) to format like\n[Prettier does](https://prettier.io/blog/2020/08/24/2.1.0.html) for `html` template tag literals (and `svg`, `css`).\n\nIt is just using Prettier inside the template literal. This is a analogous to [ESLint plugin format](https://github.com/antfu/eslint-plugin-format), but for embedded languages.\n\nThis is my first attempt at making an ESLint plugin, so expect this to be very naive.\n\n---\n\n## Current issues\n\n- Trim remaining surrounding whitespace\n- Inherit indenting level\n- How are nested literals supposed to behave?\n- Should extract interpolations from the formatting process\n- Replacing the text seems to block further processing for nested templates\n\n## Try with the testbed\n\n```\npnpm i\npnpm dev\n```\n\n\u003c!-- ___DEMO___ --\u003e\n\n\u003c!--  --\u003e\n\n## Original\n\n\u003c!-- prettier-ignore --\u003e\n```ts\nconst name = `Rantanplan`\n  const animals = [ \n    `dog`,\"cat\"]\n\n\n        \n\n\nexport default createBeerBottle({\n           drink: ({ url }) =\u003e html`\n   ${url}\n\n\u003cdiv\u003e\n        \u003ch1\u003eIt's a 404!\u003c/h1\u003e\n\n  \u003c/  div\u003e\n                                               ${\n                                                                // My eyes bleed\n                                                 name +     'dddd'}\n\n                   \u003cspan\u003e\n\n                   ${animals.map((e,i)=\u003ehtml`\n                                                \u003cspan\u003e\n                                                  \u003cdiv\u003e     ${e} / ${i}   \u003c/div\u003e\n                                                    \u003c/span\u003e\n                   `)}\n                       \u003c/span\u003e\n\n\n\n                   \u003chr /\u003e\n `,\n});\n\n```\n\n\u003c!-- prettier-ignore --\u003e\n## With Prettier\n\n```ts\nconst name = `Rantanplan`;\nconst animals = [`dog`, \"cat\"];\n\nexport default createBeerBottle({\n  drink: ({ url }) =\u003e html`\n    ${url}\n\n    \u003cdiv\u003e\n      \u003ch1\u003eIt's a 404!\u003c/h1\u003e\n    \u003c/div\u003e\n    ${\n      // My eyes bleed\n      name + \"dddd\"\n    }\n\n    \u003cspan\u003e\n      ${animals.map(\n        (e, i) =\u003e html`\n          \u003cspan\u003e\n            \u003cdiv\u003e${e} / ${i}\u003c/div\u003e\n          \u003c/span\u003e\n        `,\n      )}\n    \u003c/span\u003e\n\n    \u003chr /\u003e\n  `,\n});\n\n```\n\n## Current result\n\n\u003c!-- prettier-ignore --\u003e\n```ts\nconst name = `Rantanplan`;\nconst animals = [\n    `dog`, \"cat\"\n];\n\nexport default createBeerBottle({\n  drink: ({ url }) =\u003e html` ${url}\n\n\u003cdiv\u003e\n  \u003ch1\u003eIt's a 404!\u003c/h1\u003e\n\u003c/div\u003e\n${ // My eyes bleed name + 'dddd'}\n\n\u003cspan\u003e\n  ${animals.map((e,i)=\u003ehtml`\n  \u003cspan\u003e\n    \u003cdiv\u003e${e} / ${i}\u003c/div\u003e\n  \u003c/span\u003e\n  `)}\n\u003c/span\u003e\n\n\u003chr /\u003e\n`\n,\n});\n\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliancataldo%2Feslint-plugin-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliancataldo%2Feslint-plugin-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliancataldo%2Feslint-plugin-playground/lists"}