GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `no-redeclare` loose parser tests · Issue #14315 · eslint/eslint

no-redeclare loose parser tests #14315

New issue
Copy link
New issue
Copy link
Closed
Closed
no-redeclare loose parser tests#14315
#14569 (+9)
Copy link
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionchoreThis change is not user-facingThis change is not user-facing

Description

@mdjermanovic
mdjermanovic
opened on Apr 11, 2021
Issue body actions

The version of ESLint you are using.

v7.24.0

The problem you want to solve.

We have several tests for the no-redeclare rule where let and const variables are redeclared:

eslint/tests/lib/rules/no-redeclare.js

Lines 208 to 216 in 555cbf3

// let/const
{
code: "let a; let a;",
parser: looseParserPath,
parserOptions: { ecmaVersion: 2015 },
errors: [
{ message: "'a' is already defined.", type: "Identifier" }
]
},

This is normally a syntax error reported by the parser, so the tests are using fixture parser tests/tools/loose-parser.js

The fixture parser requires an internal module from espree in order to produce an error-tolerant parser.

eslint/tests/tools/loose-parser.js

Line 10 in 555cbf3

const espree = require("espree/lib/espree");

The problem is - after we release eslint/js#469, that module will be no more available as it isn't defined by exports in espree's package.json. Even if we could bypass this restriction, the module will be ESM so it can't be required.

Your take on the correct solution to problem.

Just remove those tests? Core rules are not generally designed to handle code that has syntax errors, at least for now.

Are you willing to submit a pull request to implement this change?

Yes.

Reacted by 唯然, Nicholas C. Zakas and Brandon Mills

Activity

  1. mdjermanovic
    added
    choreThis change is not user-facingThis change is not user-facing
    on Apr 11, 2021
  2. nzakas commented on Apr 22, 2021

    @nzakas
    nzakas
    on Apr 22, 2021
    Member
    More actions

    I agree, let's remove the tests.

  3. mdjermanovic
    added a commit that references this issue on May 5, 2021

    Chore: remove loose-parser tests (fixes #14315)

    This issue will close once commit 46dc371 is merged into the 'main' branch.
    46dc371
  4. mdjermanovic
    added
    acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusion
    on May 5, 2021
  5. btmills
    closed this as completedin #14569on May 8, 2021
  6. btmills
    added a commit that references this issue on May 8, 2021

    Chore: remove loose-parser tests (fixes #14315) (#14569)

    This issue will close once commit 6a86e50 is merged into the 'main' branch.
    6a86e50
  7. eslint-github-bot
    locked and limited conversation to collaborators on Nov 5, 2021
  8. eslint-github-bot
    added
    archived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussion
    on Nov 5, 2021
  9. nzakas
    added this to Triageon Jan 3, 2023
  10. nzakas
    moved this to Complete in Triageon Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionchoreThis change is not user-facingThis change is not user-facing

    Type

    No type

    Projects

    • Triage
      Status
      Complete
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.