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: use eslint env instead of individual globals #4

Merged
merged 3 commits into from
Jan 30, 2021

Conversation

achingbrain
Copy link
Member

Setting the value to false means it is not writable

Setting the value to `false` means it is not writable
achingbrain added a commit to ipfs/js-ipfs that referenced this pull request Jan 29, 2021
Depends on:

- [ ] ipfs/eslint-config-ipfs#4

BREAKING CHANGE: ipfs-repo dep update requires an database migration to v10
@achingbrain achingbrain mentioned this pull request Jan 29, 2021
1 task
achingbrain added a commit to ipfs/js-ipfs that referenced this pull request Jan 29, 2021
Depends on:

- [ ] ipfs/eslint-config-ipfs#4

BREAKING CHANGE: ipfs-repo dep update requires an database migration to v10
@hugomrdias
Copy link
Member

maybe its better to set env instead of this https://eslint.org/docs/user-guide/configuring.html#specifying-environments

also for globals (https://eslint.org/docs/user-guide/configuring.html#specifying-globals) it should be readonly or writable

@achingbrain
Copy link
Member Author

achingbrain commented Jan 29, 2021

I tried setting the env, it thinks globalThis is undefined with { browser: true, node: true }.

@hugomrdias
Copy link
Member

is Blob and others also undefined or its just globalThis? with env browser ?

@achingbrain
Copy link
Member Author

I can make it happy with:

  env: {
    es2020: true,  // for globalThis
    browser: true, // for Blob
    node: true
  },

@achingbrain
Copy link
Member Author

Setting es2020: true might finally solve ipfs/aegir#487 too

@hugomrdias
Copy link
Member

seems better, what do you think ?

we can remove the globals all together, we already have /* eslint-env mocha */ in the test files

@achingbrain achingbrain changed the title fix: allow globalThis fix: use eslint env instead of individual globals Jan 30, 2021
@achingbrain achingbrain merged commit 6dcb8fe into default Jan 30, 2021
@achingbrain achingbrain deleted the fix/allow-global-this branch January 30, 2021 07:36
achingbrain added a commit to ipfs/js-ipfs that referenced this pull request Jan 31, 2021
Depends on:

- [ ] ipfs/eslint-config-ipfs#4

BREAKING CHANGE: ipfs-repo dep update requires an database migration to v10
achingbrain added a commit to ipfs/js-ipfs that referenced this pull request Jan 31, 2021
Depends on:

- [ ] ipfs/eslint-config-ipfs#4

BREAKING CHANGE: ipfs-repo dep update requires an database migration to v10
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.

2 participants