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(eslint-plugin-tslint): add fixer for config rule #1342

Merged
merged 6 commits into from Dec 17, 2019

Conversation

johnwiseheart
Copy link
Contributor

@johnwiseheart johnwiseheart commented Dec 16, 2019

Fixes: #1340

Add a fixer for the tslint config rule.

This was easier than expected - maybe I'm missing something? I'm not convinced this is tested enough, please give me any suggestions you have. I could maybe add an additional test for the prefer-const rule, which has a tslint fixer.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @johnwiseheart!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@armano2 armano2 added the package: eslint-plugin-tslint Issues related to @typescript-eslint/eslint-plugin-tslint label Dec 16, 2019
@johnwiseheart
Copy link
Contributor Author

Hmm, its unclear to me what I need to do to fix the snapshots. The original commit was red and I tried to fix it, but looks like I fixed it wrong.

@armano2
Copy link
Member

armano2 commented Dec 16, 2019

@johnwiseheart there should not be ; in packages/eslint-plugin-tslint/tests/fixture-project/4.ts

first run failed due to integration test not unit test
https://dev.azure.com/typescript-eslint/43848853-c6f3-433c-84cc-42487a448dbf/_apis/build/builds/2583/logs/30

see tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap
you can regenerate it or just add changes:

-   "fixableErrorCount": 0,
+   "fixableErrorCount": 1,
...
      Object {
        "column": 20,
        "endColumn": 20,
        "endLine": 1,
+        "fix": Object {
+          "range": Array [
+            19,
+            19,
+          ],
+          "text": ";",
+        },
        "line": 1,
        "message": "Missing semicolon (tslint:semicolon)",
        "messageId": "failure",
        "nodeType": null,
        "ruleId": "@typescript-eslint/tslint/config",
        "severity": 2,
      },

you can execute this test localy by running (this requires you to install docker: https://docs.docker.com/compose/install/)

docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit typescript-and-tslint-plugins-together

@johnwiseheart
Copy link
Contributor Author

Hmm, it looks like this time it failed for unrelated reasons. Tried running things locally, but because of my network it doesn't work by default (I have a self-signed cert in the chain) so hopefully rerunning it will be faster than my trying to figure that out.

@armano2
Copy link
Member

armano2 commented Dec 16, 2019

ok, restarted, for some reason it failed on downloading node 11 😕

@codecov
Copy link

codecov bot commented Dec 17, 2019

Codecov Report

Merging #1342 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1342      +/-   ##
==========================================
+ Coverage   93.94%   93.94%   +<.01%     
==========================================
  Files         131      131              
  Lines        5860     5865       +5     
  Branches     1661     1662       +1     
==========================================
+ Hits         5505     5510       +5     
  Misses        188      188              
  Partials      167      167
Impacted Files Coverage Δ
packages/eslint-plugin-tslint/src/rules/config.ts 100% <100%> (ø) ⬆️

Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

seems like a good idea.
LGTM - thanks for this!

@johnwiseheart
Copy link
Contributor Author

Sweet, good to merge from my end! Don't think I have permissions, so would appreciate it if you could hit the button 😄

@bradzacher
Copy link
Member

sorry, forgot to hit it after waiting for the CI to finish

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: eslint-plugin-tslint Issues related to @typescript-eslint/eslint-plugin-tslint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It's not possible to have eslint run tslint fixers using @typescript-eslint/tslint/config
3 participants