Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update astUtils.isDirectiveComment with globals and exported #15775

Merged
merged 1 commit into from Apr 14, 2022

Conversation

mdjermanovic
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

Tell us about your environment:

  • ESLint Version: v8.13.0
  • Node Version: 16.14.0
  • npm Version: 8.3.1

What parser (default, @babel/eslint-parser, @typescript-eslint/parser, etc.) are you using?

default

Please show your full configuration:

Configuration
module.exports = {
    parserOptions: {
        ecmaVersion: 2015
    }
};

What did you do? Please include the actual source code causing the issue.

Online Demo

/*eslint no-inline-comments: "error" */

foo(); /* global foo */
  
bar(); /* globals bar */

var baz; /* exported baz */

What did you expect to happen?

No errors because this rule ignores eslint directives.

What actually happened? Please include the actual, raw output from ESLint.

/* global */ comment is allowed as expected, but /* globals */ and /* exported */ are disallowed.

  5:8   error  Unexpected comment inline with code  no-inline-comments
  7:10  error  Unexpected comment inline with code  no-inline-comments

✖ 2 problems (2 errors, 0 warnings)

What changes did you make? (Give an overview)

Fixed astUtils.isDirectiveComment to treat /* globals ... */ and /* exported ... */ as directives.

Is there anything you'd like reviewers to focus on?

@mdjermanovic mdjermanovic added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion labels Apr 11, 2022
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nzakas
Copy link
Member

nzakas commented Apr 14, 2022

@mdjermanovic you’re not using a different email on this commit are you? EasyCLA looks unhappy.

@mdjermanovic
Copy link
Member Author

@mdjermanovic you’re not using a different email on this commit are you? EasyCLA looks unhappy.

I used the same email. This happens sometimes with EasyCLA, I'll try close-reopen.

@mdjermanovic
Copy link
Member Author

All checks are green now.

@mdjermanovic mdjermanovic merged commit 413f1d5 into main Apr 14, 2022
@mdjermanovic mdjermanovic deleted the isdirectivecomment-update branch April 14, 2022 09:02
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Apr 25, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`8.13.0` -> `8.14.0`](https://renovatebot.com/diffs/npm/eslint/8.13.0/8.14.0) |

---

### Release Notes

<details>
<summary>eslint/eslint</summary>

### [`v8.14.0`](https://github.com/eslint/eslint/releases/v8.14.0)

[Compare Source](eslint/eslint@v8.13.0...v8.14.0)

#### Features

-   [`ab6363d`](eslint/eslint@ab6363d) feat: Add rule no-constant-binary-expression ([#&#8203;15296](eslint/eslint#15296)) (Jordan Eldredge)

#### Bug Fixes

-   [`35fa1dd`](eslint/eslint@35fa1dd) fix: allow project paths to have URL-encoded characters ([#&#8203;15795](eslint/eslint#15795)) (Milos Djermanovic)
-   [`413f1d5`](eslint/eslint@413f1d5) fix: update `astUtils.isDirectiveComment` with `globals` and `exported` ([#&#8203;15775](eslint/eslint#15775)) (Milos Djermanovic)

#### Build Related

-   [`c2407e8`](eslint/eslint@c2407e8) build: add node v18 ([#&#8203;15791](eslint/eslint#15791)) (唯然)

#### Chores

-   [`735458c`](eslint/eslint@735458c) chore: add static frontmatter to no-constant-binary-expression docs ([#&#8203;15798](eslint/eslint#15798)) (Milos Djermanovic)
-   [`db28f2c`](eslint/eslint@db28f2c) chore: Add static frontmatter to docs ([#&#8203;15782](eslint/eslint#15782)) (Nicholas C. Zakas)
-   [`3bca59e`](eslint/eslint@3bca59e) chore: markdownlint autofix on commit ([#&#8203;15783](eslint/eslint#15783)) (Nicholas C. Zakas)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1318
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
srijan-deepsource pushed a commit to DeepSourceCorp/eslint that referenced this pull request May 30, 2022
srijan-deepsource added a commit to DeepSourceCorp/eslint that referenced this pull request May 30, 2022
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Oct 12, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants