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: add standard ts config and clean up #3

Merged
merged 4 commits into from
Dec 16, 2020
Merged

Conversation

hugomrdias
Copy link
Member

  • uses standard-with-typescript for .ts files
  • adds eslint-plugin-etc to be able to use etc/prefer-interface
  • lints repo files
  • updates deps
    • standard from 14 to 16 (and deps)
    • eslint from 6 to 7
  • removes unchanged rules from standard
    • dot-notation
    • no-case-declarations
    • no-constant-condition
    • no-empty-pattern
    • no-labels
    • quote-props
  • removes rule require-await
  • changes rules jsdoc/no-undefined-types from warn to off
  • changes rule jsdoc/require-param-description from warn to off
  • changes rule jsdoc/valid-types from warn to off
  • change eslint rule values from numbers to 'off', 'warn' and 'error' its just easier to understand

The diff isnt very friendly so i tried to list all the changes made, sorry :/

This should be a breaking change!

- uses standard-with-typescript for .ts files
- adds eslint-plugin-etc to be able to use `etc/prefer-interface`
    - [https://ncjamieson.com/prefer-interfaces/](https://ncjamieson.com/prefer-interfaces/)
    - more rules from this package can be enabled in the future
- lints repo files
- updates deps
    - standard from 14 to 16 (and deps)
    - eslint from 6 to 7
- removes unchanged rules from standard
    - dot-notation
    - no-case-declarations
    - no-constant-condition
    - no-empty-pattern
    - no-labels
    - quote-props
- removes rule `require-await`
- changes rules `jsdoc/no-undefined-types` from warn to off
- changes rule `jsdoc/require-param-description` from warn to off
- changes rule `jsdoc/valid-types` from warn to off
- change eslint rule values from numbers to 'off', 'warn' and 'error' its just easier to understand

The diff isnt very friendly so i tried to list all the changes made, sorry :/

This should be a breaking change!
@Gozala
Copy link
Contributor

Gozala commented Dec 15, 2020

This should be a breaking change!

Are we supposed to get new errors reported that we have not had before ?

@Gozala
Copy link
Contributor

Gozala commented Dec 15, 2020

@hugomrdias could you please make sure that merge commit will follow the convention outlined here https://github.com/mikeal/merge-release#workflow

So that it will produce a major version bump, given that you said it should be a breaking change.

@hugomrdias
Copy link
Member Author

yes we will have new errors.

can't you just squash merge and add the message you need ? thats what we do in all ipfs repos

// Types often are recursive & no use before define is too restrctive
"no-use-before-define": 0
'no-use-before-define': 'off', // Types often are recursive & no use before define is too restrctive
'etc/prefer-interface': 'error', // https://ncjamieson.com/prefer-interfaces/
Copy link
Contributor

Choose a reason for hiding this comment

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

This is cool and all, but feels like it could be a major pain when used with JSDoc syntax and when we import types across modules. Have you checked how well it works in practice ?

Maybe more gentle warning is a better option here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

this only applies to our types.ts files

Copy link
Contributor

@Gozala Gozala Dec 15, 2020

Choose a reason for hiding this comment

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

I also feel like this is one of the things that is silly to optimize for, TS keeps changing how they generate typedefs and it's not unreasonable to expect that they will stop emitting obsolete types and start inlining more.

Ok never mind linked blog post mislead me into thinking that it would force defs inside the closures.

@Gozala
Copy link
Contributor

Gozala commented Dec 15, 2020

can't you just squash merge and add the message you need ? thats what we do in all ipfs repos

That is what I meant, but you do need to have feat: * to trigger major bump, vs minor bump

Copy link
Contributor

@Gozala Gozala left a comment

Choose a reason for hiding this comment

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

Looks good to me, Thanks!

@hugomrdias
Copy link
Member Author

can't you just squash merge and add the message you need ? thats what we do in all ipfs repos

That is what I meant, but you do need to have feat: * to trigger major bump, vs minor bump

but you will add that when you squash, i dont need too change the commit msgs

@hugomrdias
Copy link
Member Author

do you mean i should squash merge ?

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

👌🏼

@hugomrdias hugomrdias merged commit f384060 into default Dec 16, 2020
@hugomrdias hugomrdias deleted the feat/standard-ts branch December 16, 2020 14:25
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.

4 participants