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

Disable --fix for sort-prop-types #2505

Merged
merged 1 commit into from Nov 28, 2019

Conversation

@webOS101
Copy link
Contributor

webOS101 commented Nov 23, 2019

This addresses #1940 by disabling the fix option for sort-prop-types until a better fix to copy the comments is available.

…ofix

See #1940.
@webOS101

This comment has been minimized.

Copy link
Contributor Author

webOS101 commented Nov 23, 2019

I'd hoped to keep this PR simple, but it required removing quite a bit of code. Also, there are some failing Travis tests that seem unrelated to this PR. Finally, not sure why, but I couldn't seem to execute tests locally. Suspect it might be outdated eslint pulled in from typescript-eslint-parser? Perhaps the dev dependency should be updated explicitly to a more recent version of eslint if it is required for testing? After I forced the install of eslint@6 linting seemed possible, though full of warnings.

@webOS101 webOS101 force-pushed the webOS101:feature/partial-fix-1940 branch from 1748d42 to 333ab65 Nov 23, 2019
Copy link
Collaborator

ljharb left a comment

It'd also be great to have a failing test (with commented-out output) that includes comments?

@@ -98,18 +95,6 @@ module.exports = {
return;
}

function fix(fixer) {

This comment has been minimized.

Copy link
@ljharb

ljharb Nov 23, 2019

Collaborator

could we keep this as commented code, and do something like const fix = undefined; or something, so that all the rest of the code passing fix doesn't have to change?

This comment has been minimized.

Copy link
@webOS101

webOS101 Nov 23, 2019

Author Contributor

I thought it might be easier to make this easy to revert to restore the missing code when desired. I tend to not like to keep large swaths of commented out code around, but I can do that if desired.

This comment has been minimized.

Copy link
@ljharb

ljharb Nov 25, 2019

Collaborator

generally i'd agree, but in this case i think it'd be preferable.

@@ -486,18 +486,7 @@ ruleTester.run('sort-prop-types', rule, {
line: 4,
column: 5,
type: 'Property'
}],
output: [

This comment has been minimized.

Copy link
@ljharb

ljharb Nov 23, 2019

Collaborator

similarly i wonder if we could comment out instead of remove all these outputs - since they're all correct for when we re-enable the fixer.

@webOS101

This comment has been minimized.

Copy link
Contributor Author

webOS101 commented Nov 23, 2019

I can add the failing test case, commented out. As mentioned, I was keeping this easy to revert. I can either add the failing test here or in another PR, or I if you do want me to go the comment-out route, I can easily add the test in. I just remembered that jsx-sort-default-props also uses the same code and probably suffers the same problem, I didn't test it though. I threw in a test locally and it does have the same issue. After some direction I'll either redo this with jsx-sort-default-props unfixed as well or make another. Shame it never got renamed to sort-default-props.

@webOS101

This comment has been minimized.

Copy link
Contributor Author

webOS101 commented Nov 25, 2019

@ljharb I went ahead and changed the removals to comments and added failing (but commented out) tests for sort with comments. I did not yet disable --fix for jsx-sort-default-props but think I should probably do that as well in this same PR. Agree?

@ljharb

This comment has been minimized.

Copy link
Collaborator

ljharb commented Nov 25, 2019

Yes, I agree. Thanks!

@webOS101

This comment has been minimized.

Copy link
Contributor Author

webOS101 commented Nov 26, 2019

@ljharb Disabled fix for jsx-sort-default-props. I think this is more-or-less ready to go.

@ljharb ljharb force-pushed the webOS101:feature/partial-fix-1940 branch from 3fd20a2 to 78d2ab6 Nov 28, 2019
@ljharb

This comment has been minimized.

Copy link
Collaborator

ljharb commented Nov 28, 2019

Looks like there's some tests failing on master :-/ I filed eslint/eslint#12614 to track it.

@ljharb ljharb force-pushed the webOS101:feature/partial-fix-1940 branch from 78d2ab6 to 55b605f Nov 28, 2019
@ljharb
ljharb approved these changes Nov 28, 2019
@ljharb ljharb merged commit 55b605f into yannickcr:master Nov 28, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.01%) to 97.523%
Details
@webOS101 webOS101 deleted the webOS101:feature/partial-fix-1940 branch Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.