-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
- 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!
Are we supposed to get new errors reported that we have not had before ? |
@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. |
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/ |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
That is what I meant, but you do need to have |
There was a problem hiding this 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!
but you will add that when you squash, i dont need too change the commit msgs |
do you mean i should squash merge ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌🏼
etc/prefer-interface
require-await
jsdoc/no-undefined-types
from warn to offjsdoc/require-param-description
from warn to offjsdoc/valid-types
from warn to offThe diff isnt very friendly so i tried to list all the changes made, sorry :/
This should be a breaking change!