{"id":31714742,"url":"https://github.com/3ru/eslint-baseline-compat-contrast","last_synced_at":"2025-10-09T01:48:01.889Z","repository":{"id":315743045,"uuid":"1060679267","full_name":"3ru/eslint-baseline-compat-contrast","owner":"3ru","description":"Type‑aware Baseline linting demo","archived":false,"fork":false,"pushed_at":"2025-09-20T11:24:31.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-03T09:57:44.641Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/3ru.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-20T11:21:47.000Z","updated_at":"2025-09-20T11:25:46.000Z","dependencies_parsed_at":"2025-09-20T13:16:52.930Z","dependency_job_id":"362ccb78-ab9f-41b5-baae-10b120086633","html_url":"https://github.com/3ru/eslint-baseline-compat-contrast","commit_stats":null,"previous_names":["3ru/eslint-baseline-compat-contrast"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/3ru/eslint-baseline-compat-contrast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3ru%2Feslint-baseline-compat-contrast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3ru%2Feslint-baseline-compat-contrast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3ru%2Feslint-baseline-compat-contrast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3ru%2Feslint-baseline-compat-contrast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3ru","download_url":"https://codeload.github.com/3ru/eslint-baseline-compat-contrast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3ru%2Feslint-baseline-compat-contrast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000709,"owners_count":26082895,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-10-09T01:47:59.321Z","updated_at":"2025-10-09T01:48:01.884Z","avatar_url":"https://github.com/3ru.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Baseline vs compat — Type-aware contrast\n\nThis minimal demo shows a case that `eslint-plugin-compat` often misses but `eslint-plugin-baseline-js` (type‑aware) detects:\n\n- A typed instance method: `arr.toSorted()` where `arr: number[]`.\n  - `eslint-plugin-baseline-js` uses TypeScript type information to confirm `arr` is an `Array` and flags `toSorted` when the Baseline is set to 2022.\n  - `eslint-plugin-compat` can detect `[].toSorted()` (array literal) but generally can’t infer that an arbitrary identifier `arr` is an Array without types, so it usually misses `arr.toSorted()`.\n\n## Install\n```bash\nnpm i\n```\n\n## Run (baseline, type‑aware)\n```bash\nnpm run lint:baseline\n```\nExpected: an error for `arr.toSorted()` from `eslint-plugin-baseline-js`.\n\nExample output:\n```sh\nbaseline-demo-contrast/src/sort.ts\n  5:5  error  Feature 'Array by copy' (array-by-copy) became Baseline in 2023 and exceeds 2022  baseline-js/use-baseline\n\n✖ 1 problem (1 error, 0 warnings)\n```\n\nIf you uncomment the literal case (`[3, 1, 2].toSorted()`), it will also be flagged under the same Baseline policy.\n\n## Run (compat)\n```bash\nnpm run lint:compat\n```\nExpected: no error for `arr.toSorted()` (identifier receiver). If you uncomment the literal case `[3, 1, 2].toSorted()`, `eslint-plugin-compat` flags that line only (the identifier case remains unflagged).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3ru%2Feslint-baseline-compat-contrast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3ru%2Feslint-baseline-compat-contrast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3ru%2Feslint-baseline-compat-contrast/lists"}