-
Notifications
You must be signed in to change notification settings - Fork 437
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
chore: Convert ES Lint to Flat Config #1631
chore: Convert ES Lint to Flat Config #1631
Conversation
Change the packages to TypeScript Lint to the next gen package. Migrate all the settings over from the existing ESLint config. Remove `deprecated` and `removed` rules. Enable the typescript strict type checked and stylistic checked rule collections. Update lint config to ES 2021 instead of ES6. Add the new ESLint config to the typescript config so that it is aware if it and can provide typing services in the config file.
The next gen version of ES Lint no longer supports passing multiple values with a single instance of the parameter, now it needs to be split into multiple calls of the param. The ext param is no longer needed however as ESlint knows what it should and should not lint. Split out the TSC command into a post script since it is technically its own invocation.
The Lib, Examples and benchmarks folders should be excluded for now. I would recommend including them in the future as everything should be linted, including examples.
Items are excluded in the linter config, and should not be in the `package.json`.
The `eqeqeq` option should be stricter as JavaScript's type safety is notoriously lacking..
Once the #1630 PR is merged, then I can add the IDE configs required for the new flat files into this PR |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1631 +/- ##
==========================================
- Coverage 79.19% 78.45% -0.75%
==========================================
Files 93 93
Lines 4860 4860
Branches 933 933
==========================================
- Hits 3849 3813 -36
- Misses 707 750 +43
+ Partials 304 297 -7 ☔ View full report in Codecov by Sentry. |
This is great, thank you! ❤️ Would you mind changing this pull request to only focus on switching to the flat config, without changing the rules that are applied? I'm open to changing the linting rules, but I'd prefer a separate PR per changed lint rule so that we can have all config change plus all the required code changes per rule change together. Otherwise, this PR will just become too unwieldy and impossible to review. 🙇♂️ |
Works for me, changes incoming on Monday!
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Arthur Schreiber ***@***.***>
Sent: Saturday, May 4, 2024 12:16:17 AM
To: tediousjs/tedious ***@***.***>
Cc: Elliot Huffman ***@***.***>; Author ***@***.***>
Subject: Re: [tediousjs/tedious] chore: Convert ES Lint to Flat Config (PR #1631)
This is great, thank you! ❤️
Would you mind changing this pull request to only focus on switching to the flat config, without changing the rules that are applied? I'm open to changing the linting rules, but I'd prefer a separate PR per changed lint rule so that we can have all config change plus all the required code changes per rule change together.
Otherwise, this PR will just become too unwieldy and impossible to review. 🙇♂️
—
Reply to this email directly, view it on GitHub<#1631 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABGMEWTZLYQYE5QTKZZDMNTZAROJDAVCNFSM6AAAAABHGCQOQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJUGAYDANZTGE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
These will be enabled in future PRs...
@arthurschreiber, the linting rulesets have been disabled. I will enable one ruleset at a time and have the contents of the project fixed and make that a PR. |
Add the parser configs that are necessary to run the typescript linter.
Remove duplicate rule config and and use the more specifically configured option as the source of truth.
Enable the es lint recommended ruleset, the same way that it was configured in the legacy config. Read here for the specifics of what it does: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/src/configs/eslint-recommended.ts
|
Configured these rules, even through they are not best practice so that lint would pass more. (Upon request)
This directive was not used, so removing the disable comment.
The reason for the new lint failures for files in the We can later focus on aligning the configuration between the test folder and the rest of the source to use the same linter settings. |
Oh, I missed this, can do! |
Changes:
tsc
command in lint to apostlint
command so that it simplifies and modularizes the lint command set.