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

WRR-1011: Fixed eslint and prettier lint rules to not conflict #93

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

The following is a curated list of changes in the Enact eslint config:

## [unreleased]

* Updated `@stylistic/js/space-before-function-paren` rule to fix conflicts with `prettier` rules.

## [5.0.0-alpha.2] (December 6, 2024)

* Replaced deprecated rule `no-new-object` with `no-object-constructor`.
Expand Down
9 changes: 8 additions & 1 deletion strict.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ module.exports = {
'@stylistic/js/linebreak-style': ['warn', 'unix'],
'@stylistic/js/operator-linebreak': ['warn', 'after'],
'@stylistic/js/space-before-blocks': ['warn', 'always'],
'@stylistic/js/space-before-function-paren': ['warn', 'always'],
'@stylistic/js/space-before-function-paren': [
'warn',
{
anonymous: 'always',
named: 'never',
Copy link
Contributor

@MikyungKim MikyungKim Dec 31, 2024

Choose a reason for hiding this comment

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

I think this change will make huge lint warnings from our repos which use enact lint.
If I use this branch and do npm run lint from sandstone for example, I get tons of warnings like

...
/sandstone/WizardPanels/Panel.js
  15:19  warning  Unexpected space before function parentheses  @stylistic/js/space-before-function-paren

/sandstone/internal/$L/$L.js
  14:22  warning  Unexpected space before function parentheses  @stylistic/js/space-before-function-paren
  25:25  warning  Unexpected space before function parentheses  @stylistic/js/space-before-function-paren
  47:24  warning  Unexpected space before function parentheses  @stylistic/js/space-before-function-paren
...

I don't think this is a good idea to solve the problem.

asyncArrow: 'always'
}
],
'@stylistic/js/space-infix-ops': ['warn', {
int32Hint: true
}],
Expand Down