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

feat: ignore camelcase rule for __webpack variables #530

Merged
merged 1 commit into from May 26, 2023

Conversation

kesselb
Copy link
Contributor

@kesselb kesselb commented May 20, 2023

// eslint-disable-next-line camelcase
__webpack_nonce__ = 'foobar'
// eslint-disable-next-line camelcase
__webpack_public_path__ = 'foobar'

Motivation: __webpack_nonce__ will always violate the camelcase rule.

The error is usually ignored with // eslint-disable-next-line camelcase.
It sounds reasonable to me to add the ignore rule by default.

An alternative approach could be to define __webpack_nonce__ as globals. The advantage is that also the un-def violation is gone and globals are by default excluded from the camelcase rule. But it's weird to define __webpack_nonce as global for every app using eslint when the variable is only available when bundled with webpack.

@kesselb kesselb requested review from susnux and skjnldsv May 20, 2023 15:27
@kesselb kesselb force-pushed the dx-warning-for-webpack-camel-case branch from be28cf3 to 13785ea Compare May 20, 2023 16:10
index.js Outdated Show resolved Hide resolved
Copy link
Contributor

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

See comment

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb kesselb force-pushed the dx-warning-for-webpack-camel-case branch from 13785ea to 0c5329c Compare May 25, 2023 12:20
@skjnldsv skjnldsv enabled auto-merge May 25, 2023 14:16
@skjnldsv skjnldsv disabled auto-merge May 26, 2023 11:39
@skjnldsv skjnldsv merged commit 5bcc580 into master May 26, 2023
4 checks passed
@skjnldsv skjnldsv deleted the dx-warning-for-webpack-camel-case branch May 26, 2023 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants