iTwin / iTwinUI-react

A react component library for iTwinUI.
https://github.com/iTwin/iTwinUI
Other
83 stars 23 forks source link

eslint prevents commits when committing changes in ignored files #970

Closed r100-stack closed 1 year ago

r100-stack commented 1 year ago

Describe the bug (actual behavior)

When committing changes of files that are ignored by eslint like the below three .js files, it gives the below error and prevents a commit.

image

Possible solution

As discussed with Mayank, one recommendation Mayank gave was to not run eslint for jsx, js files.

So something similar to replacing:

https://github.com/iTwin/iTwinUI-react/blob/5be110de87ce7c719d27c137f882200dc9cc01d7/apps/storybook/package.json#L46-L50

with

    "*.{tsx,ts,jsx,js}": [
      "prettier --write",
      "node ../configs/copyrightLinter.js --fix"
    ],
    "*.{tsx,ts}": [
      "eslint --max-warnings=0 --fix"
    ]

Expected behavior

Should not block commits when eslint ignored files are changed.

Steps to reproduce

To reproduce this, we can edit eslint ignored files, like any of the three files mentioned in the screenshot above.

Additional information

I encountered this when merging the latest main branch (v2.0.1) with the old rohan/table-ctrl-shift-click-1 branch of my PR #888