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

Bug: lines-around-directive behaves differently when there is comment on the previous line #16629

Closed
mvorisek opened this issue Dec 7, 2022 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly repro:needed
Projects

Comments

@mvorisek
Copy link

mvorisek commented Dec 7, 2022

How to reproduce?

config: https://github.com/fomantic/Fomantic-UI/blob/f7259f27c8f041eb43997dcb12ee6b03984055ec/.eslintrc.js

code:

(function ($, window, document) {
    'use strict';

    function isWindow(obj) {
        return obj != null && obj === obj.window;
    }

passes (no errors)

but

(function ($, window, document, undefined) { // eslint-disable-line no-shadow-restricted-names
    'use strict';

    function isWindow(obj) {
        return obj != null && obj === obj.window;
    }

is failing (and if a new line before 'use strict'; is added, there are another errors)

What did you expect to happen?

no error, comment on the previous line should not change the eslint behaviour

What actually happened?

https://github.com/fomantic/Fomantic-UI/actions/runs/3642985903/jobs/6150711682#step:5:11

/home/runner/work/Fomantic-UI/Fomantic-UI/src/definitions/behaviors/api.js
Error:   12:5  error  Expected newline before "use strict" directive  lines-around-directive
@mvorisek mvorisek added bug ESLint is working incorrectly repro:needed labels Dec 7, 2022
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Dec 7, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 7, 2022
@mdjermanovic mdjermanovic moved this from Needs Triage to Triaging in Triage Dec 7, 2022
@mdjermanovic
Copy link
Member

lines-around-directive is deprecated, so we're not making any changes to it. You can use padding-line-between-statements instead.

@mdjermanovic mdjermanovic closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2022
Triage automation moved this from Triaging to Complete Dec 7, 2022
@mvorisek
Copy link
Author

mvorisek commented Dec 7, 2022

Thank you and sorry for this issue, I was convinced this has to be comming from the recommended eslint config as the rule was not in my config, but the problem is in Airbnb ruleset and I opened an issue there.

mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 9, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 11, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 11, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 12, 2022
mvorisek added a commit to mvorisek/Fomantic-UI that referenced this issue Dec 13, 2022
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jun 6, 2023
@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 Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly repro:needed
Projects
Archived in project
Triage
Complete
Development

No branches or pull requests

2 participants