-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cc/linting ts #2542
Cc/linting ts #2542
Conversation
Not sure it is connected with the failing tests, but this PR currently changes |
Thanks @ChristopherChudzicki for working this out! That is a huge amount of work! I'm glad that the code style is mostly the same as before (all of the changes in #2541 would be bit too much indeed 😅). The only left over changes make sense to me: replacing The tests fail because of an issue with the git url of @gwhitney the |
@josdejong I think that's definitely a concern. Even if they release a new npm version from current master within the next week or so, how well will it be maintained with future releases of the peer dependencies? And there are 5 peerDependencies with non-* versions. So I think this is a real concern. In general, it seems to me that StandardJS's support for typescript is not great. The support is better when using StandardJS configs through ESLint rather than the StandrdJS CLI, but still not particularly good, as we're seeing with eslint-config-standard-with-typescript. (Aside: their CLI support still has a peer dependency of Typescript 3.. TS 4 was released 2 years ago.) From #2488 (comment)
I think there are conflicting goals:
I think we can basically get any two but not all three: (1) and (2) mean dropping StandardJS, which implies a big diff, probably not too dissimilar from that in #2541. But I think we could skirt (1) reasonably. @josdejong, what would you think of using an ESLint config along the lines of // for js (and a variant with 'plugin:mocha/recommended' for js tests)
extends: ['standard']
// for typescript
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
] This would be sort of separate setups for TS and JS. But
IMO, ☝️ is probably the sweet spot of effort / maintenance / git history. @josdejong What do you think? |
That makes a lot of sense, good idea. Right now we do not have TypeScript code in the project except for the type definitions. So I think it's ok if the TS code style is not exactly the same as the JS code style. Makes sense to take that approach as the first step. In another future step we may want to move towards "eslint" defaults and away from "standardjs". But since that will be a huge change breaking all open PR's and branches, let's only do that if there is real need for it and then plan it smartly. |
Closing in favor of #2544 |
What are the associated issues?
#2488
What does this PR do?
Enforces linting rules via ESLint instead of the StandardJS CLI. The ESLint configs used are
standard
for jsstandard + plugin:mocha/recommended
for testsstandard-with-typescript
for typescript.How should this be manually tested?
Check that linting still works as expected in js, and that linting now works in Typescript files (whereas it did not before).
Why is this using Chris' fork of
eslint-config-standard-with-typescript
This currently uses my fork of https://github.com/standard/eslint-config-standard-with-typescript, which doesn't seem great, and if there's a desire to wait to merge this until that's an official version is used. ESLint 8 has been out for 6 months so seems like the thing to use;
standard-with-typescript
was updated (on github) to use ESLint 8 a few days ago, but the npm version has not been published yet. Hopefully soon Until then, this is using https://github.com/ChristopherChudzicki/eslint-config-standard-with-typescript/releases/tag/v22.0.0Linting Errors
These shows the linting errors that were present after initial commit on thsi branch, if anyone is interested: https://drive.google.com/drive/folders/18FHojFNNwCGJFwAp3IUb8KjvUeL8ft9i?usp=sharing