Last 12 weeks · 537 commits
5 of 6 standards met
reports as a non-standard property of . is part of the ECMAScript standard as part of Explicit Resource Management, so I would expect it to be included in the rule's static list of standard built-in properties. The rule documentation states that: The static list tracks the latest published ECMAScript edition and selected web-standard built-ins, not runtime-specific extensions or separate proposal drafts. Example: Currently reports: The same issue occurs when implementing an async disposable resource in TypeScript: Expected behavior: No error should be reported for .
Real-world use case This issue came out of a real GitLab project. Full context and the exact reproduction discussion here: gitlab-org/.../contributors-gitlab-com#556. Short version: the project follows the Rails/Vite convention of putting Vue components under . Since v65 the rule started validating directory segments too, so the lowercase folder began failing PascalCase enforcement. The project shipped as a workaround (MR !2348), but that also disables directory casing checks everywhere else — the maintainer flagged this as unideal and asked whether a directory-only skip is possible. Investigation confirmed the current API can't express it, hence this issue. Problem The option in is a full early-return: if any path segment matches an regex, both the directory-name check and the filename check are skipped for that file. This makes it impossible to express the following (fairly common) use case: "validate PascalCase on all files under , but don't complain that the directory itself is lowercase." The folder name is a Rails / Vite convention and can't be renamed. Since v65, also validates directory names, so the only way to silence the false positive today is — which disables directory casing enforcement everywhere, not just for the segment. Reproduction : Create . Expected: rule flags the kebab-case filename. Actual: rule passes silently, because matches on the segment and returns before the filename is validated. Relevant source (): Proposal Introduce a way to exempt directory segments from casing enforcement without also skipping the filename check on files inside them. Two possible shapes: Option A — new option. Backwards compatible; semantics preserved. Option B — change to skip only the directory check when . Cleaner API but a breaking change. Users relying on as a whole-file bypass (per #1406's original intent) would need to migrate. Option A seems safer. Related #1406 — original feature: intent was whole-file exemption based on path, so today's behavior is consistent with that intent. #686 — introduced . #2642 — related but different: asked for a blanket "off" inside ; this issue asks for a directory-only skip that still validates filenames. Happy to send a PR if the maintainers are open to Option A.
rule doesn't provide editor suggestions in some cases. Description The rule doesn't suggest fixes when equivalent syntax, or are used. With the rule, cases that would yield editor suggestions are auto-fixed into cases that do not: 1. ✔️ ➡️ ✖️ 1. ✔️ ➡️ ✖️ Examples 1. This usage is not detected as incorrect It should have a suggested fix to be: 2. The same is true for optional chaining It should have a suggested fix to be:
Repository: sindresorhus/eslint-plugin-unicorn. Description: More than 300 powerful ESLint rules Stars: 5229, Forks: 494. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Topics: eslint, eslint-config, eslint-plugin, eslint-rules, javascript, linting-rules, nodejs, unicorns, xo. Latest release: v73.0.0 (3w ago). Open PRs: 0, open issues: 5. Last activity: 1w ago. Community health: 100%. Top contributors: fisker, sindresorhus, bmish, fregante, futpib, MrHen, SamVerschueren, axetroy, jfmengels, AriPerkkio and others.